Lab 2: Simulations

After a general introduction to the topic, students build a simulation to model the flipping of a coin. This introductory simulation is intended to give them experience in a simple and familiar context. Then the students will model and simulate the spread of a disease in a population. This is a very complex phenomena to study in real life, so the virtual model and its simulation will require significant simplification. The people in the population will be colored dots (blue for healthy and red for sick). These person sprites will move at a constant speed, and the collisions between a sick and a healthy person will lead to the healthy person becoming also sick. The simulation will run until the entire population is either infected or recovered. The running time of the simulation will depend on various parameters input by the user, such as the population size, the percentage of the population initially sick, and the speed at which the sprites are moving. Students will adjust the parameters and formulate, refine, and test hypotheses about the resulting patterns in the spread of the disease.

Pacing:

The 2 lab pages could be split across 1–2 days (40–80 minutes). Expected times to complete follow:

Lab Pages

Solutions

Correlation with 2020 AP CS Principles Framework 

Computational Thinking Practices: Skills

Learning Objectives:

Essential Knowledge: