AP Computer Science Principles · Unit 3: Algorithms & Programming
3.16 Simulations
What is a simulation?
A simulation is a program that models a real-world process, object, or phenomenon. Simulations let us study systems that are too expensive, dangerous, slow, or complex to test directly — like crash tests, weather patterns, or population growth — by running many trials with a computer model instead.
Simplification and abstraction
Simulations use abstraction to include only relevant variables and exclude unnecessary detail, making complex systems manageable. Because they are simplified, simulations may not perfectly represent real-world behavior — results can be affected by assumptions built into the model, so outcomes should be interpreted with that limitation in mind.
Randomness in simulations
Many simulations use random number generation to model unpredictable real-world events, such as dice rolls, disease spread, or customer arrivals. This allows simulations to explore many possible outcomes quickly, at lower cost, and without real-world risk — a key benefit over physical experimentation.
Key terms
- Simulation
- A program that models a real-world process, object, or phenomenon for study or prediction.
- Why use simulations?
- To study systems that are expensive, dangerous, slow, or complex to test in real life.
- Limitation of simulations
- They are simplified models, so they may not perfectly represent real-world outcomes.
- Role of randomness
- Random number generation models unpredictable real-world events within simulations.
- Benefit of simulations over real testing
- They are faster, cheaper, and safer than conducting real-world experiments.
Try an AP-style question
Why are simulations useful?
- They never use randomness
- They always give perfect predictions
- They test ideas safely and cheaply
- They replace all real data
Show the answer
C. Model reality.
Practice 8 AP-style questions with instant explanations, flashcards and spaced review.
Study 3.16 free in APrep