Skip to content
Marlbridge

AP® Computer Science Principles · Unit 3 · Topic 3.16

Simulations: Revision Notes (Computer Science Principles 3.16)

One-page recap of simulations: abstraction, purposes, when they are most useful, the role of random numbers, how bias arises, and how to compare a simulation with the real world.

Recap

  • A simulation is an abstraction of a complex object or phenomenon for a specific purpose.
  • It uses varying sets of values to reflect changing state.
  • Building one means removing specific details or simplifying functionality.
  • Used to draw inferences without real-world constraints; best when the event is too big, small, fast, slow, expensive or dangerous.
  • Random number generators simulate real-world variability; one run is one possible outcome.
  • Bias can come from the choices of what to include or exclude.
  • Simulations help form and refine hypotheses.

Key relationships

Idea Why it matters Example
Abstraction Keep what the question needs Traffic: speed and position, not car colour
Variability Use RANDOM for chance RANDOM(1, 10) ≤ 3 for a 30% event
Many runs Show typical results Five runs gave 3, 4, 2, 5, 4 rainy days
Bias Excluded details skew results No blocked drains: under-predicted flooding
Compare with reality Check and refine the model Canteen counts versus simulated queue
Use cases Real experiment impractical Dangerous, expensive, too slow

Assumptions

  • The simulation answers a specific question.
  • Each RANDOM call is independent unless the model links them.
  • Results from a simulation are predictions from the model, not facts about the real world.

Method for evaluating a simulation

  1. State the purpose of the simulation.
  2. List what is included and what is left out.
  3. For each omission say how it would change the results (higher or lower).
  4. Say whether the simulation is more useful than a real experiment and why.
  5. Suggest how to check it against real data.

Mistakes to avoid

  • Treating one random run as the answer.
  • Saying a simulation is perfect because the code works.
  • Listing omissions without saying their effect.
  • Forgetting that variability comes from random numbers.
  • Claiming that simulations never need real-world checking.

Worked mini-example

A simulation of a bridge under traffic ignores strong wind. It reports that the bridge is safe for 40 lorries. Wind adds force that the model leaves out, so the real safe number may be lower. The bias is optimistic: a missing detail makes the structure look stronger. Real tests with a scale model in a wind tunnel would help refine the simulation.

Quick self-check

  1. Why are simulations useful for testing a spacecraft re-entry?
  2. What does a random number generator do in a simulation?
  3. How can a correct program still give misleading results?
Answers
  1. The real test is too dangerous and expensive to repeat many times.
  2. It represents the variability of the real world.
  3. The model may exclude or simplify real-world details (bias), so the results differ from reality even though the code does what it was written to do.

Where marks are won and lost

Expect conceptual questions: what makes a simulation an abstraction, which situation best suits one, and what bias a missing detail causes. Others give a short simulation that uses RANDOM and ask what it displays or what the possible results are. In scenario questions say what is included, what is left out, and what effect the omission would have on the results, using the exact words of the scenario.

Back to the full study guide for worked examples and explanations.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.