Interactive Simulations (Wi-Fighters)
Interactive CSP lesson on simulations with live predictions and coding.
๐ฒ Lesson provided by Wi-Fighters
AP CSP ยท Big Idea: Algorithms and Programming
Interactive Simulations Lab
Explore how simulations use inputs, randomness, repeated trials, and models to predict possible outcomes.
What is a simulation?
A simulation imitates a real-world process using a model, inputs, rules, and outputs.
Why use simulations?
When real testing would be expensive, dangerous, slow, or impossible to repeat.
What affects accuracy?
Missing variables, weak assumptions, or bad data make simulation results less reliable.
What to observe?
Look for patterns over many trials. One result can be random โ many reveal a trend.
AP CSP Simulation Vocabulary
Simulation 1
Dice Probability Simulator
Roll a die repeatedly and watch experimental probability move closer to theoretical probability.
How this is a simulation
The die roll uses a random number generator. Each roll is one trial. The program stores results, calculates frequencies, and displays the output in a table.
Last roll
No rolls yetLive Frequency Chart
Theoretical probability per side โ 16.7%
Recorded Results
| Dice Value | Frequency | Exp. Probability | Diff from 16.7% | Bar |
|---|
Quick Discussion Prompt
Why do the results usually become more balanced after more trials?
Simulation 2
Flight Risk Simulator
Change the input variables and run a flight model that calculates risk using rules plus randomness.
How this is a simulation
The flight model uses selected conditions as inputs. The algorithm converts them into a safety score (the likelihood of success). An uncertainty factor โ a random number simulating unpredictable real-world variables like bird strikes, turbulence, or equipment glitches โ is then compared to that score. If the uncertainty exceeds the safety margin, the flight fails.
Risk Factor Breakdown
These deductions show how the model makes decisions.
Quick Discussion Prompt
Which input seems to affect the simulation the most, and why?
Lesson Wrap-Up
Both simulations show that results depend on the model, assumptions, data, and number of trials โ not just randomness alone.
Dice Simulator
Best for showing randomness, repeated trials, probability, and data collection.
Flight Simulator
Best for showing input variables, weighted conditions, assumptions, and limits of a model.