Question: Please help! I really tried to do it. the coding language is in Python 3. 1) Write a code executing following: a) randomly generate three

Please help! I really tried to do it. the coding language is in Python 3.  Please help! I really tried to do it. the coding language
is in Python 3. 1) Write a code executing following: a) randomly
generate three numbers [0..9] (*** the order among three numbers matters ***)

1) Write a code executing following: a) randomly generate three numbers [0..9] (*** the order among three numbers matters ***) b) then in loop(s), continuously guess all three numbers in the given order (see below 2) for two ways of guessing 3 random numbers) c) count the number of guesses d) repeat steps a) - c) x number of times (at least x= 10,0000 times) in a loop 2) For the algorithm of guessing 3 random numbers in [0 .. 9], please use following two ways. a) Deterministic but brute-force algorithm: The number of guesses of each try should be less than or equal to 1,000. What would be the average number of guess per try? Please guess before you try it out in your program. b) Complete pure random algorithm This algorithm will not use any prior information to guess (no elimination whatsoever!!). Each iteration, it will guess three new numbers randomly to check if they are correct. Theoretically the upper bound number of the guesses of this algorithm is unlimited. So please stop your guessing when your number of guesses reaches at 10,000 in each try. You may record and display the number of such case. What would be the average number of guess per try? Please guess before you try it out in your program. 3) Expected outputs: a) Deterministic brute-force algorithm: a) Deterministic brute-force algorithm: Number of Tries: 10000 Highest number of guess in a try: 998 Lowest Tries: 3 Number of Correct Tries: 10000 Average number of tries: XXX.XX b) Complete pure random algorithm Number of Tries: 10000 Highest number of guess in a try: 8944 Lowest Tries: 1 Number of Correct Tries: 10000 Average number of tries: XXX.XX

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!