Answered step by step
Verified Expert Solution
Link Copied!

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. 


Give the three points (x1, y1),(x2, y2),(x3, y3), and explain why mathematically this happens in AT MOST 2-3 sentences. You'll need to implement the following functions: pingpong(), sim one game(), plot output() Your plot should look something like Fig 1:

 

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... 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

Principles Of Information Security

Authors: Michael E. Whitman, Herbert J. Mattord

7th Edition

035750643X, 978-0357506431

More Books

Students also viewed these Programming questions

Question

The EBITEPS framework for analyzing capital structure policy P-9687

Answered: 1 week ago

Question

Krishnamurthy number java code

Answered: 1 week ago