Question
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
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.
python code pleas
okay c++ will be fine
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started