Question: Program a simulation of N coin flips that outputs the number each of head and tails. You may use any packages you can find (the

Program a simulation of N coin flips that outputs the number each of head and tails. You may use any packages you can find (the Python package random will probably be useful). Your simulation should allow you to specify a probability of heads other than 0.50 and should allow you to specify N.

Comment briefly on how well your simulation's results match up with what you would have expected to get. If you use a larger N, do you get closer to what you expect? (Try N = 10, 100, 1000, and 10000 to see what happens.)

Step by Step Solution

3.25 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can simulate N coin flips in Python using the random module The following code will allow you to ... View full answer

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 Programming Questions!