Lesson Summary

Summary

In this lesson, students will learn how to acquire and analyze data to find answers to questions and solutions to problems. Students will consider whether or not the data they are presented with is necessarily valid, and research some of the various data sources online.

Outcome

  • Students will explore how computation can be employed to help people process data and information to gain insight and knowledge.
  • Students will learn how computation can be used to facilitate exploration and discovery when working with data.
  • Students will consider what considerations and trade-offs arise in the computational manipulation of data.
  • Students will explore opportunities that large data sets provide for solving problems and creating knowledge.

Overview

Session 1

  1. Getting Started (5 min) - Students journal on the importance of validating data
  2. Discuss journal prompt (5 min)
  3. Brainstorm types of online data (5 min)
  4. Explore how meaning is created from data (10 min)
  5. Work with data online (20 min)
  6. Assign homework (5 min)

Session 2

  1. Getting Started (5 min) - Students journal about what they learned the previous day
  2. Analyzing Data (30 min) - Discuss correlation and causation; discuss and explore different types of data and analysis
  3. Present homework findings (10 min)
  4. Wrap Up - Journal (5 min)

Learning Objectives

CSP Objectives

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]
      • EK 3.1.2B - Collaboration facilitates solving computational problems by applying multiple perspectives, experiences, and skill sets.
      • EK 3.1.2C - Communication between participants working on data-driven problems gives rise to enhanced insights and knowledge.
      • EK 3.1.2F - Investigating large data sets collaboratively can lead to insight and knowledge not obtained when working alone.
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.1 - Extract information from data to discover and explain connections or trends. [P1]
      • EK 3.2.1B - Large data sets provide opportunities for identifying trends, making connections in data, and solving problems.
      • EK 3.2.1D - Search tools are essential for efficiently finding information.
      • EK 3.2.1E - Information filtering systems are important tools for finding information and recognizing patterns in the information.
    • LO 3.2.2 - . Determine how large data sets impact the use of computational processes to discover information and knowledge. [P3]
      • EK 3.2.2A - Large data sets include data such as transactions, measurements, texts, sounds, images, and videos.
      • EK 3.2.2F - The size or scale of a system that stores data affects how that data set is used.

Key Concepts

Students will be able to acquire data and analyze it to find answers to a specific question or solutions for a specific problem.


Essential Questions

  • What opportunities do large data sets provide for solving problems and creating knowledge?

Teacher Resources

Student computer usage for this lesson is: required

Student computer usage for second lesson is: optional

Teacher Resources

In the Lesson Resources Folder

  • PowerPoints: "Finding Data" and "Finding and Analyzing Data" 
  • Session 1 Homework: "Homework Unit 4 Lesson 1"

Webpages Session 1

Webpages Session 2

Lesson Plan

Session 1

For this session, use the presentation "Finding Data" in the Lesson Resources Folder.

Getting Started (5 min)

Given this data: [slide 1]

A blood drive at the local high school reveals that 20% of the students were HIV positive.

Journal on these questions:

  • What is your immediate reaction?
  • What questions do you have?

Activities (40 minutes)

Activity 1 (5 min) - Discuss the journal prompt

Lead the students in discussion using the bullets below and slide 2 of the PowerPoint as guidence. Students should talk about WHY they assumed the data was true, or were uncomfortable questioning the truth of the data. 

Activity 2 (5 min) - Brainstorm: What kinds of data can be found online?

Part 1 - Discussion

Data comes from many places and takes many forms [slide 3]

  • Have students discuss: How do business, personal, government and devices create and use data?

Part 2 - Brainstorm

Brainstorm as a class: what kinds of data are generated? Possible answers:

  • video: movies, webcam images, CCTV, youTube, Netflix, Facebook, etc.
  • pictures: maps, Instagram, photos, cartoons, drawings, …. everything!
  • words: books, articles, news, stories, blogs, Facebook
  • numbers: facts, financial transactions, scientific data
  • sound: music, speech
  • behavior tracking: GPS, click behavior, search history

Activity 3: How is meaning created from data? (10 minutes)

  1. Look at some data gathered about selfies from different cities around the world. [slide 4]  
    • Main ideas:
      • You have to gather the data and analyze it to create meaning. 
      • Creating meaning from pictures still takes some human interpretation.
    • Prompt students to come to a conclusion about the graphed data on the page.
    • Question for discussion: How large of a sample is needed to draw a conclusion?
  2. Quick review: Make the point that there is a LOT of data even in a single picture. [slide 5]
    1. Define these and put them in order. Use this webpage to review bytes: http://highscalability.com/blog/2012/9/11/how-big-is-a-petabyte-exabyte-zettabyte-or-a-yottabyte.html
      • MB, bit, TB, ZB, byte, GB, pixel (one dot of color on the screen), KB, PB
    2. Look at the photo on slide 5.
      1. 365 gigapixels is 365 billion pixels, if the picture is a square, then it is 604,152 pixels on each side (too big to fit on any HDTV screen) 
      2. http://www.rtings.com/info/what-is-the-resolution  A 4K super high resolution TV is only about 3,000 X 2,000 pixels. Even a movie screen can’t show all of the detail!
      3. https://www.amctheatres.com/sony4k, you can only look at it one part at a time.
    3. Preview Wolfram Alpha, an engine for providing knowledge from data.

Activity 4 (20 min) - Work with some data online

  1. Students should complete the Data Search and Analysis Handout. [slide 7]
    • Depending on how much time you have, you can pair students and assign even/odd questions or chunks of questions to different groups, or have each student research on their own.
  2. If there’s time in class, try to go over results and compare (especially the first 5) to see if people got similar answers. Why or why not? [slide 8]

Assign Homework (5 minutes)

Give students the worksheet: Homework Unit 4 Lesson 1.

There are 10 videos to choose from, each 10-15 minutes long. Either allow students to self-select, or assign them a particular video. Students should watch the video and answer the questions on the worksheet. This is an opportunity to discuss plagiarism: students are expected to watch the video and write from their own experience.

Session 2

For this session, use the presentation: Finding and Analyzing Data from the Lesson Resources Folder

Getting Started (5 min)

Students should journal on the following:  Describe at least 2 ways that we create meaning out of data. [slide 1]

  • Possible answers: graph it, total it, average it, find min and max, map it, compare it to other data, find trends, generate predictions (like weather), draw conclusions (facial recognition, emotions, voice inflection), diagnose diseases, discover new stars, etc.

Activities (40 min)

Activity 1 (35 min): Analyzing Data

Part 1: Correlation vs. Causation

  1. Look at slide 2 from the PowerPoint. Creating meaning from data can be misleading.
  2. Point out that the graph shows a direct relationships between the number of divorces in Maine and the amount of margarine that is purchased. When one goes up, the other does too, and vice versa. Is this a causal relationship?
    • Show some examples from the Tyler Vigen website http://www.tylervigen.com/spurious-correlations . It has many examples of data connections that may be statistically valid but don’t make sense.  The site was created to point out how comparisons due to data correlation are often not valid. 

Part 2: Data Science

    1. What does a data scientist do? [slide 3]
      • Show the two videos and discuss.
      • Tricks to analyzing big data:
        • Knowing what data to use, and what to disregard.
        • Knowing how to make up for missing data.
        • Knowing how to discover and predict trends and correlations.
      • There are many degrees offered in data science, and free online courses are available from Udacity and Coursera, among others.
    2. Look at 3 false assumptions about big data [slide 4]:
      1. It’s complete and accurate
      2. It tells the whole story
      3. Bigger is better
    3. What considerations and tradeoffs arise in the computational manipulation of data? [slide 4]
      1. How do you account for missing data?
      2. How do you certify your sources?
      3. How do you decide which data to include and which to exclude?
      4. How much data is enough? (time is money!)
      5. Are your processing algorithms accurate?
    4. What is some of the data needed to successfully fly a space mission? (Possible answer: Knowing all about the spacecraft: speed, direction, amount of fuel/oxygen left.) The same problems that applied to early space missions are some of the same problems faced in dealing with big data.
      • You need to decide which factors to include in your calculations, and which to exclude.
      • You need to decide when to make an assumption for missing data or when to estimate.
      • In writing a program for an early space flight there are many unknown factors using a space craft that has never flown before.
      • It’s usually impossible to create a perfect algorithm that can take into account every possibility, so how do you allow for errors and changes?
    5. What are some of the calculations needed? (Possible answers: how much fuel to release and with which engines.)
      • They had to run many simulations first to see what would happen under various circumstances.
    6. See if anybody knows how NetFlix, movie makers, or Amazon use data about their customers to be more successful. [slide 5] http://www.smartdatacollective.com/bernardmarr/312146/big-data-how-netflix-uses-it-drive-business-success and http://www.fastcompany.com/3024655/pitch-perfect-and-how-analytics-are-transforming-movie-marketing

Businesses like Amazon and NetFlix learn the habits of different customers and make recommendations based on their previous choices and others who share similar characteristics (like Google ads).

