## Lesson Summary

Summary

Students will formulate a hypothesis, run simulations, and analyze the results to determine what needs to be modified in their hypothesis and/or the simulation itself.

Outcomes

• Students will identify and create real-world examples of models and simulations.
• Students will use models and simulations to generate new knowledge and to formulate, refine, and test hypotheses.
• Students will use simulations to test hypotheses without the constraints of the real world.

Overview

1. Getting Started (10 min)
2. Guided Activities (35 min)
1. Activity 1 - Rolling Dice Simulation, materials - large paper and markers or other method to share group work [15 minutes]
2. Activity 2 - Using a Simulation to Test a Hypothesis [20 minutes]
3. Wrap Up (5 min)

Source

The coin flipping extension is based on a CS10K lesson: https://sites.google.com/site/mobilecsp/lesson-plans/lp-coinflip-miniprojects

## CSP Objectives

Big Idea - Abstraction
• EU 2.3 - Models and simulations use abstraction to generate new understanding and knowledge.
• LO 2.3.1 - Use models and simulations to represent phenomena. [P3]
• LO 2.3.2 - Use models and simulations to formulate, refine, and test hypotheses. [P3]
Big Idea - Data
• EU 3.1 - People use computer programs to process information to gain insight and knowledge.
• LO 3.1.2 - Collaborate when processing information to gain insight and knowledge. [P6]
Big Idea - Algorithms
• EU 4.1 - Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.
• LO 4.1.1 - Develop an algorithm for implementation in a program. [P2]

## Math Common Core Practice:

• MP2: Reason abstractly and quantitatively.
• MP3: Construct viable arguments and critique the reasoning of others.

## Common Core Math:

• F-BF.1-2: Build a function that models a relationship between two quantities
• S-ID.1-4: Summarize, represent, and interpret data on a single count or measurement variable

## Common Core ELA:

• RST 12.7 - Integrate and evaluate multiple sources of information presented in diverse formats and media
• RST 12.8 - Evaluate the hypotheses, data, analysis, and conclusions in a science or technical text
• RST 12.9 - Synthesize information from a range of sources

## NGSS Practices:

• 3. Planning and carrying out investigations
• 4. Analyzing and interpreting data
• 5. Using mathematics and computational thinking
• 6. Constructing explanations (for science) and designing solutions (engineering)
• 8. Obtaining, evaluation, and communicating information

## Key Concepts

Students will be able to:

• identify and create real-world examples of models and simulations.
• use models and simulations to generate new knowledge and to formulate, refine, and test hypotheses.
• use simulations to test hypotheses without the constraints of the real world.

## Essential Questions

• How can computational models and simulations help generate new understanding and knowledge?
• How can computation be employed to help people process data and information to gain insight and knowledge?
• How are programs developed to help people, organizations or society solve problems?

## Teacher Resources

Student computer usage for this lesson is: required

The PowerPoint "Using Data and Simulations" can be found in the Lesson Resources folder.

Penny Bias article to go with lesson extension: http://mathtourist.blogspot.com/2011/02/penny-bias.html

For the Monty Hall Problem extension:

Online simulation of the problem: http://math.ucsd.edu/~crypto/cgi-bin/MontyKnows/monty2?1+17427

There are several videos on YouTube demonstrating and explaining the Monty Hall Problem.

An animated video: https://www.youtube.com/watch?v=mhlc7peGlGg length is 5:48

Live action video: https://www.youtube.com/watch?v=4Lb-6rxZxx0 length is 5:30

There is sample code for the die Python program in the Lesson Resources Folder called 4-3 Sample Code.py

# Getting Started (10 min)

Journal:

1. Describe a situation that can be modeled by rolling one die.
2. Describe a situation that can be modeled by rolling two dice.
3. (Consider possible outcomes and the likelihood of each outcome.)

Have students share their answers with the class.

# Guided Activities (35 min)

## Activity 1 (15 min) - Designing a Simulation (rolling dice)

