SimulationsHow to design and run a simulation
First StepRead your task carefully. What problem exactly are you designing a simulation of?What is it that you need to calculate at the end?
Taking a TTRC approachTool – what tool we’re going to useTrial – how to define a trial, and how 		        many we’ll carry outResults – a table showing our resultsCalculation – how to use our results to 			     make a calculation which  			     completes the task
ToolRemember, your simulation must be based on some probability reasoning. So the Tool the you choose, and how you use it, will have to be based on a probability.E.g. If there’s an even chance of an event happening you could simulate it by tossing a coin, or generating the number 1 or 2 randomly on your calculator.
ToolNot quite even chances…If the probability of an event happening is 110 then you’ll probably have to generate a random number from 1 to 10. You could let one number represent the event happening, and all the others represent it not happening. If I generate a random number from 1-10,  I could define 1 to mean it happens, and 2-10 mean it doesn’t!
How would you simulate…A jogger estimates the probability he’ll finish his run without taking a break is 0.75What numbers would you generate to simulate whether he takes a break or not?ToolHmmm..?x Ran# + 1
You could use…You could use: Random numbers from 1 – 4 where	1,2,3 = no break	4 = takes a breakOr Random numbers from 1 – 100 where	1-75 – no break	76-100 = take a breakTool
Sample answer:The tool I will use is the random number generator on my calculator.I will generate random numbers from 1 – 4 where:	1, 2, 3 means no break is taken4 means the jogger takes a breakTool
ToolThere’s no one correct way to define the Tool.Just think carefully about what you’re doing.Remember to state: What you’re using (random number generator)
What numbers you’re generating
What they meanTrialUsually the situation you are simulating will be more complicated than just one isolated event.For example, you might be trying to simulate a group of joggers and whether they are likely to have to take a break for one of their members.
Suppose you have 5 joggers in the group, and the probability that each one might have to take a break is 0.75				How will you simulate this?			How many numbers need 			to be generated per trial?Trial
Obviously you need to generate a number for each jogger, so that’s 5 numbers per trial.You’ll need to record these results, and then repeat for 30 trials.						Easy!Trial
TrialSample answer:One trial will consist of me generating 5 random numbers as described before, one for each jogger. I will record these numbers, and whether a break was taken or not in a table.I will carry out 30 trials.
TrialSo when you’re designing a simulation you need to state:What one trial will consist of (i.e. how many   numbers you need to generate)
What you’re going to do with these numbers (duh…record them in a table of course)
How many times you’re going to repeat the process.ResultsBy now you’ve decided exactly how this simulation is going to run, so you should know what you want to record. Just draw up a neat table with headings and start carrying out trials.
Results
CalculationThere are two usual types of calculation made at the end of a simulation.For one of the type discussed here it is usually an estimate of the probability that something will happen.
CalculationEstimate the probability the jogging group will not have to take a break.𝑃𝑛𝑜 𝑏𝑟𝑒𝑎𝑘=# 𝑡𝑟𝑖𝑎𝑙𝑠 𝑤h𝑒𝑟𝑒 𝑛𝑜 𝑏𝑟𝑒𝑎𝑘 𝑡𝑎𝑘𝑒𝑛# 𝑡𝑟𝑖𝑎𝑙𝑠 𝑐𝑎𝑟𝑟𝑖𝑒𝑑 𝑜𝑢𝑡So the answer will depend on your simulation results. 
CalculationFor a simulation with more open-ended trials the calculation might involve an estimate of average number of times something might happen (e.g. oil strike question practised in class).
Life after simulation…You will often be expected to compare your simulation probability to a theoretical one.E.g.Calculate the theoretical probability that the jogging group does not have to take a break, and compare it to your simulation results.