See if anybody knows the story of Moneyball (based on a true story) of how a baseball team made decisions based on data analysis to become winners, https://en.wikipedia.org/wiki/Moneyball_(film) and how Vivek Ranadivé--who knew little about basketball but owned a multi-million dollar computer processing company and knew how to choose and analyze data--coached his then twelve-year-old daughter’s National Junior Championship basketball team to the national championship game.  He relied upon his sporting knowledge of soccer and cricket paired with his analytic mindset, to create a system of play which allowed his relatively un-athletic team to excel.  From the moment that he used intellect and his business experience to coach an inexperienced team to the championship game, the man who once thought basketball was “mindless” was hooked on the sport. http://www.newyorker.com/magazine/2009/05/11/how-david-beats-goliath

  1. How is data analyzed? Data analysis requires an algorithm, a plan to collect and process data. [slide 6]
    1. Generate discussion about what data is collected and how it is analyzed. What is a possible algorithm for making a decision about choosing what movies NetFlix might suggest for a customer?
    2. http://www.smartdatacollective.com/bernardmarr/312146/big-data-how-netflix-uses-it-drive-business-success
      Brainstorm: what other data might they collect? (what’s currently popular in that age group, demographic, etc.)
  2. Choose one of the options and write an outline of an algorithm: choosing a movie to produce or a sports player to hire. [slide 7]
    1. Describe at least two calculations needed
    2. Describe some of the data you’d need to collect.
    Share and discuss.

Activity 2 (5 min): Present homework from previous day after watching TED talks on data. [slide 8]

If time is short, choose only 1 or 2 of the questions from the homework to be presented to the class and collect the rest to grade.

Journal (5 min)

In your writing journal, map out the steps to answer a specific question or find a solution to solve a specific problem using data. 


Options for Differentiated Instruction

Extension Activities:

Data analysis activities from NOAA, NASA, and more! - http://climate-expeditions.org/educators/activities.html

Differentiation Instruction:

What is data acquisition? - http://www.ni.com/data-acquisition/what-is/

Data analysis and graphs (with Excel sample) - http://www.sciencebuddies.org/science-fair-projects/project_data_analysis.shtml

Collecting and analyzing data - http://ctb.ku.edu/en/table-of-contents/evaluate/evaluate-community-interventions/collect-analyze-data/main

Using Excel for Handling, Graphing, and Analyzing Scientific Data: A Resource for Science and Mathematics Students - http://academic.pgcc.edu/psc/Excel_booklet.pdf

 

 

 

 


Evidence of Learning

Formative Assessment

Journal day 1: 

Given this fictitious data:

A blood drive at the local high school reveals that 20% of the students were HIV positive.

  • What is your immediate reaction?
  • What questions do you have?

Journal day 2:  Describe at least 2 ways that we create meaning out of data.

Homework: Feedback from a TED video on big data

 


Summative Assessment

Students complete the Data Search and Analysis student activity.

Write an outline of an algorithm to make a data-based decision about what movie to produce or what sports team member to hire.

Lesson Summary

Summary

Students will define and identify models and simulations. They will work in groups to propose a simulation that could be used to investigate a hypothesis.

Outcomes

  • Students will identify real-world examples of models and simulations.
  • Students will understand that models and simulations are used to generate new knowledge, as well as to formulate, refine, and test hypotheses.
  • Students will understand that simulations allow hypotheses to be tested without the constraints of the real world.

Overview

  1. Getting Started (5 min)
  2. Introduction to Content (10 min)
  3. Guided Activities (30 min)
    1. Define and Identify Models and Simulations [10 min]
    2. Use Models and Simulations to Answer Questions [20 min]
  4. Wrap Up (5 min)

Source

Some of the ideas in this lesson were adapted from the CS10K community site, https://sites.google.com/site/mobilecsp/lesson-plans/realworldmodels

Learning Objectives

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]
      • EK 2.3.1C - Models often omit unnecessary features of the objects or phenomena that are being modeled.
      • EK 2.3.1D - Simulations mimic real-world events without the cost or danger of building and testing the phenomena in the real world.
    • LO 2.3.2 - Use models and simulations to formulate, refine, and test hypotheses. [P3]
      • EK 2.3.2A - Models and simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
      • EK 2.3.2B - Hypotheses are formulated to explain the objects or phenomena being modeled.
      • EK 2.3.2C - Hypotheses are refined by examining the insights that models and simulations provide into the objects or phenomena.
Big Idea - Data
  • EU 3.1 - People use computer programs to process information to gain insight and knowledge.
    • LO 3.1.3 - Explain the insight and knowledge gained from digitally processed data by using appropriate visualizations, notations, and precise language. [P5]
      • EK 3.1.3E - Interactivity with data is an aspect of communicating.
Big Idea - Impact
  • EU 7.1 - Computing enhances communication, interaction, and cognition.
    • LO 7.1.1 - Explain how computing innovations affect communication, interaction, and cognition. [P4]
      • EK 7.1.1F - Public data provides widespread access and enables solutions to identified problems.
  • EU 7.3 - Computing has global effects — both beneficial and harmful — on people and society.
    • LO 7.3.1 - Analyze the beneficial and harmful effects of computing. [P4]
      • EK 7.3.1J - Technology enables the collection, use, and exploitation of information about, by, and for individuals, groups, and institutions.
  • EU 7.4 - Computing innovations influence and are influenced by the economic, social, and cultural contexts in which they are designed and used.
    • LO 7.4.1 - Explain the connections between computing and real-world contexts, including economic, social, and cultural contexts. [P1]
      • EK 7.4.1B - Mobile, wireless, and networked computing have an impact on innovation throughout the world.

Math Common Core Practice:

  • MP4: Model with mathematics.

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

NGSS Practices:

  • 2. Developing and using models

Key Concepts

  • Models and simulations are used to generate new knowledge, as well as to formulate, refine, and test hypotheses.
  • Simulations allow hypotheses to be tested without the constraints of the real world.

Essential Questions

  • How can computational models and simulations help generate new understanding and knowledge?

Teacher Resources

Student computer usage for this lesson is: optional

These videos supplement the material covered in this lesson:

 

Lesson Plan

Getting Started (5 min)  

 

  • Journal: If I flip a coin 10 times, is it possible to predict exactly how many times it will come up heads? Why or why not?
  • A weather forecaster presented a forecast with a 20% chance of precipitation the next day.  The next day it rained.  Explain how the forecast may still have been correct.

 

Introduction to Content (10 min)

Introduce Vocabulary

Choose one of the simulations at Phet simulations and answer the following.

 

  • What models are being used?
  • What details are included?
  • What details are omitted?
  • What does the simulation seem to show?

 

View these two videos

Bill Nye and a scaled model of the solar system (4:17)

https://www.youtube.com/watch?v=97Ob0xR0Ut8

Computer Generated Model of a Solar System (2:41)

https://www.youtube.com/watch?v=8z5mwAlxBYc

Guided Activities (30 min)

Students create a journal entry responding to these two questions:

What was a main idea presented by each video?

What aspect(s) of the models helped make that point?

Students discuss each of the following with elbow partners then groups.

How do the models in these videos depend on computing?

Consider the strengths and weaknesses of each model. What understanding can be better drawn from the first model and what understanding can better be drawn from the second?

What questions could be answered using these two models?

From each group students share at least one response to each prompt.

Define and Identify Models and Simulations [10 min]

Examples of models (do not need to show the entire videos for student understanding):

 

  • Watch this video of a human heart simulation: Multi-scale Multi-physics Heart Simulator UT-Heart (5:15) (watch up to 2:00; the rest is interesting but not necessary).
  • What’s an advantage to having so many data points? What about a disadvantage? (A supercomputer is necessary to run the simulation.)
  • How can you test a parachute to be used on Mars? https://www.youtube.com/watch?v=_jOzxEOlDJg (1:11)? Describe the physical test. Before that test, they create models and simulate on the computer - why? (It is very costly to run a test and to create an actual parachute. First be sure an idea passes a simulated test, then build it.)

 

 

Examples of Simulations:

 

 

Have students find and share simulations in each of the following:

 

  • Financial (e.g., stock market forecasting)
  • Weather (e.g., predicting the path of hurricanes)
  • Space (e.g., predicting the path of an asteroid)
  • Sports (e.g., predicting championships)

 

Use Models and Simulations to Refine Questions [20 min]

 

  • Select one of the simulations explored today.
  • Write a question the simulation could help answer.
  • Run the simulation and write an answer to your question.
  • Exchange your results with your elbow partner.
  • Refine your elbow partners question
  • Write an answer to the new question.

 

Wrap Up (5 min)

Journal: Have students record the definitions (in their own words) of the vocabulary used in this lesson: probability, model, simulation, and hypothesis.


Evidence of Learning