1. Arrange the class into small groups (two or three).
2. The groups are to develop an algorithm and write a program to simulate rolling a standard six-sided die.
• The program should ask for the number of rolls and display the results (number of each possible outcome that was rolled).
• Note: The students will need to use the randint function to write this code.
• `import random` at the top of the code
• `random.randint(min,max)` returns a 'random' integer between the min and max values (inclusive).
• Remind students to use functions where appropriate.
• Students are encouraged to write their plan (flow chart or pseudocode) on large paper or some other method to enable later sharing with the class.
3. Have a representative from each group describe their plan for the algorithm. (After the first group, subsequent groups could highlight similarities and differences.)
4. Next, have each group discuss and implement changes to their algorithm and programs to simulate rolling two dice. (When providing directions, ask the class how using functions in the previous exercise would make this change easier to implement.)
5. As a class, discuss how many times the program should "roll" the dice. (Be sure students note that every possible value should be displayed, especially upper and lower bounds.)

## Activity 2 (20 min) - Using a Simulation to Test a Hypothesis

1. Each group should develop a hypothesis to answer the question: Can a twelve-sided die be used in place of rolling two six-sided dice? Each group should agree on a hypothesis and write it down.
2. The groups already have a design for rolling two six-sided dice. They should now design an algorithm for rolling a twelve-sided die. (This process can involve creating a new function or modifying the current function's parameters to accept the number of sides.)
3. The students should be paired up and begin writing the code necessary to test the hypothesis.
4. Once they finish the code, students should run both simulations to compare results. Note: Students need to save their code. They will be using it in the next lesson's homework.
5. As students complete their simulations, if possible, have each pair share their data with the class (in a spreadsheet displayed by the teacher's computer, or on the white board, or large paper).
6. As data is collected, students should determine whether their hypothesis was correct or whether it needs to be modified.
7. Analyze with the class if the simulations themselves were implemented correctly. (Does the data represent the expected theoretical outcomes? How can you modify the program to correct any errors?)

# Wrap Up (5 min)

Ask the class: Does your program represent a sufficient simulation for rolling dice? What are the advantages/disadvantages of using a program vs. actual dice?

Journal: Summarize how a program can be used as a simulation to test a hypothesis.

## Options for Differentiated Instruction

Students can be provided with the code for a function to simulate rolling one die and use it to develop the rest of the program.

After the first group activity, the teacher can swap a student from each group to allow different input into the next group activity.

### Extension #1 - Penny Flipping

This extension is based on advanced mini project # 4, which can be found here:  https://docs.google.com/a/smcps.org/document/d/1AKHpiQ87bE4W1YzHlAFh2uNAHuEtdMOCQVV6HfxfDzc/edit

Students read an article about the 'randomness' of flipping a penny: http://mathtourist.blogspot.com/2011/02/penny-bias.html

Next, students should hypothesize the results of lining up 10 pennies on edge and knocking them over (as described in the article). Students need to determine how many times to run the experiment, collect data, and analyze the results.

Students should work in pairs to write a computer simulation for the penny experiment. (Note: this is a program based on experimental data, not theoretical.)

Discuss as a class the validity of the simulation written. Can this simulation be used for other coins?

### Extension - The Monty Hall Problem

In the game show "Let's Make a Deal", the original host was Monty Hall. Onvery show, Monty would present a player with three doors or curtains to choose from. The contestant was asked to choose a door in search of a prize. After making a selection, Monty Hall would open one of the doors not selected by the contestant to reveal a non-prize (perhaps a goat). Then Monty would ask if the contestant wanted to change their choice.

After explaining the show to the class ask, "Should the contestant change?" Students should propose a hypothesis.

Have the students design a simulation to test their hypothesis (discuss what is the data collected and the number of times the simulation should run to collect data). After running the simulation, students should evaluate their hypothesis and determine whether it needs to be modified or whether the simulation needs to be modified.

If Monty Hall had four doors, what should the contestant do?

What should the contestant do if they know that Monty does not know what is behind each door?

Online simulation of the problem: http://math.ucsd.edu/~crypto/cgi-bin/MontyKnows/monty2?1+17427

There are several videos on YouTube demonstrating and explaining the Monty Hall Problem.

An animated video: https://www.youtube.com/watch?v=mhlc7peGlGg length is 5:48

Live action video: https://www.youtube.com/watch?v=4Lb-6rxZxx0 length is 5:30

## Formative Assessment

Review student journal entries and class discussions to determine students' understanding of simulations, a hypothesis, and the ability to determine a method to test a hypothesis.

## Summative Assessment

Describe an algorithm to simulate drawing an ace of any suit from a standard deck of cards.

Make a hypothesis about drawing cards from a standard deck of cards and determine how to collect data to answer your hypothesis.