Resources For Teachers For Tutors For Students & Parents Pricing
Year 10 Maths - 10 Probability

Simulations and Conditional Probability

20 practice questions 0 video lessons Theory + worked examples
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A simulation imitates a chance situation with coins, dice, random digits or a spreadsheet, and the relative frequency of the results estimates a probability. This Year 10 maths page shows how to estimate a conditional probability from simulated trials, combine results, judge whether a device is fair, and check surprising results such as the three-door game and repeated birthdays against the theory. Curriculum: VC2M10P01 / AC9M10P02.

The frequency of an outcome is the number of times it happened. The relative frequency is that frequency divided by the total number of trials. It is also called the experimental or observed probability.

The theoretical probability is the probability expected under fair conditions, worked out from equally likely outcomes. For a fair die, \(P(6) = \dfrac{1}{6}\).

Relative frequency and theoretical probability are rarely exactly equal. With more trials, the relative frequency usually gets closer to the theoretical probability, so more trials give a better estimate.

If, after many trials, the relative frequency is far from the theoretical probability, the object may be biased (not fair).

A simulation imitates a chance experiment with something easier to repeat: coins, dice, spinners, random digits or a spreadsheet formula such as =RANDBETWEEN(1,10). Each outcome of the simulation stands for an outcome of the real situation, with the same probability.

A simulation can also estimate a conditional probability \(P(B\mid A)\). Keep only the trials in which \(A\) happened, and find the fraction of those in which \(B\) also happened. The trials without \(A\) are ignored.

Simulations are useful when the exact working is long or when the answer is counterintuitive (it surprises most people), such as the three-door game or the chance that two people in a group share a birthday. They are also used to make decisions about stock, insurance, queues and the spread of a virus.

Relative frequency settling down as trials increaseA line graph of the relative frequency of heads after 10, 20, 50, 100, 200, 500 and 1000 tosses of a coin. It starts at 0.7 and swings about, then settles close to the dashed theoretical value 0.5. 0.3 0.4 0.5 0.6 0.7 0.8 theoretical 0.5 10 20 50 100 200 500 1000 number of tosses relative frequency of heads
Early on the relative frequency jumps around. After many trials it settles close to the theoretical probability. Estimates from a few trials are not reliable.
The three-door gameA tree with two branches for the first pick: the right door with probability one third, where sticking wins and switching loses, and a wrong door with probability two thirds, where the host must open the other empty door, so switching wins. 1/32/3Right doorstick wins, switch losesWrong doorswitch winsFirst pick
In the three-door game the host always opens an empty door. Switching wins whenever the first pick was wrong, so \(P(\text{win}\mid\text{switch})=\dfrac{2}{3}\) and \(P(\text{win}\mid\text{stick})=\dfrac{1}{3}\).

From an experiment or a simulation:

\[\text{relative frequency} = \dfrac{\text{frequency}}{\text{number of trials}}\]
relativefrequency=frequency/trials
\[\text{expected number} = P \times n\]
expectednumber=P×n

Estimating a conditional probability from trials:

\[P(B\mid A) \approx \dfrac{n(A \text{ and } B)}{n(A)}\]
P(B|A)=n(AandB)/n(A)
Combining results. Add the frequencies and add the trials, then divide. Group results of \(40\) out of \(100\) and \(45\) out of \(150\) combine to \(\dfrac{85}{250}=0.34\). Do not average \(0.4\) and \(0.3\).
Matching a device to a probability. For \(P = 0.8\), let the random digits \(0\) to \(7\) stand for the event. For \(P=\dfrac{1}{3}\), use a die with \(1\) or \(2\). For \(\dfrac{1}{12}\), use a \(12\)-sided die. In a spreadsheet, =RANDBETWEEN(1,6) rolls a die.
Fair or biased? Compare the frequency with the expected number. A small gap is normal. A large gap after many trials suggests the device is biased; a gap after only a few trials proves nothing.
Repeated values (birthday-type problems). "At least two the same" is the complement of "all different". If \(3\) people each choose a digit from \(0\) to \(9\): \(P(\text{all different})=\dfrac{10\times 9\times 8}{10^3}=0.72\), so \(P(\text{a repeat})=0.28\).