Formative Assessment

  • Can students define models and simulations in their own words (and understand the difference)?
  • During the activity, are students able to identify particular characteristics that will be included in a model and simulation as well as characteristics that are to be excluded?

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

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.1 - Create a computational artifact for creative expression. [P2]
      • EK 1.2.1B - Creating computational artifacts requires understanding of and use of software tools and services.
      • EK 1.2.1C - Computing tools and techniques are used to create computational artifacts and can include, but are not limited to, programming integrated development environments (IDEs), spreadsheets, three-dimensional (3-D) printers, or text editors.
    • LO 1.2.4 - Collaborate in the creation of computational artifacts. [P6]
      • EK 1.2.4A - A collaboratively created computational artifact reflects effort by more than one person.
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]
      • EK 2.3.1A - Models and simulations are simplified representations of more complex objects or phenomena.
      • EK 2.3.1B - Models may use different abstractions or levels of abstraction depending on the objects or phenomena being posed.
      • EK 2.3.1C - Models often omit unnecessary features of the objects or phenomena that are being modeled.
      • EK 2.3.1D - Simulations mimic real-world events without the cost or danger of building and testing the phenomena in the real world.
    • LO 2.3.2 - Use models and simulations to formulate, refine, and test hypotheses. [P3]
      • EK 2.3.2A - Models and simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
      • EK 2.3.2B - Hypotheses are formulated to explain the objects or phenomena being modeled.
      • EK 2.3.2C - Hypotheses are refined by examining the insights that models and simulations provide into the objects or phenomena.
      • EK 2.3.2D - The results of simulations may generate new knowledge and new hypotheses related to the phenomena being modeled.
      • EK 2.3.2E - Simulations allow hypotheses to be tested without the constraints of the real world.
      • EK 2.3.2F - Simulations can facilitate extensive and rapid testing of models.
      • EK 2.3.2G - The time required for simulations is impacted by the level of detail and quality of the models and the software and hardware used for the simulation.
      • EK 2.3.2H - Rapid and extensive testing allows models to be changed to accurately reflect the objects or phenomena being modeled.
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]
      • EK 4.1.1A - Sequencing, selection, and iteration are building blocks of algorithms.
      • EK 4.1.1B - Sequencing is the application of each step of an algorithm in the order in which the statements are given.
      • EK 4.1.1C - Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
      • EK 4.1.1D - Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
      • EK 4.1.1G - Knowledge of standard algorithms can help in constructing new algorithms.
      • EK 4.1.1I - Developing a new algorithm to solve a problem can yield insight into the problem.
    • LO 4.1.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2B - Natural language and pseudocode describe algorithms so that humans can understand them.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
      • EK 5.1.1E - A computer program or the results of running a program may be rapidly shared with a large number of users and can have widespread impact on individuals, organizations, and society.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2A - An iterative process of program development helps in developing a correct program to solve problems.
      • EK 5.1.2G - Program development includes identifying programmer and user concerns that affect the solution to problems.
      • EK 5.1.2I - A programmer's knowledge and skill affects how a program is developed and how it is used to solve a problem.
      • EK 5.1.2J - A programmer designs, implements, tests, debugs, and maintains programs when solving problems.
  • EU 5.3 - Programming is facilitated by appropriate abstractions.
    • LO 5.3.1 - Use abstraction to manage complexity in programs. [P3]
      • EK 5.3.1A - Procedures are reusable programming abstractions.
      • EK 5.3.1B - A procedure is a named grouping of programming instructions.
      • EK 5.3.1C - Procedures reduce the complexity of writing and maintaining programs.
      • EK 5.3.1D - Procedures have names and may have parameters and return values.
      • EK 5.3.1H - Data abstraction provides a means of separating behavior from implementation.
      • EK 5.3.1K - Lists and list operations, such as add, remove, and search, are common in many programs.
      • EK 5.3.1L - Using lists and procedures as abstractions in programming can result in programs that are easier to develop and maintain.
  • EU 5.5 - Programming uses mathematical and logical concepts.
    • LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming. [P1]
      • EK 5.5.1A - Numbers and numerical concepts are fundamental to programming.
      • EK 5.5.1D - Mathematical expressions using arithmetic operators are part of most programming languages.
      • EK 5.5.1E - Logical concepts and Boolean algebra are fundamental to programming.

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 algorithms implemented and executed on computers and computational devices?
  • How are programs developed to help people, organizations or society solve problems?
  • How are programs used for creative expression, to satisfy personal curiosity or to create new knowledge?
  • How do computer programs implement algorithms?
  • How do people develop and test computer programs?
  • Which mathematical and logical concepts are fundamental to computer programming?

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

Lesson Plan

Getting Started (10 min)

Journal:

  • Models and simulations are simplified representations of more complex objects or phenomena.
    • What is a complex, everyday phenomena that is studied using models and simulations?
  • Models often omit unnecessary features of the objects or phenomena that are being modeled.
    • What features might a flight simulator program leave out to make the program easier to use and run faster?
  • Simulations mimic real-world events without the cost or danger of building and testing the phenomena in the real world.
    • What is something random that could be tested more easily with a computer than by building the real thing?

Have students share their answers with the class.

Guided Activities (35 min)

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

  1. Explain that many simulations include randomized events to simulate reality.
    • What unnessecary details can be omitted if you need to create a random outcome?
    • [Possible answers: you only need to choose a random number and then use selection to choose which block of code to execute as a result]
  2. Arrange the class into small groups (two or three).
  3. 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.
  4. Have a representative from each group describe their plan for the algorithm. (After the first group, subsequent groups could highlight similarities and differences.)
  5. 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.)
  6. 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: What are the advantages/disadvantages of using a program vs. actual dice? How quickly can the computer generate thousands of test cases? Can the computer be used to analyze the test cases as well as to generate the random numbers? 

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://www.math.ucsd.edu/~crypto/Monty/monty.html

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


Evidence of Learning

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.

Lesson Summary

Summary

This lesson introduces students to reading information from an input file and writing to an output file as a functionality of Python programming. The students will then apply these concepts to program a simple Dice Roll application to generate data. This lesson will prepare students to read and write files for use in later Data Acquisition lessons.

Outcomes

  • Students will learn how to read from an input data file and write to an output file using the Python programming language.
  • Students will be able to apply their new knowledge to writing independent programs.

Overview

Session 1

  1. Getting Started (10 min) - Journal on the possible advantages/disadvantages of being able to input/output data.
  2. Book activity (40 min) - Students are guided through the properties of file I/O using the "Python for Everybody" book.

Session 2 

  1. Python Lab (50 min) - Students write a program to roll 2 six-sided dice and one 12-sided die and write the output to a file. They then import it to Excel as a txt or csv file and compare distributions using countif. (This exercise may be assigned as homework if students have the computing resources to complete a programming assignment as homework.)

 

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts. [P2]
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]
Big Idea - Data
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.1 - Extract information from data to discover and explain connections or trends. [P1]
  • EU 3.3 - There are trade-offs when representing information as digital data.
    • LO 3.3.1 - Analyze how data representation, storage, security, and transmission of data involve computational manipulation of information. [P4]
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]
      • EK 4.1.1A - Sequencing, selection, and iteration are building blocks of algorithms.
      • EK 4.1.1B - Sequencing is the application of each step of an algorithm in the order in which the statements are given.
      • EK 4.1.1C - Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
      • EK 4.1.1D - Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
      • EK 4.1.1E - Algorithms can be combined to make new algorithms.
      • EK 4.1.1F - Using existing correct algorithms as building blocks for constructing a new algorithm helps ensure the new algorithm is correct.
      • EK 4.1.1H - Different algorithms can be developed to solve the same problem.
      • EK 4.1.1I - Developing a new algorithm to solve a problem can yield insight into the problem.
    • LO 4.1.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2B - Natural language and pseudocode describe algorithms so that humans can understand them.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
      • EK 4.1.2G - Every algorithm can be constructed using only sequencing, selection, and iteration.
      • EK 4.1.2I - Clarity and readability are important considerations when expressing an algorithm in a language.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
      • EK 5.1.1C - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may be developed with different standards or methods than programs developed for widespread distribution.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2A - An iterative process of program development helps in developing a correct program to solve problems.
      • EK 5.1.2B - Developing correct program components and then combining them helps in creating correct programs.
      • EK 5.1.2C - Incrementally adding tested program segments to correct working programs helps create large correct programs.
      • EK 5.1.2I - A programmer's knowledge and skill affects how a program is developed and how it is used to solve a problem.
      • EK 5.1.2J - A programmer designs, implements, tests, debugs, and maintains programs when solving problems.
  • EU 5.3 - Programming is facilitated by appropriate abstractions.
    • LO 5.3.1 - Use abstraction to manage complexity in programs. [P3]
      • EK 5.3.1A - Procedures are reusable programming abstractions.
      • EK 5.3.1B - A procedure is a named grouping of programming instructions.
      • EK 5.3.1C - Procedures reduce the complexity of writing and maintaining programs.
      • EK 5.3.1D - Procedures have names and may have parameters and return values.
      • EK 5.3.1G - Parameters provide different values as input to procedures when they are called in a program.
      • EK 5.3.1H - Data abstraction provides a means of separating behavior from implementation.
      • EK 5.3.1K - Lists and list operations, such as add, remove, and search, are common in many programs.
      • EK 5.3.1L - Using lists and procedures as abstractions in programming can result in programs that are easier to develop and maintain.
  • EU 5.4 - Programs are developed, maintained, and used by people for different purposes.
    • LO 5.4.1 - Evaluate the correctness of a program. [P4]
      • EK 5.4.1E - Locating and correcting errors in a program is called debugging the program.
      • EK 5.4.1F - Knowledge of what a program is supposed to do is required in order to find most program errors.
      • EK 5.4.1H - Visual displays (or different modalities) of program state can help in finding errors.
  • EU 5.5 - Programming uses mathematical and logical concepts.
    • LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming. [P1]
      • EK 5.5.1A - Numbers and numerical concepts are fundamental to programming.
      • EK 5.5.1D - Mathematical expressions using arithmetic operators are part of most programming languages.
      • EK 5.5.1E - Logical concepts and Boolean algebra are fundamental to programming.

