Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Define Administration?

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago