The Stacks
BIG IDEA 3: ALGORITHMS AND PROGRAMMING · TOPIC 3.16

3.16 Simulations

A simulation is a program that models a real or imagined situation. The exam tests why we simulate and what's lost when we do.

What you need to know

  • A simulation is an abstraction of a more complex object or phenomenon, used to investigate it in a controlled way.
  • Why simulate: the real thing may be too dangerous (crash tests), too expensive, too slow (climate over centuries), too fast, or simply impossible to observe (a bridge that isn't built yet). Simulations can be run many times and with varied parameters.
  • Simulations remove details and make simplifying assumptions. That's what makes them tractable — and what limits their accuracy. Every simulation question wants you to notice this trade-off.
  • Because of simplifications, a simulation's results may not match reality; conclusions must account for what was left out.
  • Simulations often use random values (3.15) to model uncertainty or variation, and are run repeatedly to see the range of outcomes.
  • Investigating a simulation: change one parameter at a time and observe the effect. That's how simulations generate hypotheses.
  • A simulation is a model, not an experiment on the real system — but it can guide which real experiments are worth running.

Worked example

A city wants to know whether adding a traffic light reduces accidents. Building the light and waiting a year is slow and risks real crashes. A simulation models cars arriving at random intervals, the light cycling, and drivers' reaction times. It ignores weather, driver distraction, and road conditions — simplifications. Running it 10,000 times shows accidents drop 40% in the model. That's useful for deciding to try the light, but the 40% number shouldn't be quoted as a real-world prediction.

Exam tip: Two answer patterns dominate. "Why use a simulation?" → safety, cost, time, or impossibility of the real thing. "What's a limitation?" → simplifying assumptions mean results may not reflect reality. If an option says a simulation gives "exact" or "guaranteed" real-world results, it's wrong.

Going deeper

The nuance, edge cases, and connections that turn a 3 into a 5.

  • A simulation is an abstraction of a real-world process: it keeps the parts that matter for the question being asked and drops the rest. The CED's phrase is that simulations "remove details" and "make assumptions" to simplify.
  • The reasons to simulate, per the CED: the real experiment is impossible (a future bridge), dangerous (a nuclear reaction), expensive (a rocket launch), too slow (centuries of climate), or too fast (a chemical reaction). Simulations are also repeatable with changed parameters.
  • The core limitation: because details were removed, the simulation may not match reality. Results are only as good as the assumptions. A simulation that assumes every person has the same number of daily contacts will mispredict a disease that spreads through super-spreaders.
  • Random values in a simulation model real-world variability. Running the simulation many times and looking at the distribution of results is how you get useful predictions from a random model — a single run tells you one possibility.
  • Investigating with simulation: change one input, hold the others constant, observe the change in output. That's how simulations generate hypotheses about the real system.
  • A simulation can be biased in the same ways data can: if the assumptions reflect one group's experience, the simulation predicts well for that group and poorly for others.
  • Simulations can also be used as a testing tool for programs: simulate user input or network conditions to test a program without real users.

Mistakes that cost points

  • Claiming a simulation gives exact real-world results. It gives results under its assumptions. Any "guarantees" or "exactly predicts" option is wrong.
  • Saying a simulation has no assumptions. Every simulation simplifies. That's the definition.
  • Confusing a simulation with the real thing. A simulated crash test doesn't damage a car. That's the point — and the reason results need validation against real data eventually.

Practice questions

Written in the style of the real exam. Try each one before revealing the answer.

Q1 An engineer uses a computer simulation to test how a bridge design responds to earthquakes of different strengths. Which of the following is the most likely reason for using a simulation instead of a physical test?
  1. A Simulations always produce perfectly accurate results.
  2. B Testing a real bridge under real earthquakes would be dangerous, expensive, and impractical, while a simulation can be run many times safely.
  3. C Simulations do not require any assumptions about the bridge.
  4. D A physical test would require less time.
Show answer

Answer: B. Safety, cost, and repeatability are the core reasons to simulate. Simulations still rely on assumptions and are not perfectly accurate.

Q2 A simulation of disease spread assumes every person has the same number of daily contacts. Which of the following best describes the effect of this assumption?
  1. A It makes the simulation impossible to run.
  2. B It is a simplification that may cause the simulation's results to differ from real-world spread.
  3. C It guarantees the simulation matches real data.
  4. D It eliminates the need for random values.
Show answer

Answer: B. Simplifying assumptions make simulations feasible but limit accuracy. The exam wants you to name that trade-off.

Key vocabulary

Simulation
a program that models a real-world or hypothetical process as an abstraction
Simplifying assumption
a detail intentionally left out or held constant to make a model tractable