Key Concepts

The students must understand how to open and read from an input file using Python.

The students must understand how to declare and write to an output file using Python.


Essential Questions

  • How can computation be employed to help people process data and information to gain insight and knowledge?
  • How do people develop and test computer programs?

Teacher Resources

Student computer usage for this lesson is: required

Python for Everybody by Charles Severance, http://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf.

Explanation of the CountIf function in Excel https://support.office.com/en-us/article/COUNTIF-function-e0de10c6-f885-4e71-abb4-1f464816df34.

The mbox.txt and mbox-short.txt files are in the Lesson Resources Folder.

 

Lesson Plan

Session 1

Getting Started (10 min)

Think-Pair-Share

  • List some pros and cons of inputting data for a program using only a keyboard.
  • List some pros and cons of displaying output of a program using only video display.

Have students review their journal entries as a class and note the advantages and disadvantages on a white board.

Guided Activity (40 min)

Before Starting The Activity:

  • Have the students open the book Python for Everybody by Charles Severance http://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf and navigate to Chapter 7 "Files" (page 79).
  • Students should also open PyCharm or the Runestone coding environment and create a new .py file. (Teachers may want to project PyCharm and the textbook on the board.)
  • The two files mbox.txt and mbox-short.txt are located in the Lesson Resources Folder. Students will need to have these saved in the same folder as their python file for the lesson.

Chapter 7: Files

The students should code the examples in the book as the teacher proceeds through the lessons.

  1. Section 7.1 Persistence
    1.  Emphasize the disadvantages of the loss of information when the computer is powered off and the frequent need to store data in a more permanent location.
    2. Introduce the concept of secondary memory.
  2. Section 7.2 Opening Files 
    1. After reading the brief text in Section 7.2, have students type the sample code to open the mbox.txt file and run it.
    2. Have students try to open another nonexistent file and see what kind of error they get.
    3. Check the student’s code for understanding:
      • Were the students able to open the mbox.txt file successfully?
      • Did the students get a “No such file or directory” error message when they attempted to open a nonexistent file?
  3. Section 7.3 Text Files and Lines
    1. Introduce the newline special character “end of line” which breaks the file into lines. In Python the newline is represented by “\n” in string constants.
    2. Have the students type in the sample code in 7.3 (page 81), which demonstrates the newline character’s function.
    3. Check the student’s code for understanding  
      • Did the “\n” cause the string to be displayed on two lines?
  4. Section 7.4 Reading Files
    1. Introduce the notion of reading each line in a file by using a while loop. (The students should already be familiar with for and while loops, but may need a quick review of the syntax.)
    2. Have students count the lines in the mbox.txt file by running the first sample code in 7.4 (page 82).
    3. Check the students’ code for understanding.
      • Does your code give the same output as in the book?
  5. Section 7.8 Writing Files
    1. Show the students how to open a file for writing by opening it with mode 'w' as a second parameter.
    2. After reading the brief text in Section 7.8, have students type the sample code to write to the output.txt file and run it. Remind them to use the newline character, “\n”, at the end of each line.
    3. Check the student’s code for understanding:
      • Were the students able to write to the output.txt file successfully?
      • Did the students remember to close their output file when finished? 

Session 2

Python Lab (50 min) 

Preparation:

Part 1:

  • Open the Python program(s) for rolling two six sided and one twelve-sided dice (students should have saved this from lesson 4-3).
  • Edit the code so it rolls the dice 1000 times and write the results of each roll to an output file named diceRolls.dat.

Part 2:

  • Import the diceRolls.dat file into your spreadsheet software (such as Excel) either as text or cvs file type.
  • Make use of the countif function to compare the distribution of the rolls for how many times each number 2 through 12 was rolled with the pair of six-sided dice to the distribution for the 12-sided die.
  • Show the comparison visually with an appropriate chart in your spreadsheet software.

 


Options for Differentiated Instruction

Have students work in pairs as the new concepts are introduced and practiced.

For a class needing more scaffolding: Work as a group. Have students take turns around the room to read aloud the brief text in each section in Chapter 7. Do the short exercises together with a "row captain" assigned to each row (or group) in the classroom who is in charge of checking that everybody in their row has completed each short task and has gotten the help needed to finish. Row captains help each other until the entire class has successfully completed each task. Report out on what challenges were encountered, recording problems and solutions at the front of the classroom as the class works. Rotate the role of row captain for each section.

For more independent students: Introduce/demonstrate the key ideas first and then allow student to work through Chapter 7 at their own pace.


Evidence of Learning

Formative Assessment

The teacher will check the student’s code for understanding.

The teacher will check for understanding as each new concept is introduced.

 


Summative Assessment

Exercise 7.1 Write a program to read through a file and print the contents of the file (line by line) all in upper case. Executing the program will look as follows:

python shout.py

Enter a file name: mbox-short.txt

FROM STEPHEN.MARQUARD@UCT.AC.ZA SAT JAN 5 09:14:16 2008

RETURN-PATH: <POSTMASTER@COLLAB.SAKAIPROJECT.ORG>

RECEIVED: FROM MURDER (MAIL.UMICH.EDU [141.211.14.90])

BY FRANKENSTEIN.MAIL.UMICH.EDU (CYRUS V2.3.8) WITH LMTPA;

SAT, 05 JAN 2008 09:14:16 -0500 

You can download the sample input file from https://www.py4e.com/code3/mbox-short.txt

Exercise 7.2 Write a program to prompt for a file name, and then read through the file and look for lines of the form:

X-DSPAM-Confidence: 0.8475

When you encounter a line that starts with “X-DSPAM-Confidence:” pull apart the line to extract the floating point number on the line. Count these lines and the compute the total of the spam confidence values from these lines. When you reach the end of the file, print out the average spam confidence.

Enter the file name: mbox.txt

Average spam confidence: 0.894128046745

Enter the file name: mbox-short.txt

Average spam confidence: 0.750718518519

 

Test your file on the mbox.txt and mbox-short.txt files. 

Lesson Summary

Pre-lesson Preparation

Your students will need computers for this lesson. If you would like to show students a working dartboard simulation (with a circular dartboard), check that your browser can run a Java plug-in. Be sure to update, activate, and disable the plug-in as needed for security purposes.

Summary

In this lesson, students will explore basic data analysis concepts in Python, learn about code extensibility, create a simple simulation from scratch, and reuse their code to make a more elaborate simulation.

Outcomes

  • Students will create a mathematical simulation and understand how programming can be used to model real-world processes.
  • Students will understand extensibility and code reuse by developing a simulation and modifying it to solve a more complex task.
  • Students will be able to reason about and solve a problem by programming a solution from scratch.
  • Students will collect and analyze data.

Overview

Session 1:

  1. Getting Started (5 min)
  2. Guided Activity (45 min)
  3. Optional Homework

Session 2:

  1. Getting Started (5 min)
  2. Guided Activity (45 min)
  3. Homework

Part of this lesson was adapted from http://www.nzmaths.co.nz/resource/dartboards and http://www.nzmaths.co.nz/resource/more-dartboards.

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.1 - Creative development can be an essential process for creating computational artifacts.
    • LO 1.1.1 - Apply a creative development process when creating computational artifacts. [P2]
      • EK 1.1.1B - Creating computational artifacts employs an iterative and often exploratory process to translate ideas into tangible form.
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem. [P2]
      • EK 1.2.2A - Computing tools and techniques can enhance the process of finding a solution to a problem.
      • EK 1.2.2B - A creative development process for creating computational artifacts can be used to solve problems when traditional or prescribed computing techniques are not effective.
    • LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts. [P2]
      • EK 1.2.3A - Creating computational artifacts can be done by combining and modifying existing artifacts or by creating new artifacts.
      • EK 1.2.3B - Computation facilitates the creation and modification of computational artifacts with enhanced detail and precision.
      • EK 1.2.3C - Combining or modifying existing artifacts can show personal expression of ideas.
    • LO 1.2.5 - Analyze the correctness, usability, functionality, and suitability of computational artifacts. [P4]
      • EK 1.2.5A - The context in which an artifact is used determines the correctness, usability, functionality, and suitability of the artifact.
      • EK 1.2.5B - A computational artifact may have weaknesses, mistakes, or errors depending on the type of artifact.
      • EK 1.2.5C - The functionality of a computational artifact may be related to how it is used or perceived.
      • EK 1.2.5D - The suitability (or appropriateness) of a computational artifact may be related to how it is used or perceived.
Big Idea - Abstraction
  • EU 2.1 - A variety of abstractions built on binary sequences can be used to represent all digital data.
    • LO 2.1.1 - Describe the variety of abstractions used to represent data. [P3]
      • EK 2.1.1A - Digital data is represented by abstractions at different levels.
  • 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]
      • EK 2.3.1A - Models and simulations are simplified representations of more complex objects or phenomena.