Simulations

  • 1.
    SimulationsHow to designand run a simulation
  • 2.
    First StepRead yourtask carefully. What problem exactly are you designing a simulation of?What is it that you need to calculate at the end?
  • 3.
    Taking a TTRCapproachTool – what tool we’re going to useTrial – how to define a trial, and how many we’ll carry outResults – a table showing our resultsCalculation – how to use our results to make a calculation which completes the task
  • 4.
    ToolRemember, your simulationmust be based on some probability reasoning. So the Tool the you choose, and how you use it, will have to be based on a probability.E.g. If there’s an even chance of an event happening you could simulate it by tossing a coin, or generating the number 1 or 2 randomly on your calculator.
  • 5.
    ToolNot quite evenchances…If the probability of an event happening is 110 then you’ll probably have to generate a random number from 1 to 10. You could let one number represent the event happening, and all the others represent it not happening. If I generate a random number from 1-10, I could define 1 to mean it happens, and 2-10 mean it doesn’t!
  • 6.
    How would yousimulate…A jogger estimates the probability he’ll finish his run without taking a break is 0.75What numbers would you generate to simulate whether he takes a break or not?ToolHmmm..?x Ran# + 1
  • 7.
    You could use…Youcould use: Random numbers from 1 – 4 where 1,2,3 = no break 4 = takes a breakOr Random numbers from 1 – 100 where 1-75 – no break 76-100 = take a breakTool
  • 8.
    Sample answer:The toolI will use is the random number generator on my calculator.I will generate random numbers from 1 – 4 where: 1, 2, 3 means no break is taken4 means the jogger takes a breakTool
  • 9.
    ToolThere’s no onecorrect way to define the Tool.Just think carefully about what you’re doing.Remember to state: What you’re using (random number generator)
  • 10.
  • 11.
    What they meanTrialUsuallythe situation you are simulating will be more complicated than just one isolated event.For example, you might be trying to simulate a group of joggers and whether they are likely to have to take a break for one of their members.
  • 12.
    Suppose you have5 joggers in the group, and the probability that each one might have to take a break is 0.75 How will you simulate this? How many numbers need to be generated per trial?Trial
  • 13.
    Obviously you needto generate a number for each jogger, so that’s 5 numbers per trial.You’ll need to record these results, and then repeat for 30 trials. Easy!Trial
  • 14.
    TrialSample answer:One trialwill consist of me generating 5 random numbers as described before, one for each jogger. I will record these numbers, and whether a break was taken or not in a table.I will carry out 30 trials.
  • 15.
    TrialSo when you’redesigning a simulation you need to state:What one trial will consist of (i.e. how many numbers you need to generate)
  • 16.
    What you’re goingto do with these numbers (duh…record them in a table of course)
  • 17.
    How many timesyou’re going to repeat the process.ResultsBy now you’ve decided exactly how this simulation is going to run, so you should know what you want to record. Just draw up a neat table with headings and start carrying out trials.
  • 18.
  • 19.
    CalculationThere are twousual types of calculation made at the end of a simulation.For one of the type discussed here it is usually an estimate of the probability that something will happen.
  • 20.
    CalculationEstimate the probabilitythe jogging group will not have to take a break.𝑃𝑛𝑜 𝑏𝑟𝑒𝑎𝑘=# 𝑡𝑟𝑖𝑎𝑙𝑠 𝑤h𝑒𝑟𝑒 𝑛𝑜 𝑏𝑟𝑒𝑎𝑘 𝑡𝑎𝑘𝑒𝑛# 𝑡𝑟𝑖𝑎𝑙𝑠 𝑐𝑎𝑟𝑟𝑖𝑒𝑑 𝑜𝑢𝑡So the answer will depend on your simulation results. 
  • 21.
    CalculationFor a simulationwith more open-ended trials the calculation might involve an estimate of average number of times something might happen (e.g. oil strike question practised in class).
  • 22.
    Life after simulation…Youwill often be expected to compare your simulation probability to a theoretical one.E.g.Calculate the theoretical probability that the jogging group does not have to take a break, and compare it to your simulation results.