๐ŸŽฒ 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.

๐ŸŽฒ Randomness โœˆ๏ธ Real-world models ๐Ÿ“Š Data tables ๐Ÿง  CSP reasoning
๐Ÿงช

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

Click a vocabulary word to see a quick AP CSP definition.

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 yet
Total Rolls0
Most CommonN/A
Least CommonN/A

Live Frequency Chart

Theoretical probability per side โ‰ˆ 16.7%

Recorded Results

Dice ValueFrequencyExp. ProbabilityDiff 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.

Environment
Plane
People
โ˜€๏ธ
โœˆ๏ธ
๐Ÿ’ฅ
Safety Score--%
Uncertainty Factor--
OutcomeWaiting
Choose inputs and run the flight simulation.

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.

โ†‘