Big Idea - Data
  • EU 3.1 - People use computer programs to process information to gain insight and knowledge.
    • LO 3.1.1 - Find patterns and test hypotheses about digitally processed information to gain insight and knowledge. [P4]
      • EK 3.1.1A - Computers are used in an iterative and interactive way when processing digital information to gain insight and knowledge.
      • EK 3.1.1B - Digital information can be filtered and cleaned by using computers to process information.
      • EK 3.1.1D - Insight and knowledge can be obtained from translating and transforming digitally represented information.
      • EK 3.1.1E - Patterns can emerge when data is transformed using computational tools.
    • LO 3.1.3 - Explain the insight and knowledge gained from digitally processed data by using appropriate visualizations, notations, and precise language. [P5]
      • EK 3.1.3A - Visualization tools and software can communicate information about data.
      • EK 3.1.3C - Summaries of data analyzed computationally can be effective in communicating insight and knowledge gained from digitally represented information.
      • EK 3.1.3D - Transforming information can be effective in communicating knowledge gained from data.
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.1 - Extract information from data to discover and explain connections or trends. [P1]
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]
      • EK 4.1.1A - Sequencing, selection, and iteration are building blocks of algorithms.
      • EK 4.1.1B - Sequencing is the application of each step of an algorithm in the order in which the statements are given.
      • EK 4.1.1C - Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
      • EK 4.1.1D - Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
      • EK 4.1.1E - Algorithms can be combined to make new algorithms.
      • EK 4.1.1F - Using existing correct algorithms as building blocks for constructing a new algorithm helps ensure the new algorithm is correct.
      • EK 4.1.1G - Knowledge of standard algorithms can help in constructing new algorithms.
      • EK 4.1.1H - Different algorithms can be developed to solve the same problem.
      • EK 4.1.1I - Developing a new algorithm to solve a problem can yield insight into the problem.
    • LO 4.1.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
      • EK 4.1.2F - The language used to express an algorithm can affect characteristics such as clarity or readability but not whether an algorithmic solution exists.
      • EK 4.1.2G - Every algorithm can be constructed using only sequencing, selection, and iteration.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
      • EK 5.1.1D - Additional desired outcomes may be realized independently of the original purpose of the program.
      • EK 5.1.1E - A computer program or the results of running a program may be rapidly shared with a large number of users and can have widespread impact on individuals, organizations, and society.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2A - An iterative process of program development helps in developing a correct program to solve problems.
      • EK 5.1.2B - Developing correct program components and then combining them helps in creating correct programs.
      • EK 5.1.2C - Incrementally adding tested program segments to correct working programs helps create large correct programs.
  • EU 5.3 - Programming is facilitated by appropriate abstractions.
    • LO 5.3.1 - Use abstraction to manage complexity in programs. [P3]
      • EK 5.3.1A - Procedures are reusable programming abstractions.
      • EK 5.3.1B - A procedure is a named grouping of programming instructions.
      • EK 5.3.1C - Procedures reduce the complexity of writing and maintaining programs.
      • EK 5.3.1D - Procedures have names and may have parameters and return values.
      • EK 5.3.1G - Parameters provide different values as input to procedures when they are called in a program.
      • EK 5.3.1L - Using lists and procedures as abstractions in programming can result in programs that are easier to develop and maintain.
  • EU 5.4 - Programs are developed, maintained, and used by people for different purposes.
    • LO 5.4.1 - Evaluate the correctness of a program. [P4]
      • EK 5.4.1A - Program style can affect the determination of program correctness.
      • EK 5.4.1B - Duplicated code can make it harder to reason about a program.
      • EK 5.4.1C - Meaningful names for variables and procedures help people better understand programs.
      • EK 5.4.1D - Longer code segments are harder to reason about than shorter code segments in a program.
      • EK 5.4.1E - Locating and correcting errors in a program is called debugging the program.
      • EK 5.4.1F - Knowledge of what a program is supposed to do is required in order to find most program errors.
      • EK 5.4.1G - Examples of intended behavior on specific inputs help people understand what a program is supposed to do.
      • EK 5.4.1H - Visual displays (or different modalities) of program state can help in finding errors.
      • EK 5.4.1I - Programmers justify and explain a program’s correctness.
      • EK 5.4.1J - Justification can include a written explanation about how a program meets its specifications.
      • EK 5.4.1K - Correctness of a program depends on correctness of program components, including code segments and procedures.
      • EK 5.4.1L - An explanation of a program helps people understand the functionality and purpose of it.
      • EK 5.4.1M - The functionality of a program is often described by how a user interacts with it.
      • EK 5.4.1N - The functionality of a program is best described at a high level by what the program does, not at the lower level of how the program statements work to accomplish this.
  • EU 5.5 - Programming uses mathematical and logical concepts.
    • LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming. [P1]
      • EK 5.5.1A - Numbers and numerical concepts are fundamental to programming.
      • EK 5.5.1D - Mathematical expressions using arithmetic operators are part of most programming languages.
      • EK 5.5.1E - Logical concepts and Boolean algebra are fundamental to programming.

Key Concepts

The development of a program from scratch to solve a specific problem is presented to students by creating a simulation that lets them see how software can model a real-world process. Additionally, the concepts of extensibility and code reuse are shown through hands-on programming experience.


Essential Questions

  • How are algorithms implemented and executed on computers and computational devices?
  • How are programs used for creative expression, to satisfy personal curiosity or to create new knowledge?
  • How do computer programs implement algorithms?

Teacher Resources

Student computer usage for this lesson is: required

The Lesson Resources folder contains an example program showing how to use Python's random function to simulate tossing a coin, as well as a Dartboard.py solution. There is also a comparison between this python code, and some pseudocode that one may write before coding Dartboard.py, titled "Pseudocode vs Python."

An alternative lesson outline using Runestone and PyCharm to code a simulation and use it to develop, refine and test hypotheses in is the lesson folder. The lesson is in a file named "Monte Carlo Simulation to Calculate Pi.docx".

 

Lesson Plan

Session 1

Getting Started (5 min)

Think-Pair-Share: Writing programs "from scratch"

  • Ask your students to think about what it means to write a program "from scratch," how and why someone would do so.
  • Have your students pair off to share and list their ideas.
  • Collect and discuss their responses. Some topics to note could include: the importance of programming to solve a specific problem, the challenge of starting a program without copying someone else's code, and the value of learning to implement algorithms on one's own. The dartboard simulation used in this lesson provides a good example of a straightforward problem with a solution that someone can code on their own from scratch.

Guided Activity (45 min)

A Dartboard Simulation [10 min]

Get students' attention by asking them to play with the Dartboard Simulator (requires the Java browser plug-in) as they think about the following scenario and answer the related questions:

  • You have a circular dartboard consisting of three concentric circles. The largest outer circle has a radius of 3 units and is colored yellow. Inside that is the middle circle with a 2-unit radius, colored orange. In the center is a red circle, the bull's-eye, with a 1-unit radius. The final board looks like a red circle enclosed by an orange ring, enclosed by a larger yellow ring.
  • Now suppose you have a robot that throws darts randomly. How many darts would you expect to hit the bull's-eye if the robot throws 90 darts at your dartboard, assuming every dart hits the board? How many of those darts (on average) would hit the orange part of the board? How many would hit the yellow part?
  • To make the dartboard into a game, a certain number of points is awarded each time a dart hits a specific color. You want to assign score points to the dartboard fairly (for our random robot), such that the robot gets a score proportional to the chance it has of hitting a given color on the board. How many points should landing a dart on red be worth? On orange? On yellow?
  • Answers:
    • Recall that the formula for the area of a circle is A = pi*radius2. The red circle has an area of pi units. The orange ring has an area of 3*pi units (4*pi minus the area of the red circle). The yellow ring has an area of 5*pi units (9*pi minus 3*pi for orange and pi for red). The total area is 9*pi. Thus, on average, 50 of the darts would land on yellow, 30 of the darts would land on orange, and 10 darts would land on red.
    • For score assignment, since a single dart would hit yellow 5/9 of the time, orange 3/9 of the time, and red 1/9 of the time, we know that red is 5 times harder to hit than yellow and 3 times harder to hit than orange. Thus, a convenient assignment would be 15 points for red, 5 points for orange, and 3 points for yellow. With these score assignments, if the robot throws a dart it would score 5 points on average.

Devising a Dartboard Simulation [10 min]

Suppose you want to write a program that simulates tossing virtual darts. Each dart will land at a point on a square virtual dartboard that is one unit long on each side. Each point on this dartboard has both an x and a y coordinate, both of which are between 0 and 1. The bull's-eye is a square in the center of the dartboard with sides of length 0.5 units.

Have the program ask the user how many darts they want thrown. The program should then simulate throwing these darts by generating a random landing location (a random x and a random y coordinate) on the dartboard for each dart. Recall how to use Python's random functions (by reviewing the previous lessons' dice simulation). As darts are thrown, the program counts how many darts land within the center square, the bull's-eye. The bounds of bull's-eye are [0.25, 0.75] on both the x and y axes. Finally, the program should print out the number of darts thrown and the number that landed within that rectangle.

Have your students answer the following questions:

  1. Is the problem description clear enough that you could code this program on your own? If so, what information helps to make it clear? If not, what further explanations are needed?
  2. What are some variables you think your program will need, and what will you use them for?
  3. Are there any built-in Python functions that might be necessary or useful? If so, which ones?
  4. What other types of Python constructs are required for this program? Specifically, will you need an input assignment? A loop? An if statement? A print statement? What else?
  5. If you do need to use a loop, would it be better to use a while loop or a for loop in this program? Or will either work equally well? Why? If you think you can code the program without using a loop, explain why.
  6. Think back to the dice simulation you made. What are two or three ways in which your dartboard program will be similar to the dice simulation? What are two or three ways they will be different? 
  7. What percentage of darts thrown randomly at the dartboard will hit the bull's-eye? 

