Question: Using Python 3, please write a code executing the following: a) randomly generate three numbers [0..9] (*** the order among three numbers matters ***) b)

Using Python 3, please write a code executing the following:

a) randomly generate three numbers [0..9] (*** the order among three numbers matters ***)

b) continuously guess all three numbers until all three numbers are guessed correctly. Write two different ways of guessing 3 random numbers: A brute-force permutation algorithm and Random algorithm.

c) keep track of the number of guesses

d) repeat the steps a) to c) x number of times, where x should be at least 10,000

Expected outputs:

a) Deterministic brute-force algorithm: Number of Tries: 10000 Highest number of guess in a try: xxxx Lowest Tries: xxxx 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: xxxx Lowest Tries: xxxx Number of Correct Tries: xxxx Average number of tries: xxx.xx

PLEASE EXPLAIN EACH STEP AND DO NOT USE EXISTING CODE. THANK YOU!

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!