Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Simulate a ping pong game with one of the above-mentioned random number generators - system random function with seed = 5, and compute the probability
Simulate a ping pong game with one of the above-mentioned random number generators - system random function with seed = 5, and compute the probability you win a ping pong game up to n points when your probability of winning each point is p (and your friend wins the point with probability 1 − p). Assume you have to win by (at least) 2; for example, if n = 21 and the score is 21 - 20, the game isn't over yet. - Simulate ntrials = 5, 000 games, and make a single plot with the x-axis being p for different values of p in {0, 0.04, 0.08, · · · , 0.96, 1.0} and the y-axis being the probability of winning the overall game (use your previous function). Plot 3 "curves" in different colors, one for each n in 3,11,21. - Identify the interesting pattern you notice when n gets larger (regarding the steepness of the curve), and explain why it makes sense. - Each curve you make for different values of n always (approximately) passes through 3 points.
Plwin game) 1.0 0.8 0.6 0.4 0.2 0.0 0.0 n-3 11 121 Ralating P(win point) to P(win game) 0.2 0.4 Fredag 0.6 Plwin point) 0.8 1000
Step by Step Solution
★★★★★
3.32 Rating (152 Votes )
There are 3 Steps involved in it
Step: 1
To simulate the ping pong game and compute the probability of winning you can use the following Pyth...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