Programming the Simulation [25 min]

Take the rest of the class time to have your students begin programming their simulation. If they are not able to finish before the session ends, you may want to assign the program as homework, or devote the beginning of the second session to finishing the program. They will need their programs for the work in the next session.

You may want to remind students how to use Python's random function. The following code may be a useful example:

Example random coin flipping code (the python file is available in the Lesson Resources folder):

import random # Needed for random number generation

number_of_heads = 0

for i in range(0, 100):

x = random.random() # Generates a random floating point (decimal) number between 0 and 1

if x > 0.5:

number_of_heads = number_of_heads + 1

print "The number of heads in 100 coin flips is ", number_of_heads

Optional Homework

Have your students finish their dartboard programs, as they are needed in the next session. Alternatively, if they have finished their programs, you could assign the "Collecting and Analyzing Data" think-pair-share of the next session as a homework, to be discussed in the next session.

Session 2

Getting Started (5 min)

Journal: Making your programs extensible

  • Define "extensibility" for your students in the context of a program. Focus on the notion that we should plan for the future by keeping our code simple and organized logically. By doing so, we can more easily extend our code (add new features), reuse parts of our code in other programs, and more swiftly modify our program if the requirements change.
  • Have your students answer the following questions in their journals: "What are some reasons to make our programs extensible? What are some things that can go wrong if our code is not extensible?"

Guided Activity (45 min)

Collecting and Analyzing Data [10 min]