How to work with relative frequency

  1. Find the number of trials. In a table, add the whole frequency column.
  2. Find the frequency of the event. Add every row that fits it.
  3. Divide frequency by trials. Give a decimal, or simplify the fraction.
  4. Predict by multiplying a relative frequency by a new number of trials.
  5. Compare with the theoretical probability. A small gap is normal; a big gap after many trials suggests bias.

How to estimate a conditional probability by simulation

  1. Match each stage to a device with the same probabilities. If the second stage depends on the first, use a different rule for each first result.
  2. Define one trial, such as a pair of digits for two days, and run many trials.
  3. Keep only the trials where the condition happened, and count them.
  4. Count how many of those also have the event, and divide.
  5. Compare with the theoretical value. Few trials meet the condition, so the estimate can be far off; more trials make it more reliable.

Other question types

  1. Counts given as a table: a simulated two-way table works like a real one. "Given" picks one row or column as the total.
  2. The three-door game: sticking wins only if the first pick was right. Switching wins if the first pick was wrong (and, with more doors, you then switch to the car).
  3. Explaining a gap: say how many trials met the condition, and that larger simulations usually get closer.
Example 1 β€” Relative frequency, combined
A spinner has three equal sectors: red, blue and yellow. Class A spins it \(120\) times and gets red \(50\) times. Class B spins it \(180\) times and gets red \(70\) times.
(i) Find each class's relative frequency of red.
(ii) Combine the results.
(iii) How many reds would a fair spinner give in \(300\) spins? Is the spinner fair?
(iv) Predict the number of reds in \(900\) spins.
Solution
\(\text{A}\)\(:\)\(\dfrac{50}{120}\approx \boldsymbol{0.417}\)
\(\text{B}\)\(:\)\(\dfrac{70}{180}\approx \boldsymbol{0.389}\)

(ii) Add the reds and add the spins.

\(\text{combined}\)\(=\)\(\dfrac{50+70}{120+180}\)
\(\)\(=\)\(\dfrac{120}{300}=\boldsymbol{0.4}\)
120300=0.4

(iii) Fair: \(\dfrac{1}{3}\times 300=\boldsymbol{100}\) reds. There were \(120\), a large gap over \(300\) spins, so the spinner is probably biased towards red.

(iv) Use the combined estimate: \(0.4\times 900=\boldsymbol{360}\) reds.

Example 2 β€” Estimating P(B | A) by simulation
A netball team wins on Saturday with probability \(0.5\). If it wins on Saturday, it wins on Sunday with probability \(0.7\); if it loses on Saturday, the probability is \(0.4\). Each pair of random digits is one weekend. First digit \(0\)–\(4\): wins Saturday. Second digit: after a win, \(0\)–\(6\) wins Sunday; after a loss, \(0\)–\(3\) wins Sunday.
38 07 52 91 26 44 13 75 60 29 84 31 57 02 96 18
(i) Estimate \(P(\text{wins Sunday}\mid\text{wins Saturday})\) and compare with \(0.7\).
(ii) Estimate \(P(\text{won Saturday}\mid\text{wins Sunday})\).
Solution

(i) Saturday wins (first digit \(0\)–\(4\)): 38, 07, 26, 44, 13, 29, 31, 02, 18. That is \(9\) trials. Sunday also won (second digit \(0\)–\(6\)): 26, 44, 13, 31, 02, which is \(5\).

\(P\)\(\approx\)\(\dfrac{5}{9}\approx \boldsymbol{0.56}\)

This is well below \(0.7\) because only \(9\) trials meet the condition.

(ii) Now the condition is a Sunday win. Sunday wins: 26, 44, 13, 31, 02 (after a Saturday win) and 52, 91, 60 (after a loss, second digit \(0\)–\(3\)). That is \(8\) trials, and \(5\) of them had a Saturday win.

