← Data and chance

Simulating compound events

A computer can repeat a chance experiment thousands of times in a second. Run a simulation of two events, record the results in a frequency table, and compare the relative frequency with the probability from the sample space.

In a board game you roll two dice every turn. Which total should you hope for, and how sure can you be? Rolling by hand would take all lesson; a simulation takes a second.

A simulation uses random numbers to act out a chance experiment, many times and quickly. Each repeat is a trial. Record the results in a frequency table, then find the relative frequency of the event: how many times it happened ÷ the number of trials.

The board is one digital tool. In a spreadsheet, =RANDBETWEEN(1,6) is one roll of a dice: a whole number from 1 to 6, each equally likely.

PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

The most common total

Two dice are rolled 100 times and the totals recorded. Which total will probably come up most often?

TryTry it on the board and compare the result with your prediction.

100 trials

The table counts each total. The Probability column comes from the grid: the number of pairs with that total out of 36.

Try it yourselfYour edits are saved in this browser.

Run at least 100 trials. Which total came up most in the table? Is the relative frequency of 7 close to P(7)? Compare with your prediction.

Use the board. This ticks when you get there.

InvestigateWork out why it happens, one step at a time.

Reading a simulation

Here is the routine.

Worked exampleBefore each step, say what you think comes next.
  1. Event: total of 9; P=436≈0.11\text{Event: total of 9};\ P = \tfrac{4}{36} \approx 0.11Predict from the grid first.

Read Ella's working. How many times would you expect a 12 in 20 rolls?

In 200 simulated rolls of two dice, a total of 7 came up 31 times. What is its relative frequency?

Ella runs a short simulation. Click the line where her conclusion goes wrong.

In a spreadsheet, A2 and B2 each hold =RANDBETWEEN(1,6), one dice each. Which formula in C2 simulates the total of two dice?

ModifyChange the problem on purpose and see what happens.

More trials, other events

Try it yourselfYour edits are saved in this browser.

Run 1000 trials or more of two dice. Is the relative frequency of 7 within 0.04 of P(7) now?

Use the board. This ticks when you get there.

Two coins: the board shows P(at least one head) = 3/4. Say why, using the four outcomes. Then run 1000 trials or more: does the relative frequency agree?

Use the board. This ticks when you get there.

In a simulation, A happened 380 times in 500 trials. How many times did not A happen?

Two dice are rolled 600 times. About how many times do you expect a total of 7?

PractiseA few on your own, to check you have it.

Simulations

A simulation of two coins recorded these 20 trials: HT, HH, TT, TH, HH, HT, TT, HH, TH, HT, TT, HH, HT, TH, TT, HH, HT, TH, TT, HH. Fill in the frequency table.

outcomeHHHTTHTT
count

Two classes simulate a total of 7 on two dice. Class A: 9 times in 40 trials. Class B: 170 times in 1000. Which estimate is more reliable?

A simulated relative frequency is 0.31 and the probability from the sample space is 1/3. What should you say?

Review: 30 students, 18 play netball, 10 play hockey, 4 play both. What is P(netball or hockey)?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

Your own simulation

Describe your result in a sentence: the event, its probability, the relative frequency after your trials, and whether they agree.

Try it yourselfYour edits are saved in this browser.
Need a hint?

Choose any event, such as 'the total is a prime number' or 'both dice are odd'.

Another hint

Work out P(A) from the grid before you press Run.

Choose your own event on two dice, work out its probability, then run at least 1000 trials.

Use the board. This ticks when you get there.

For teachers

Students simulate two dice and two coins, record results in a frequency table, and compare relative frequencies with probabilities from the sample space (AC9M8P03, nodes 1 and 2). About 45 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Do the Run board yourself first. Students need the two-dice grid (Grids and tree diagrams), complements, and relative frequency and the law of large numbers (Year 7 Many trials).

The one idea: a simulation is many quick trials; its relative frequency estimates the probability and gets closer as trials grow. The common mistake is concluding from a short run (Ella's mistake: no 12 in 20 rolls, so impossible).

The board is one digital tool. Others for a class task: a spreadsheet (=RANDBETWEEN(1,6) in two columns, a sum column, COUNTIF for the frequency table, filled down 1000 rows), an online dice simulator, or a short Python program. Generative AI can write a simulation, but students should check its code and its frequency table against the grid: an AI may describe results it never ran.

Wider: simulate something with no simple sample space, such as how many packets of cereal you buy to collect all 6 cards.

Running the lesson

  1. Predict: ask how many pairs make 7, and how many make 12.
  2. Run: ask which totals are rare, and why.
  3. Investigate: ask how many 12s Ella should expect in 20 rolls.
  4. Modify: ask what happens to the gap between f and P as trials grow.
  5. Make: ask for the probability before the Run button.

The hard part (on purpose)

Trusting a short run. Ask: how many times would you expect it in this many trials? Then: is what happened surprising?

When students get stuck

Stretch and support

Stretch: Build the two-dice simulation in a spreadsheet with 1000 rows and a frequency table. Does it agree with the board?

Support: A frequency table template for totals 2 to 12 with columns for count, relative frequency and probability.

Where it leads

This covers AC9M8P03.

Where it leads: statistics from samples (Year 8 Statistics), and independent events and simulations in Years 9 and 10.

What each step is for

Now you can
Practise this skillNew questions, new numbers each timeGet 3 right in a row to mark it practised.Next lesson15. Census, sample, experiment or observationData can come from everyone (a census), from some (a sample), from an experiment where you change something on purpose, or from watching (an observation). Each has a cost, a time and an accuracy; choose the one that fits the question.