Think-pair-share: Collecting and analyzing data

  1. Ask your students to recall what percentage of darts randomly thrown will hit the bull's-eye.
  2. With the completed square dartboard program, have your students collect data by running their program entering increasing values for the number of darts to be thrown (1, 10, 100, 500, 1000, 5000, 10000, 50000, and so on), recording the output for each input (number of darts that hit the bull's-eye). For each pair of input and output, have them calculate the percentage that hit the bull's-eye (divide output by input, e.g., 12 hits / 50 thrown = 0.24, or 24% of the darts were hits).
  3. Have your students pair off and compare their data with that of their partner. Ask them to describe why the trends they observe in the data are there. Have them recall when they calculated the probability of the robot throwing darts at a circular dartboard.
  4. Gather your students and discuss as a class what can be observed from the data. Ideally, as you increase the sample size (number of darts thrown), you should be getting a more accurate measurement of how many darts hit the bull's-eye. As with the dart-throwing robot, the area of the center relative to the whole dartboard determines the percentage that hit. In this case, the center square has an area of 0.25 units2, and the rest of the dartboard has an area of 0.75 units2, so approximately 25% of the randomly thrown darts will hit the bull's-eye.
  5. Expand the discussion to consider whether or not this is a realistic or appropriate model for a real life situation. What factors would make it more realistic? (changing levels depending on the skill of the thrower?, using data from a real life dart game to determine precentages?, entering values for angle and force to determine the path of a dart?, have students brainstorm). Point out that the suitability of the simulation depends on how it will be used. 

Changing Requirements [30 min]

Discuss with your students how we often want to reuse our code for a new project, and how it is not uncommon when developing a program for the requirements to change. Both of these changes benefit from extensibility in code. Your students will get to test the extensibility of their dartboard program by reusing what they have to fit with a new objective: make a three-ringed circular dartboard. Point out that an iterative design process often starts with a simpler problem and then generalizes or extends that program to apply to other situations.

As before, this program should first ask a user how many darts they would like to throw. Then, it should use that input to simulate throwing darts at a circular dartboard. Finally, it should print the number of darts thrown, the number of darts that hit the bull's-eye, the number that hit the middle ring, the number that hit the outer ring, and the number that missed completely. This circular dartboard is similar to the one from the previous session's robot exercise: it has a central circular bull's-eye surrounded by a middle ring, which is in turn surrounded by an outer ring. The coordinates for this dartboard are: the center is at coordinate (0,0); the outermost ring is a circle with radius of 3; the middle has a radius of 2; and the bull's-eye has a radius of 1. Simulate throwing a dart by picking random x and y coordinates, each between -3 and 3. Since this range is a square, some darts may miss the dartboard completely. For this program, students may reuse as much of their square dartboard code as they need, but make sure to preserve their original program separately.

Homework

Have your students finish their circular dartboard programs and answer the following questions:

  1. How extensible was your square dartboard simulation? How much code were you able to reuse for your circular dartboard simulation, and what did you need to write from scratch?
  2. What are the major differences between the code in the programs and the way you approached coding them? Which did you find more difficult to program? Would it have been easier or faster to code the circular dartboard program from scratch?
  3. Collect data by running the circular dartboard program with various increasing inputs (1, 10, 100, 500, 1000, 5000, and so on) and record the output. For each input and corresponding output, calculate the percentage of darts that missed, that hit the outer ring, that hit the inner ring, and that hit the bull's-eye. What trends do you see in the data? How is the behavior similar and different to the square dartboard program?

Options for Differentiated Instruction

Note: graphics.py may be used with this lesson to create a visualization - http://mcsp.wartburg.edu/zelle/python/ppics2/code/graphics.py

Another Note: In order to run graphics.py, you may possibly need to save files in the same Python folder as the program being written due to student access and student space restrictions in your network, (i.e. if the link cannot point back to a network drive file due to restrictions).


Evidence of Learning

Formative Assessment

The students will produce two simulation programs on their own: the square dartboard simulation and the circular dartboard simulation.


Summative Assessment

The students will record their understanding of extensibility in their journal.

The students will gain experience collecting data in both sessions.

The students will think analytically about their programs by answering the questions in Session 1 and in the homework for Session 2.

Lesson Summary

Summary

This lesson teaches students to use simulations to develop, refine and test hypotheses. NetLogo, which is used throughout the lesson to illustrate the use of functional and data abstraction, is a programmable modeling environment for simulating natural and social phenomena. 

NetLogo is a variation of the Logo language instead of Python, so students are not expected to write new code in this lesson.  See http://www.ianbicking.org/docs/PyLogo_lightning.html for a comparison of Logo and Python. 

Outcomes

  • Students will understand that models are abstractions of real environments and will recognize the rationale for, and limitations of, modeling techniques to analyze problems.

  • Students will be able to compare abstractions in one programming language to another (Python vs NetLogo)
  • Students will recognize the use of functional and data abstractions in modeling.

  • Students will be able to develop and test hypotheses using an experimental approach in a modeling framework.

Overview

Session 1 - Modeling in NetLogo

  • Getting Started (8 min)
  • Learning NetLogo (40 min)
  • Wrap Up (2 min)

Session 2 - Models and Hypothesis Design

  • Getting Started (5 min)
  • Models and Hypotheses (20 min)
  • Model Selection and Hypothesis Development (25 min)

Session 3 - Hypothesis Testing

  • Getting Started (5 min)
  • Hypothesis Testing (40 min)
  • Wrap Up (5 min)

Note: This lesson introduces another programming tool and environment: NetLogo. Teachers may choose to complete only the first session (on the basics of NetLogo), to expose students to a new computational platform and way of thinking, to extend the ideas in Unit 4 about modeling and simulation.

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts. [P2]
      • EK 1.2.3A - Creating computational artifacts can be done by combining and modifying existing artifacts or by creating new artifacts.
      • EK 1.2.3C - Combining or modifying existing artifacts can show personal expression of ideas.
    • LO 1.2.4 - Collaborate in the creation of computational artifacts. [P6]
      • EK 1.2.4A - A collaboratively created computational artifact reflects effort by more than one person.
      • EK 1.2.4F - A collaboratively created computational artifact can reflect personal expressions of ideas.
  • EU 1.3 - Computing can extend traditional forms of human expression and experience.
    • LO 1.3.1 - Use computing tools and techniques for creative expression. [P2]
      • EK 1.3.1E - Computing enables creative exploration of both real and virtual phenomena.
Big Idea - Abstraction
  • EU 2.2 - Multiple levels of abstraction are used to write programs or create other computational artifacts.
    • LO 2.2.3 - Identify multiple levels of abstractions that are used when writing programs. [P3]
      • EK 2.2.3A - Different programming languages offer different levels of 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.1 - Find patterns and test hypotheses about digitally processed information to gain insight and knowledge. [P4]
    • LO 3.1.2 - Collaborate when processing information to gain insight and knowledge. [P6]
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.1 - Extract information from data to discover and explain connections or trends. [P1]
  • EU 3.3 - There are trade-offs when representing information as digital data.
    • LO 3.3.1 - Analyze how data representation, storage, security, and transmission of data involve computational manipulation of information. [P4]
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.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2B - Natural language and pseudocode describe algorithms so that humans can understand them.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
      • EK 4.1.2D - Different languages are better suited for expressing different algorithms.
      • EK 4.1.2E - Some programming languages are designed for specific domains and are better for expressing algorithms in those domains.
      • EK 4.1.2F - The language used to express an algorithm can affect characteristics such as clarity or readability but not whether an algorithmic solution exists.
      • EK 4.1.2G - Every algorithm can be constructed using only sequencing, selection, and iteration.
      • EK 4.1.2I - Clarity and readability are important considerations when expressing an algorithm in a language.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
      • EK 5.1.1C - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may be developed with different standards or methods than programs developed for widespread distribution.
      • EK 5.1.1D - Additional desired outcomes may be realized independently of the original purpose of the program.
      • EK 5.1.1F - Advances in computing have generated and increased creativity in other fields.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2E - Documentation about program components, such as code segments and procedures, helps in developing and maintaining programs.
      • EK 5.1.2F - Documentation helps in developing and maintaining programs when working individually or in collaborative programming environments.
    • LO 5.1.3 - Collaborate to develop a program. [P6]
      • EK 5.1.3A - Collaboration can decrease the size and complexity of tasks required of individual programmers.
      • EK 5.1.3B - Collaboration facilitates multiple perspectives in developing ideas for solving problems by programming.
      • EK 5.1.3F - Effective communication between participants is required for successful collaboration when developing programs.
  • EU 5.2 - People write programs to execute algorithms.
    • LO 5.2.1 - Explain how programs implement algorithms. [P3]
      • EK 5.2.1A - Algorithms are implemented using program instructions that are processed during program execution.
      • EK 5.2.1B - Program instructions are executed sequentially.
      • EK 5.2.1C - Program instructions may involve variables that are initialized and updated, read, and written.

Key Concepts

Students will understand that models are an abstraction of real environments and will recognize the rationale for and limitations of modeling techniques to analyze problems.

Students will recognize the use of functional and data abstractions in modeling.

Students will be able to develop and test hypotheses using an experimental approach in a modeling framework.


Essential Questions

  • How can computing extend traditional forms of human expression and experience?
  • How does abstraction help us in writing programs, creating computational artifacts and solving problems?
  • How can computational models and simulations help generate new understanding and knowledge?
  • How are algorithms implemented and executed on computers and computational devices?
  • Why are some languages better than others when used to implement algorithms?
  • How are programs developed to help people, organizations or society solve problems?
  • How are programs used for creative expression, to satisfy personal curiosity or to create new knowledge?
  • How do computer programs implement algorithms?
  • How does abstraction make the development of computer programs possible?
  • Which mathematical and logical concepts are fundamental to computer programming?

Teacher Resources

Student computer usage for this lesson is: required

NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL. NetLogo tutorial packet online web version http://ccl.northwestern.edu/netlogo/docs/ 

Modeling and Simulation 101 video ( https://www.youtube.com/watch?v=X-6zxImekOE )

See http://www.ianbicking.org/docs/PyLogo_lightning.html for a comparison of Logo, PyLogo and Python. 

New Mexico "Computer Science for All" bases the entire course on modeling and simulation using NetLogo http://www.cs4all.org/NM-CS108L-Week3-Final 

Lesson Plan

Session One

Getting Started (8 min)

Question: Describe something that can be modeled using a simulation.

Introduce modeling and simulation using the first four minutes of the Modeling and Simulation 101 video ( https://www.youtube.com/watch?v=X-6zxImekOE ).  Students open a document for notes for today's session.

Students should record and briefly discuss these four statements about modeling and simulation:

  1. Models describe real-world activities using abstration, enabling testing of hypotheses at a fraction of the cost of actual experiments.
  2. Models can be expressed in computational, mathematical, textual, and/or graphical forms.
  3. Simulations are forms or instances of models that can be implemented as computer programs.
  4. Monte Carlo simulations exploit randomness to arrive at their results.

 

Learning NetLogo (40 min)

To start, all students should download NetLogo from this link http://ccl.northwestern.edu/netlogo/ or use the web version of the program.

Students should work through the NetLogo tutorial packet either in groups or as a class.

In particular, students should be encouraged to notice commonalities in programming languages (sequence, conditionals, iteration, abstraction) and how differences in languages provide specific tools best suited to particular problems. The domain of modeling and simulation is a huge area in computational thinking, and NetLogo is one of many languages well suited to problem-solving in this domain. Point out that Python is used for modeling and simulation, but to be clear and readable requires the abstraction of libraries to build on that provide the same functionality that comes with a language like NetLogo.

There will be some "thought questions" throughout that students should discuss in their groups and as a class.

 

Wrap Up (2 min)

Students should complete an exit ticket listing one interesting idea they learned, or one question they have about NetLogo or modeling.

 

Session Two

Getting Started (5 min)

Review yesterday's NetLogo lesson and ask the students to share what they learned, how NetLogo is similar to or different from Python, and any questions they have about how it works. Point out that it is the ABSTRACTION available in NetLogo that makes it easier to read and write simulation programs because it has features built into it that are readily available that you can build on. This PowerPoint details the abstractions in NetLogo with the accompanying transcript from CS for All in New Mexico. List abstractions available in Python that are different from NetLogo or PyLogo. What is built into each language that makes it easy to use? 

Models and Hypotheses (20 min)

Introduction (12 min)

  • Students start NetLogo and open the Art>Fireworks model.
  • Students use the interface Buttons for Setup and Go to run the simulation.
  • Have students read the information in the Info tab, and look through the code in the Code tab, to get a sense of what is being simulated and how it works.
  • Explain that the model is the description of the environment, while the simulation is the specific implementation of the model.
  • Think -Pair- Share: Ask the students to identify which aspects of the real-world environment (actual fireworks) are implemented in the model, and which aspects are not implemented.
  • Discuss with the class the fact that the simpler characteristics of the model or abstraction make the implementation of the model much easier, at the expense of a possible failure to represent key relationships.
  • Have the students examine the implementation (Code tab) and find the names of the five functions defined in the code.  Show where all 5 are called (three in the code and two in the Interface).
  • Discuss these facts about forming a hypothesis
    • A hypothesis is an educated guess about how things work.
    • A hypothesis is written like this: "If _____[I do] _____, then _____[this will result]_____
  • Explore hypotheses that could be tested by this model.  (Some hypotheses are suggested by the discussion in the Info tab -- e.g., "If gravity is set to 0, then ______."
  •  Ask:
    • What are two things that we can change through the interface?
    • What do we think will happen we we make those changes?

Activity (8 min)

Ask each student to write a hypothesis that can be tested with this simulation, share the hypothesis with elbow partners, and briefly experiment with the parameters to informally test the hypothesis.

 

Model Selection and Hypothesis Development (25 min)

Note: The "Hypothesis Testing Worksheet" which will be used for the next two lessons is available in the Lesson Resources Folder

For the rest of today's session and Session 3, students will work in teams of four students to select a model to experiment with, then divide into two partner sets to develop a hypothesis, devise an experimental plan, test the hypothesis, and write about their results.

Directions

  1. First divide the class into teams of four students, and have them spend 10 minutes exploring different models in NetLogo (which they should already have some familiarity with from Session 1 and the earlier part of Session 2). They should choose one model to focus on and write the name of the model in the corresponding part of the Hypothesis Testing worksheet, along with a short explanation of why they chose the model.
  2. For the next 10 minutes, they should study the parameters of the model and how it works, trying things out in the interface to see how changing the parameters affects behavior.
  3. In the final 5 minutes of the class session, split the teams into partner groups and have each partner group begin to develop hypotheses about the team's selected model.  You may wish to assign them to write these hypotheses down as a homework assignment, either together or individually, using the Hypothesis Testing worksheet to record their hypothesis, why they selected that hypothesis, and the experimental parameters they will use to test the hypothesis.

Session Three

Warm Up (5 min)

Partners should revisit their hypotheses, and choose one hypothesis to focus on first.  (They can test both hypotheses if they have time.)  Each partner pair should write the name of their model and their selected hypothesis on the board, to share with the other students.

Experimental Design (10 min)

  1. Students should use the Hypothesis Testing worksheet to:
    1. Identify an experiment that will test their hypothesis.
    2. Select one or more parameters to vary.
    3. Choose what settings they will use for these parameters.
    4. Determine what measurements they will record.
    5. Decide how many trials they will run at each setting.  
    6. Note: Be sure that students have completed their experimental design before proceeding to perform the experiment -- many students will want to just jump in and start trying things, but one goal of the lesson is to help them understand that having a clear hypothesis and experimental design before collecting data is an important part of the scientific process.

Hypothesis Testing (30 min)

For the next twenty to thirty minutes, students should carry out their experiments and record the appropriate measurements.  

At the end of the section or for homework, students should write up their findings in a short report, showing the data they've collected (optionally in a graphical form, particularly if assigned as homework), discussing what the data says about their hypothesis, and concluding whether the hypothesis is supported or refuted by the simulation.

 

Wrap Up (5 min)

Students should come back into their teams to share their findings, and discuss the advantages and disadvantages of using models and simulations to develop and test hypotheses.

 


Evidence of Learning

Formative Assessment

Students will share and post their hypothesis before testing and sharing the results. Teachers will verify that the hypothesis are falsifiable and testable by the simulations.


Summative Assessment

Students will select a model, develop a hypothesis, design an experiment, and use a simulation to test the hypothesis.

Lesson Summary

Pre-Lesson Preparation: Students need to have already chosen a topic and had it approved by the instructor. Students can use the following sources to help choose a data set:

http://www.data.gov/ , http://data.princeton.edu/wws509/datasets , http://www.statsci.org/datasets.html

Summary:  

This lesson is the summative assessment for Unit 4 on Data Analysis.    Students will select a data set and write a small Python program to analyze the data.  Students will then write a summary of their findings to demonstrate understanding of the data analysis process.  

Outcomes:

  • This unit assessment is designed to provide more practice in project based-work to prepare students for the final performance project at the end of this class.

Overview:

  1. Getting Started (5 min) - Overview of task for the day.
  2. Independent Activity (40 min) - Individually or in pairs, students collect and analyze data on their topic.
  3. Wrap Up (5 min) - Overview of homework goals and expectations.
  4. Homework: Individual two-page summary about their findings.

Learning Objectives

CSP Objectives

Big Idea - Creativity
  • EU 1.1 - Creative development can be an essential process for creating computational artifacts.
    • LO 1.1.1 - Apply a creative development process when creating computational artifacts. [P2]
      • EK 1.1.1A - A creative process in the development of a computational artifact can include, but is not limited to, employing nontraditional, nonprescribed techniques; the use of novel combinations of artifacts, tools, and techniques; and the exploration of personal curiosities.
      • EK 1.1.1B - Creating computational artifacts employs an iterative and often exploratory process to translate ideas into tangible form.
  • EU 1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
    • LO 1.2.2 - Create a computational artifact using computing tools and techniques to solve a problem. [P2]
      • EK 1.2.2A - Computing tools and techniques can enhance the process of finding a solution to a problem.
    • LO 1.2.3 - Create a new computational artifact by combining or modifying existing artifacts. [P2]
      • EK 1.2.3A - Creating computational artifacts can be done by combining and modifying existing artifacts or by creating new artifacts.
Big Idea - Data
  • EU 3.1 - People use computer programs to process information to gain insight and knowledge.
    • LO 3.1.1 - Find patterns and test hypotheses about digitally processed information to gain insight and knowledge. [P4]
    • LO 3.1.2 - Collaborate when processing information to gain insight and knowledge. [P6]
  • EU 3.2 - Computing facilitates exploration and the discovery of connections in information.
    • LO 3.2.2 - . Determine how large data sets impact the use of computational processes to discover information and knowledge. [P3]
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]
      • EK 4.1.1A - Sequencing, selection, and iteration are building blocks of algorithms.
      • EK 4.1.1B - Sequencing is the application of each step of an algorithm in the order in which the statements are given.
      • EK 4.1.1C - Selection uses a Boolean condition to determine which of two parts of an algorithm is used.
      • EK 4.1.1D - Iteration is the repetition of part of an algorithm until a condition is met or for a specified number of times.
      • EK 4.1.1G - Knowledge of standard algorithms can help in constructing new algorithms.
      • EK 4.1.1H - Different algorithms can be developed to solve the same problem.
    • LO 4.1.2 - Express an algorithm in a language. [P5]
      • EK 4.1.2A - Languages for algorithms include natural language, pseudocode, and visual and textual programming languages.
      • EK 4.1.2B - Natural language and pseudocode describe algorithms so that humans can understand them.
      • EK 4.1.2C - Algorithms described in programming languages can be executed on a computer.
      • EK 4.1.2G - Every algorithm can be constructed using only sequencing, selection, and iteration.
Big Idea - Programming
  • EU 5.1 - Programs can be developed for creative expression, to satisfy personal curiosity, to create new knowledge, or to solve problems (to help people, organizations, or society).
    • LO 5.1.1 - Develop a program for creative expression, to satisfy personal curiosity, or to create new knowledge. [P2]
      • EK 5.1.1A - Programs are developed and used in a variety of ways by a wide range of people depending on the goals of the programmer.
      • EK 5.1.1B - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may have visual, audible, or tactile inputs and outputs.
      • EK 5.1.1C - Programs developed for creative expression, to satisfy personal curiosity, or to create new knowledge may be developed with different standards or methods than programs developed for widespread distribution.
      • EK 5.1.1D - Additional desired outcomes may be realized independently of the original purpose of the program.
      • EK 5.1.1E - A computer program or the results of running a program may be rapidly shared with a large number of users and can have widespread impact on individuals, organizations, and society.
    • LO 5.1.2 - Develop a correct program to solve problems. [P2]
      • EK 5.1.2A - An iterative process of program development helps in developing a correct program to solve problems.
      • EK 5.1.2B - Developing correct program components and then combining them helps in creating correct programs.
      • EK 5.1.2C - Incrementally adding tested program segments to correct working programs helps create large correct programs.
      • EK 5.1.2D - Program documentation helps programmers develop and maintain correct programs to efficiently solve problems.
      • EK 5.1.2E - Documentation about program components, such as code segments and procedures, helps in developing and maintaining programs.
      • EK 5.1.2G - Program development includes identifying programmer and user concerns that affect the solution to problems.
      • EK 5.1.2I - A programmer's knowledge and skill affects how a program is developed and how it is used to solve a problem.
      • EK 5.1.2J - A programmer designs, implements, tests, debugs, and maintains programs when solving problems.
  • EU 5.2 - People write programs to execute algorithms.
    • LO 5.2.1 - Explain how programs implement algorithms. [P3]
      • EK 5.2.1A - Algorithms are implemented using program instructions that are processed during program execution.
      • EK 5.2.1B - Program instructions are executed sequentially.
      • EK 5.2.1C - Program instructions may involve variables that are initialized and updated, read, and written.
      • EK 5.2.1D - An understanding of instruction processing and program execution is useful for programming.
      • EK 5.2.1G - A process may execute by itself or with other processes.
      • EK 5.2.1I - Executable programs increase the scale of problems that can be addressed.
      • EK 5.2.1J - Simple algorithms can solve a large set of problems when automated.
  • EU 5.5 - Programming uses mathematical and logical concepts.
    • LO 5.5.1 - Employ appropriate mathematical and logical concepts in programming. [P1]
      • EK 5.5.1A - Numbers and numerical concepts are fundamental to programming.
      • EK 5.5.1B - Integers may be constrained in the maximum and minimum values that can be represented in a program because of storage limitations.
      • EK 5.5.1D - Mathematical expressions using arithmetic operators are part of most programming languages.
      • EK 5.5.1E - Logical concepts and Boolean algebra are fundamental to programming.
      • EK 5.5.1F - Compound expressions using and, or, and not are part of most programming languages.
      • EK 5.5.1J - Basic operations on collections include adding elements, removing elements, iterating over all elements, and determining whether an element is in a collection.

Math Common Core Practice:

  • MP1: Make sense of problems and persevere in solving them.
  • MP2: Reason abstractly and quantitatively.
  • MP3: Construct viable arguments and critique the reasoning of others.
  • MP4: Model with mathematics.
  • MP5: Use appropriate tools strategically.
  • MP6: Attend to precision.
  • MP7: Look for and make use of structure.

Common Core Math:

  • S-ID.1-4: Summarize, represent, and interpret data on a single count or measurement variable
  • S-ID.5-6: Summarize, represent, and interpret data on two categorical and quantitative variables
  • S-ID.7-9: Interpret linear models
  • S-IC.3-6: Make inferences and justify conclusions from sample surveys, experiments and observational studies

Common Core ELA:

  • RST 12.3 - Precisely follow a complex multistep procedure
  • WHST 12.5 - Develop and strengthen writing as needed by planning, revising, editing, rewriting
  • WHST 12.6 - Use technology, including the Internet, to produce, publish, and update writing products
  • WHST 12.7 - Conduct short as well as more sustained research projects to answer a question

NGSS Practices:

  • 1. Asking questions (for science) and defining problems (for engineering)
  • 2. Developing and using models
  • 3. Planning and carrying out investigations
  • 4. Analyzing and interpreting data
  • 5. Using mathematics and computational thinking

Key Concepts

Students will demonstrate their understanding of the process of collecting and evaluating data.


Essential Questions

  • How can computation be employed to help people process data and information to gain insight and knowledge?
  • How can computation be employed to facilitate exploration and discovery when working with data?
  • What opportunities do large data sets provide for solving problems and creating knowledge?
  • How are algorithms implemented and executed on computers and computational devices?
  • How are algorithms evaluated?
  • How are programs developed to help people, organizations or society solve problems?
  • How are programs used for creative expression, to satisfy personal curiosity or to create new knowledge?
  • How do computer programs implement algorithms?
  • How do people develop and test computer programs?
  • Which mathematical and logical concepts are fundamental to computer programming?

Teacher Resources

Student computer usage for this lesson is: required

Rubric provided on Google Drive - Rubric - Unit 4 Summative Assessment.htm in the lesson folder.

Lesson Plan

Getting Started (5 min)

Verify that every student has selected a topic (approved by the instructor in advance) and address what the goal is for today.

Independent Activity (40 min)

Students will either individually or in pairs (instructor's decision) create a small program that reads data from a file, analyzes it, creates a simple simulation and finally writes data to a file.  

 

Wrap Up (5 min)

Presentation about the expectations of the homework assignments.

 

Homework

Each student should create a 2-page typed summary that explains the following areas:

  • The chosen data 
  • Why the data topic was chosen
  • The analysis process
  • The results of the analysis process
  • The coding process used for data analysis

 

 


Options for Differentiated Instruction

Instructor has the option to have students work individually or in pairs for this assessment. 


Evidence of Learning

Formative Assessment

Review Rubric with class and clarify expectations.


Summative Assessment

Students will be assigned a unit project, with a topic of their choice, to demonstrate their understanding and mastery of the concepts of data collection and analysis.