Skip to content
Family Table Math

Experimental Probability and Simulations

Sometimes you can’t work out a probability from a list of equally likely outcomes. What’s the chance a thumbtack lands point up? Or that a basketball player sinks a free throw? You find out by experimenting: doing many trials and seeing how often it happens. The more trials you do, the more you can trust the answer.

P(A)≈number of times A happenednumber of trialsP(A) \approx \frac{\text{number of times } A \text{ happened}}{\text{number of trials}}

This fraction is also called the relative frequency of AA.

With only a few trials, experimental probability can be far from the theoretical value. As the number of trials grows, the experimental probability tends to get closer and closer to the theoretical probability.

The proportion of heads in 500 simulated coin flips. It jumps around at first, then settles close to the theoretical probability 0.5. 100 200 300 400 0.2 0.4 0.6 0.8 theoretical 0.5 number of flips proportion of heads
The running proportion of heads in 500500 simulated coin flips.

In this simulation, the proportion of heads was 0.70.7 after 1010 flips, 0.540.54 after 100100, and 0.520.52 after 500500.

A simulation models an experiment using something easier to repeat, often random numbers. For example:

  • a spreadsheet formula like =RANDBETWEEN(1,6) simulates rolling a die
  • a random number from 00 to 11 that’s less than 0.30.3 can stand for “it rains” when P(rain)=0.3P(\text{rain}) = 0.3

Simulations are useful when an experiment is slow, expensive, or impossible to repeat many times.

If P(A)=pP(A) = p and you do nn trials, you’d expect AA to happen about npnp times.

A coin is flipped 5050 times and lands heads 2828 times. Find the experimental probability of heads, and compare it with the theoretical probability.

Solution.

P(heads)≈2850=0.56P(\text{heads}) \approx \frac{28}{50} = 0.56

The theoretical probability is 0.50.5. A difference like this is normal with only 5050 trials.

A thumbtack is dropped 120120 times and lands point up 7878 times. Estimate the probability of point up, and how many times it would land point up in 500500 drops.

Solution.

P(point up)≈78120=0.65P(\text{point up}) \approx \frac{78}{120} = 0.65

In 500500 drops, expect about 0.65×500=3250.65 \times 500 = 325 point-up landings.

Example 3: Reading the law of large numbers

Section titled “Example 3: Reading the law of large numbers”

Using the graph above, explain why someone who flipped only 1010 coins might wrongly think the coin was unfair.

Solution. After 1010 flips, the simulation had 77 heads, a proportion of 0.70.7. That looks unfair, but with so few trials, big swings are common. As more flips were added, the proportion settled near 0.50.5. Small samples can mislead; large ones are more reliable.

Design a simulation to estimate the probability of rolling at least one 66 in four rolls of a die.

Solution.

  1. In a spreadsheet, put =RANDBETWEEN(1,6) in four columns of one row: that’s one trial of four rolls.
  2. In a fifth column, check whether any of the four is a 66.
  3. Copy the row down to make many trials, say 10001000.
  4. Divide the number of trials with at least one 66 by 10001000.

The theoretical answer (from independent events) is 1−(56)4≈0.5181 - \left(\tfrac{5}{6}\right)^4 \approx 0.518, so a good simulation should give something close to that.

Trusting a small number of trials. Ten trials can easily give 0.70.7 for a fair coin. Use many trials before drawing conclusions.

Expecting the experimental value to match exactly. Even with many trials, experimental and theoretical probabilities rarely agree perfectly. They should just be close.

Thinking a coin “is due” for heads. Each flip is independent. The law of large numbers works because of many trials, not because the coin balances itself out.

Dividing by the wrong total. The denominator is the number of trials, not the number of outcomes.

1. (Warm-up) A player makes 2626 of 4040 free throws. What is the experimental probability of making a free throw?

Solution

2640=0.65\tfrac{26}{40} = 0.65

2. (Warm-up) A die is rolled 6060 times and shows a 66 thirteen times. Compare the experimental and theoretical probabilities of rolling a 66.

Solution

Experimental: 1360≈0.217\tfrac{13}{60} \approx 0.217. Theoretical: 16≈0.167\tfrac{1}{6} \approx 0.167. The experimental value is a bit high, which is not surprising with only 6060 rolls.

3. (Warm-up) The probability of rain on a June day is 0.30.3. About how many rainy days would you expect in June’s 3030 days?

Solution

0.3×30=90.3 \times 30 = 9 days.

4. (Core) A bag holds 2020 marbles in three colours. A marble is drawn, its colour recorded, and it’s put back, 100100 times: 4848 red, 3131 blue, 2121 green. Estimate how many marbles of each colour are in the bag.

Solution

Multiply each relative frequency by 2020: red ≈9.6\approx 9.6, blue ≈6.2\approx 6.2, green ≈4.2\approx 4.2. A good estimate is about 1010 red, 66 blue, and 44 green.

5. (Core) Two classes each flip a coin 3030 times. One gets 1919 heads and the other gets 1313. Is something wrong? How could they get a more reliable estimate?

Solution

Nothing is wrong: with only 3030 flips, results like 1930≈0.63\tfrac{19}{30} \approx 0.63 and 1330≈0.43\tfrac{13}{30} \approx 0.43 happen by chance. Combining the data (3232 heads in 6060 flips, about 0.530.53) or doing many more flips gives a more reliable estimate.

6. (Core) A cereal company puts one of 55 different toys in each box, each equally likely. Design a simulation to estimate how many boxes you’d need to buy to collect all 55.

Solution

Use =RANDBETWEEN(1,5) to represent opening a box. Keep generating numbers until all of 11 to 55 have appeared, and record how many boxes it took. Repeat many times (say 100100) and average the results.

(The theoretical average is about 11.411.4 boxes, so a good simulation should land close to that.)

7. (Core) Two coins are flipped 10001000 times: two heads 260260 times, one head and one tail 497497 times, two tails 243243 times. Compare with the theoretical probabilities.

Solution

Theoretical: P(HH)=0.25P(\text{HH}) = 0.25, P(one of each)=0.5P(\text{one of each}) = 0.5, P(TT)=0.25P(\text{TT}) = 0.25.

Experimental: 0.2600.260, 0.4970.497, 0.2430.243. All very close, as expected with 10001000 trials.

8. (Challenge) A student rolls a die 6060 times and gets 2525 sixes. Should they suspect the die is unfair? What would you do to find out?

Solution

2560≈0.42\tfrac{25}{60} \approx 0.42, far above 16≈0.17\tfrac{1}{6} \approx 0.17. With a fair die, you’d expect about 1010 sixes in 6060 rolls, and 2525 is very unlikely by chance. That’s good reason to be suspicious. To be more confident, roll it many more times: if the proportion of sixes stays well above 0.170.17, the die is probably unfair.

9. (Challenge) In Example 4, a class runs the simulation 200200 times and gets at least one 66 in 109109 trials. How does this compare with the theoretical probability?

Solution

Experimental: 109200=0.545\tfrac{109}{200} = 0.545. Theoretical: 1−(56)4≈0.5181 - \left(\tfrac{5}{6}\right)^4 \approx 0.518. They’re close; the difference of under 0.030.03 is reasonable for 200200 trials.