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
-
Page 1: Why Use Simulations?
-
Learning Goals:
- Understand the characteristics of simulations.
- Understand when it may be appropriate/necessary to employ simulations.
- Understand the need for simplification simulation while studying complex phenomena.
- Be aware of the pros and cons of using simulations in representing and studying complex real life phenomena.
- Discussion: Ask students to imagine and describe the impact of simulation in the age of supercomputers. How will they help solve problems in various fields such as medicine, finance, space exploration, climate change, etc.?
-
Page 2: Disease Spread Project.
-
Learning Goals:
- Understand the parameters needed in running a simulation.
- Implement a simplified model of the spreading of a disease in a population.
- Develop and test hypotheses regarding the spread of a disease.
- Develop skills on how to improve a model and a simulation to better represent a real world phenomenon.
Solutions
Correlation with 2020 AP CS Principles Framework
Computational Thinking Practices: Skills
- 1.A: Investigate the situation, context or task.
- 1.D: Evaluate solution options.
Learning Objectives:
-
AAP-3.F: For simulations:
- Explain how computers can be used to represent real-world phenomena or outcomes. (1.A)
- Compare simulations with real-world contexts. (1.D)
Essential Knowledge:
- AAP-3.F.1: Simulations are abstractions of more complex objects or phenomena for a specific purpose.
- AAP-3.F.2: A simulation is a representation that uses varying sets of values to reflect the changing state of a phenomenon.
- AAP-3.F.3: Simulations often mimic real-world events with the purpose of drawing inferences, allowing investigation of a phenomenon without the constraints of the real world.
- AAP-3.F.4: The process of developing an abstract simulation involves removing specific details or simplifying functionality.
- AAP-3.F.5: Simulations can contain bias derived from the choices of real-world elements that were included or excluded.
- AAP-3.F.6: Simulations are most useful when real-world events are impractical for experiments (e.g., too big, too small, too fast, too slow, too expensive, or too dangerous).
- AAP-3.F.7: Simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
- AAP-3.F.8: Random number generators can be used to simulate the variability that exists in the real world.