Build a simulation of the screening test where the second step depends on the first, run it many times, and compare what comes out with the table: close, but not the same, and closer as the trials grow.
Could a computer pretend to test a thousand people in a blink and tell us what the table says?
Designing a simulation· Match outcomes to random digits, decide what one trial is, and plan how many to run.
Back to the screening test from the last lesson. Out of 1000 people, 20 have the condition. The test is positive for 9 in 10 of them and, wrongly, for 1 in 20 of the others. All of these rates are made up. The table said the chance of the condition, given a positive test, is 18 out of 67. A simulation lets you check that without the table: pick imaginary people at random with the right chances, test them, and count.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
How close will it be
Make a guess before you use the board.
TryTry it on the board and compare the result with your prediction.
A thousand imaginary people
The table lists how many times each outcome came up. To find the simulated chance of the condition, given a positive test, add the two Positive counts, then see how many of them are the "Yes" row.
Try it yourselfYour edits are saved in this browser.
Press Run 1000 two or three times and watch the count table. How close to the chance in the table (0.27) do you get, from the two Positive rows?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
The design, and the comparison
The design has to build the condition in: the chance of a positive depends on who has the condition.
Here is the method on a bag of counters.
Worked exampleBefore each step, say what you think comes next.
A bag has 3 red and 7 blue. Draw two, no put-back.Find the chance the second is red, given the first was red, by simulation.
Step 1: a digit 0 to 9; 0, 1, 2 mean red3 of the 10 digits are red.
Step 2 (if red first): a digit 0 to 8; 0, 1 mean red2 reds are left among 9 counters, so the second step has 9 digits and 2 reds.
Run many times. Look only at trials where step 1 was red.The condition: count how often step 2 is red inside them.
Theory: 92=0.22What the simulation should settle near.
Now try a different bag on paper, with the example beside you. Then type your answer.
Build up to it
A bag has 4 red and 6 blue counters. One red counter is drawn and kept out. How many counters are left in the bag?
Read Zoe's working. A simulation of 100 people differs from the table. Does that mean the table is wrong?
A bag has 4 red and 6 blue counters (made up). Two are drawn with no put-back. Design a simulation with random digits: the first digit from 0 to 9, and the second step depends on the first. Then use it to find the chance the second counter is red, given the first was red. Give a decimal to 2 places.
Work it out on paper first, one step per line. Then type your answer.
Put your page beside this and compare, step by step.
A model solution
First draw: digits 0 to 3 mean red, 4 to 9 mean blue 4 of the 10 digits are red
If the first was red, 3 red and 6 blue are left: use digits 0 to 8, with 0 to 2 meaning red the second step depends on the first
3÷9=0.33the chance of a red second, given a red first
Check your page
Zoe compares a simulation of 100 people with the table. Click the line where she goes wrong.
ModifyChange the problem on purpose and see what happens.
This test has 14 false alarms in 980 instead of 49.
Try it yourselfYour edits are saved in this browser.
Run at least 10,000 trials. Read the two Positive rows and work out the simulated chance of the condition, given a positive test. Compare it with 0.27.
Use the board. This ticks when you get there.
This test gives fewer false alarms. Run at least 5,000 trials and work out the simulated chance of the condition, given a positive test. The table gives 18 out of 32.
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Compare the numbers
From Year 9: list the outcomes of both, then count the ones you want.
A simulation of the screening test gave 22 people with the condition and a positive test, and 51 people without it and a positive test. What is the simulated chance of the condition, given a positive test? Give a decimal to 2 places.
Review: a coin is tossed and a die is rolled, so there are 12 outcomes. How many of them are heads with a die showing 5 or 6?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Back to the test
Work this out on paper first, then type your answer.
Sources: every rate and count in this lesson is made up (the screening test, the simulated counts and the bags of counters). A simulation here is a model of a made-up test, not of a real one.
Also used in
Sport. A simulated penalty shootout works the same way: the chance of the next kick depends on how the last one went, and many runs show how often the team wins.
Weather and hospitals. Forecasters and planners simulate many runs of a model to see how much results can wander before deciding.
Class work. Decide when a simulation supports a real decision, and what it leaves out.
A simulation of 10 000 imaginary people (the first test) gave 192 people with the condition and a positive test, and 507 people without it and a positive test. What is the simulated chance of the condition, given a positive test? Give a decimal to 2 places.
Work it out on paper first, one step per line. Then type your answer.
Put your page beside this and compare, step by step.
A model solution
All the positives: 192+507=699the group the 'given' picks
Positives with the condition: 192the count inside the group
192÷699=0.27the part over the group
Check your page
Lesson done. You've finished every step you need.
Now you can
Design a simulation where the second step depends on the first.
Run it many times and work out a conditional chance from the counts.
Compare the simulated chance with the calculated one and say why more trials get closer.
Students design a simulation of the screening test where the second step depends on the first, run it many times on the board, and compare the simulated chance with the table. They see that a simulation wanders around the calculated chance and settles as trials grow (AC9M10P02, nodes 1 and 2). About 50 minutes.
I can design a simulation where the second step depends on the first.
I can run it many times and work out a conditional chance from the counts.
I can compare the simulated chance with the calculated one and say why more trials get closer.
Before class
Do the Run board yourself first. Students need the last lessons (tables, Venns and trees) and Year 9's simulation lessons.
The one idea: a simulation picks random people with the right chances, then counts. A conditional chance is read from the counts inside the group, so the Positive rows give the chance given a positive. The board here picks one outcome in proportion to its count (the tree in the last lesson), so one trial is one imaginary person. The two-step design with digits is the same idea in a form a student could do with dice, a spreadsheet or code.
The board has no field for the chance given a positive: students read the count table and divide. That is deliberate. Results are random, so no check depends on a particular count: the board checks wait for a number of trials, and the number questions use counts given in the question.
Every rate and count is made up: the screening test, the simulated counts and the counters. A simulation of a made-up test says nothing about any real test.
Running the lesson
Predict: show of hands before the board. Most choose exactly 67.
Run: ask each group to report its own simulated chance after 1000 trials. They will differ: put them on the board.
Paper: the counters design and the Make comparison are worked on paper first. Look for a different second step.
Modify: before the last board, ask 'what is the chance there are no positives in 10 trials?' (about half).
The hard part (on purpose)
Forgetting that the second step changes with the first. Ask: 'Is the chance of a positive the same for everyone? Who has a different chance?'
When students get stuck
A student gives every person the same chance of a positive. Ask: Is a positive equally likely for someone who has the condition and someone who doesn't? Fix: Make the second step depend on the first: 9 in 10 for people with it, 1 in 20 for the rest.
A student divides by the number of trials. Ask: Given a positive test, which trials are you looking at? Fix: Only the trials with a positive result: add the two Positive rows.
A student says the table is wrong because the simulation gave a different number. Ask: If you ran it again, would you get exactly the same number? How many trials was it? Fix: Run more trials and see whether the result settles near the table's number.
Stretch and support
Stretch: Change the board's rates so 100 people in 1000 have the condition, the test is positive for 9 in 10 of them and for 1 in 20 of the rest. Predict the chance given a positive, then simulate it. What did a more common condition do?
Support: A printed table of the four outcomes with a space for tallies, and the calculation written as a fraction to fill in: ___ ÷ (___ + ___).
Where it leads
Continues AC9M10P02 nodes 1 and 2.
Where it leads: node 3, a real decision supported by a simulation (class work), and Year 10's other probability and statistics lessons.
how close will it be: A simulation uses random picks, so each run is a little different. Students who expect the exact counts from the table are treating a sample as if it were the whole.
a thousand imaginary people: Each trial picks one imaginary person from the tree in proportion to the counts. 1000 trials give a count for each outcome. The positives with the condition, over all the positives, estimate the chance given a positive.
the design, and the comparison: A simulation of a conditional chance must make the second step depend on the first: the chance of a positive is different for people with and without the condition. A simulated result differs from the calculated one by chance, and the gap shrinks as the trials grow.
more trials, a different test: More trials bring the simulated chance closer to the table. A different test changes the calculated chance, and the simulation follows it. With very few trials, a simulation may not give any positives at all.
compare the numbers: Reading a simulated chance from its counts, describing the gap from the table, and saying what more trials do. Review: counting a compound outcome from Year 9.
back to the test: Returning to the opening: the simulation is checked against the table. A good comparison gives both chances, says how far apart they are and why that is expected.