\(P\)\(\approx\)\(\dfrac{5}{8}=\boldsymbol{0.625}\)

The theoretical value is \(\dfrac{0.5\times 0.7}{0.5\times 0.7+0.5\times 0.4}=\dfrac{7}{11}\approx 0.636\), close to the estimate.

Example 3 β€” Given, the other way round
A computer simulates an email filter on \(500\) emails. \(80\) of the emails are spam, and the filter flags \(72\) of them. Of the \(420\) genuine emails, the filter flags \(21\).
(i) Estimate \(P(\text{flagged}\mid\text{spam})\).
(ii) Estimate \(P(\text{spam}\mid\text{flagged})\), correct to \(2\) decimal places.
(iii) Explain why the two answers are different.
Solution

(i) The condition is spam: \(80\) emails, \(72\) flagged.

\(P(\text{F}\mid\text{S})\)\(\approx\)\(\dfrac{72}{80}=\boldsymbol{0.9}\)

(ii) The condition is flagged: \(72+21=93\) emails, and \(72\) of them are spam.

\(P(\text{S}\mid\text{F})\)\(\approx\)\(\dfrac{72}{93}\approx\boldsymbol{0.77}\)
7293=0.77

(iii) The denominators are different groups. Genuine emails are far more common, so even a few wrongly flagged genuine emails (\(21\)) make up a real share of all flagged emails. Mixing up \(P(A\mid B)\) and \(P(B\mid A)\) is a common mistake.

Example 4 β€” A surprising repeat
Five people each choose a whole number from \(1\) to \(10\) at random. A class simulates this with random digits in \(30\) trials, and in \(21\) of them at least two people chose the same number.
(i) Estimate the probability of a repeat.
(ii) Find the theoretical probability, correct to \(3\) decimal places.
(iii) Why do most people guess too low?
Solution
\(P(\text{repeat})\)\(\approx\)\(\dfrac{21}{30}=\boldsymbol{0.7}\)

(ii) Use the complement. For all five to be different, each new person must avoid the numbers already chosen.

\(P(\text{all different})\)\(=\)\(\dfrac{10\times 9\times 8\times 7\times 6}{10^5}\)
\(\)\(=\)\(0.3024\)
\(P(\text{repeat})\)\(=\)\(1-0.3024\)
\(\)\(\approx\)\(\boldsymbol{0.698}\)
1−0.3024=0.698

(iii) People think about one person matching one other person. But \(5\) people make \(10\) different pairs, and any pair can match, so a repeat is likely. The simulation (\(0.7\)) agrees well.

Common pitfalls

Ignore the trials outside the condition. To estimate \(P(B\mid A)\), divide by the number of trials where \(A\) happened, not by all the trials.
A few trials prove nothing. Five sixes in \(12\) rolls does not show a die is biased. Judge bias only after many trials.
Combine counts, not decimals. Add the frequencies and the trials of each group, then divide.
Match the device to the probability. A coin cannot simulate a probability of \(0.7\). Choose digits, dice or a spinner that give exactly the probability needed.
Read which way the condition goes. \(P(\text{spam}\mid\text{flagged})\) and \(P(\text{flagged}\mid\text{spam})\) use different totals and are usually different.

Frequently asked questions

What is a simulation in probability?

A simulation imitates a chance situation with a device that is easy to repeat, such as coins, dice, random digits or a spreadsheet, where each result has the same probability as the real outcome.

How do you estimate a conditional probability from a simulation?

Count the trials in which the condition happened. Of those, count the trials in which the event also happened, and divide.

Why do more trials give a better estimate?

Over many trials the relative frequency settles close to the true probability. With few trials, chance alone can push it far away.

Should you switch in the three-door game?

Yes. Switching wins whenever your first pick was wrong, which has probability \(\dfrac{2}{3}\). Sticking wins only with probability \(\dfrac{1}{3}\).

What is the difference between relative frequency and probability?

Relative frequency is what happened in actual trials. Theoretical probability is what should happen in the long run. They are rarely exactly equal.