Statistical Simulation Examples: 45 Problems with Answers
Worked examples of Statistical Simulation to try before you open each solution, then practice
problems with answers.
Worked Examples
Example 1
medium
You simulate a game where you win if a fair die shows a 1 OR a 6. In 10000 simulated rolls, 3320 wins occurred. What is the simulated probability of a win, and how does it compare to the theoretical value?
Show solution
Answer
Simulated: 0.332,Theoretical: 31≈0.333
First step
1.
100003320=0.332.
See the full worked solution + why-it-works coaching
Setup·Key insight·Why it works·Common pitfall·Connection
To estimate the area of an irregular shape inside the unit square, you sample 5000 uniform points; 1750 fall inside the shape. Estimate the area.
Example 3
medium
To simulate the probability that a 5-person group has at least one shared birthday-month (12 months), you run 10000 trials and find 6190 hits. Estimate the probability.
Example 4
hard
A simulation runs 50000 trials of a dice game; the event of interest occurs 12530 times. With n=50000, the standard error is approximately p(1−p)/n. Estimate p and its standard error to three decimals.
Example 5
challenge
You simulate 100000 trials and estimate p^=0.205. Construct an approximate 95% confidence interval using p^±1.96p^(1−p^)/n.
Example 6
easy
You want to estimate the probability of getting exactly 2 heads when flipping 3 coins. Describe how to use a simulation with a random number generator to estimate this probability.
Example 7
medium
A cereal brand puts one of 6 different toy figurines in each box (equally likely). Use simulation to estimate how many boxes you need to buy to collect all 6 figurines.
Practice Problems
Try each one, then open the solution to compare your method.
Example 1
easy
In 1000 simulated coin flips, 480 came up heads. Estimate P(heads).
Example 2
easy
A simulation runs 200 trials and an event occurs 50 times. Estimate its probability.
Example 3
easy
To simulate a fair die, which random integers should you generate?
Example 4
easy
Why is simulation used to estimate hard probabilities?
Example 5
easy
A simulation of 500 trials estimated P=0.62. How many trials matched the event?
Example 6
easy
To simulate an event with probability 0.3 using a random number in [0,1), what range counts as success?
Example 7
easy
A coin-flip simulation gives 0.51 at 100 trials and 0.502 at 10000 trials. Which estimate is more reliable?
Example 8
easy
A spinner has a 41 win region. Using digits 0-9, which digits could represent a win?
Example 9
medium
To estimate the probability that two people in a group of 5 share a birthday-week (52 weeks), you simulate 10000 groups and 1850 had a match. Estimate the probability.
Example 10
medium
A game wins with probability 0.2. You simulate 50 plays using digits 0-9, letting digit 0 or 1 mean a win. Out of 50 digits, 12 were 0 or 1. Estimate the win probability.
Example 11
medium
You want to estimate π by throwing darts at a unit square with an inscribed quarter circle. Of 10000 darts, 7850 land inside the quarter circle. Estimate π.
Example 12
medium
A simulation estimates a probability as 0.40 with 100 trials. Roughly how many trials are needed to cut the typical error in half?
Example 13
medium
To simulate rolling two dice and getting a sum of 7, you generate two random integers 1-6. In 3600 trials, 590 gave a sum of 7. Estimate the probability and compare to theory.
Example 14
medium
A simulation assigns success to a random number in [0,1) below 0.45. In 2000 runs, 880 succeeded. Estimate the probability.
Example 15
medium
Why might a simulation with only 10 trials give a misleading probability estimate?
Example 16
medium
To estimate the chance a baseball player with a 0.300 average gets at least 2 hits in 4 at-bats, you simulate. In 5000 simulated games, 1410 had 2+ hits. Estimate the probability.
Example 17
medium
A simulation models a 0.7-probability free throw. In 1000 simulated shots, 715 went in. Estimate the make probability and the miss probability.
Example 18
challenge
You simulate a 3-game series where each game is won with probability 0.6, needing 2 wins to take the series. In 10000 simulations, 6480 series were won. The exact probability is 0.648. Comment on the simulation.
Example 19
challenge
A simulation estimates a probability as 0.50 from 400 trials. The approximate standard error is np(1−p). Compute it.
Example 20
challenge
To find how many trials give a standard error below 0.01 for p=0.5, solve n0.25≤0.01.
Example 21
easy
In 5000 simulated coin flips, 2530 landed heads. Estimate P(heads).
Example 22
easy
To simulate a fair coin using digits 0-9, which digits could represent heads?
Example 23
easy
A simulation produces P≈0.32 after 250 trials. How many matched the event?
Example 24
easy
To simulate rolling a fair 4-sided die using digits 1-8, how would you assign digits to faces?
Example 25
easy
A simulation of 400 trials estimates P=0.18. How many trials produced the event?
Example 26
medium
A simulation estimates a probability as 0.5 with 100 trials. About how many trials are needed to cut the standard error in half?
Example 27
medium
You simulate 5000 trials of two dice rolls to estimate P(sum=7) and observe 845 matches. Estimate the probability.
Example 28
medium
A simulation models a basketball player's free throws as P=0.78. To use random digits 00-99, what digit range counts as a make?
Example 29
medium
A simulation runs 2000 trials of drawing 5 cards; 78 trials produced a flush. Estimate P(flush).
Example 30
medium
A simulation outputs results: 10000 trials, event occurs 1850 times. Report the estimated probability as a fraction in lowest terms.
Example 31
hard
A simulation estimates π by quarter-circle dart throws. Of 20000 darts in a unit square, 15710 land in the quarter circle. Estimate π.
Example 32
hard
You simulate a game where each round you toss a coin and win $1 for heads, lose $1 for tails. After 1000 simulated rounds, total winnings are $24. Estimate P(heads).
Example 33
hard
A simulation uses uniform [0,1) random numbers; success when the value is less than 0.42. Of 10000 trials, 4256 are successes. Estimate the probability and report whether it overshoots or undershoots.
Example 34
hard
To simulate an event with P=0.085 using 4-digit codes 0000-9999, how many codes represent a success?
Example 35
hard
A Monte Carlo estimate of ∫01x2dx uses 1000 uniform samples; the sample mean of x2 is 0.343. What is the estimate of the integral?
Example 36
challenge
A simulation of the 'birthday problem' for 23 people (365 days) yields 5078 trials with a match out of 10000. Estimate P(shared birthday) and compare to the theoretical value of about 0.507.
Example 37
medium
A multiple-choice test has 10 questions, each with 4 options (one correct). A student guesses randomly on every question. Design a simulation to estimate the probability of passing (getting 6 or more correct).
Example 38
hard
Two players play a game where each rolls a die. If the sum is 7, Player A wins; otherwise Player B wins. Run a conceptual simulation of 20 trials with these random rolls: (4,3), (2,5), (6,1), (3,3), (5,2), (1,4), (6,6), (2,3), (4,4), (5,1), (3,4), (6,2), (1,1), (2,6), (5,5), (4,1), (3,6), (2,2), (6,3), (1,5). Estimate each player's probability of winning.
What to focus on
Core idea:When a chance process is too tangled to calculate, act it out with random numbers that match its real probabilities, repeat it many times, and use the fraction of successful trials as the estimate; more trials make the estimate steadier.
Common stuck point:Students often know a procedure related to statistical simulation but skip the recognition step: Is the exact chance too messy to count, so you would model the process with random numbers and repeat it many times? That leads to a calculation or graph that looks reasonable but answers a different question.
Ask yourself:Is the exact chance too messy to count, so you would model the process with random numbers and repeat it many times?
Concept recap
Using random number generation to model real-world processes and estimate probabilities or outcomes that are difficult to calculate theoretically.
A simulation is a flight simulator for chance: instead of risking the real plane, you fly a model of it thousands of times and count how often things go wrong. The results are only as good as the model; a simulator with the wrong wind settings trains you for the wrong weather.