Intro CS – Probability and Random Numbers Lesson Plan 6a.

Slides:



Advertisements
Similar presentations
6.1 Simulation Probability is the branch of math that describes the pattern of chance outcomes It is an idealization based on imagining what would happen.
Advertisements

Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Probability What are your Chances?
Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
Describing Probability
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
AP Statistics Section 6.2 A Probability Models
Lesson  In this investigation you will explore the predictability of random outcomes. You will use a familiar random process, the flip of a coin.
Aim #10-7: How do we compute probability? Empirical probability applies to situations in which we observe how frequently an event occurs.
Binomial & Geometric Random Variables
 The Law of Large Numbers – Read the preface to Chapter 7 on page 388 and be prepared to summarize the Law of Large Numbers.
1 Lesson Probability of an Event Not Happening Probability of an Event Not Happening.
Chapter 11: understanding randomness (Simulations)
Probability Part 1 – Fundamental and Factorial Counting Rules.
Copyright © 2010 Pearson Education, Inc. Unit 3: Gathering Data Chapter 11 Understanding Randomness.
Chapter 6 Probability PowerPoint Lecture Slides Essentials of Statistics for the Behavioral Sciences Eighth Edition by Frederick J. Gravetter and Larry.
In this chapter we introduce the idea of what it means for something to be truly random. We also investigate techniques for simulating randomness.
Introduction to Probability
Chapter 11 – Understanding Randomness 1. What is a random event? Nobody can guess the outcome before it happens. Let’s try an experiment. On the next page.
Notes on PROBABILITY What is Probability? Probability is a number from 0 to 1 that tells you how likely something is to happen. Probability can be either.
Warm-up Grab a die and roll it 10 times and record how many times you roll a 5. Repeat this 7 times and record results. This time roll the die until you.
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Learning the skills for programming Advanced Visual Programming.
Randomness Has structure in the long run Randomness seems “Fair” 1) Nobody can predict the outcome ahead of time. 2) Some underlying set of outcomes are.
P. STATISTICS LESSON 8.2 ( DAY 1 )
14.3 Simulation Techniques and the Monte Carlo Method simulation technique A simulation technique uses a probability experiment to mimic a real-life situation.
Introduction to Probability © Christine Crisp “Teach A Level Maths” Statistics 1.
1.3 Simulations and Experimental Probability (Textbook Section 4.1)
AP STATISTICS Objective: Understanding Randomness Do Now: Take out any completed contracts, personal profiles, as well as your written design study. HW:
Loops Wrap Up 10/21/13. Topics *Sentinel Loops *Nested Loops *Random Numbers.
Slide Understanding Randomness.  What is it about chance outcomes being random that makes random selection seem fair? Two things:  Nobody can.
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
POSC 202A: Lecture 4 Probability. We begin with the basics of probability and then move on to expected value. Understanding probability is important because.
Lesson 17 – Do Now Do now Expectations: No talking for any reason, please. 1)Find the solution: 2) Find the GCF of 36 and 42 3) Solve for the indicated.
4.3a Simulating Experiments Target Goal: I can use simulation to represent an experiment. In class FR.
Intro CS – Screens and Variables Lesson Plan 9. Goals  Using sprites as full screens (Start screen, Game over)  Using layering to control ordering of.
Chapter 12 Section 1 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
Copyright © 2009 Pearson Education, Inc. Chapter 12 Section 2 - Slide 1 P-2 Probability Theoretical Probability.
Have you ever played a game where everyone should have an equal chance of winning, but one person seems to have all the luck? Did it make you wonder if.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
5-Minute Check on Chapter 5 Click the mouse button or press the Space Bar to display the answers. 1.What can help detect “cause-and-effect” relationships?
Chance We will base on the frequency theory to study chances (or probability).
Probability What are your Chances? Warm Up Write each fraction in simplest form
Intro CS – Costumes and Variables Lesson Plan 6. Goals  Understanding Costumes, Ordering, Naming  Switching Costumes with Switch and Next  Using Variables.
Statistics 11 Understanding Randomness. Example If you had a coin from someone, that they said ended up heads more often than tails, how would you test.
Extension: How could researchers use a more powerful measure of analysis? Why do you think that researchers do not just rely on descriptive statistics.
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Intro CS – Broadcasting Messages Lesson Plan 8. Goals  Using broadcasting to track events across sprites and act on them.
Chapter 8 Probability Section 1 Sample Spaces, Events, and Probability.
Intro CS – Logic & Operators Lesson Plan 5. Goals  Students can explain basic logical operators  AND, OR, NOT  Students can create truth tables for.
1 Copyright © 2014, 2012, 2009 Pearson Education, Inc. Chapter 9 Understanding Randomness.
AP STATISTICS LESSON AP STATISTICS LESSON PROBABILITY MODELS.
Intro CS – Loops, making animations & films Lesson Plan 3.
Objective of the lesson Use Blockly to make a dice for Snakes and Ladders All of you will: – Make an image which displays when you press a button Most.
Lesson 6 – 2a Probability Models. Knowledge Objectives Explain what is meant by random phenomenon. Explain what it means to say that the idea of probability.
Intro CS – Keyboard and mouse input Lesson Plan 7.
Intro CS – Costumes and Variables
Intro CS – Screens and Variables
Intro CS – Loops, making animations & films
Intro CS – Probability and Random Numbers
Intro CS – Keyboard and mouse input
Determining the theoretical probability of an event
Probability What are your Chances?
Module 5 Lesson 3 Extreme Scratch Cards
Click the mouse button or press the Space Bar to display the answers.
And and or…and RANDOMNESS
Primary School Computing
Presentation transcript:

Intro CS – Probability and Random Numbers Lesson Plan 6a

Goals  Students can explain random numbers and how computers can generate them  Students can generate random numbers  Students can use the computer to simulate random number experiments to observe probability statistics  Students can predict probability statistics for a given problem  Students can express probability as ratios, decimals, and percentages  Students can write code to generate probability statistics as ratios, decimals, and percentages

Objectives  Students are introduced to random number generation by computers and how they can be used to simulate chance  Students are given real probability problems to code and solve  Results are demonstrated through predications, demos of running code, and displayed results

Pre Requisites  Knowledge of IF blocks, Loops (to simulate mutiple trials), variables (to capture results)  Basic Understanding of BYOB

Materials  Slides with examples (or present on whiteboard)  PCs with Chrome browser to access Snap web site

Lesson Description  Students learn about random number generation in computers, and how it can be used simulate probability experiments  Students practice and extend examples  Students solve probability problems using code and the computer  Students analyze their and others’ solutions, and collaborate towards shared solutions

Lesson Procedure  Warm-up: Define/research what probability is, with an example. Research an example of how random numbers are used with computers to simulate chance  Quick review of IF block, Variables, and Loops  Introduce PICK RANDOM through student investigation and observation of sample work  Give exercises for in class practice  Walk the room answering questions, looking over the shoulder, asking questions, etc.  Check off solutions for completeness and accuracy  Review

Closure/Conclusion  Summary  Random numbers are a powerful way to simulate real world problems and introduce random behaviors into normally predictable code  Future thinking: Discuss Monte Carlo simulations as they relate to Finance, Airplane Boarding Optimization, Sporting Event Results  Ask questions on what is confusing or needs more time/practice

Random Numbers Lesson 5

Warm-up 0 Research/define probability, with a real-life example 0 Research another example of how computers are used to simulate chance

Review: IF blocks  What are IF Blocks?  IF blocks are used to help make decisions and branch your code.  When the IF Block statement is true, whatever is contained inside the decision block is done  Other blocks that use logic: IF/ELSE, Repeat Until, Wait Until

Review: Variables 0 Variables are places we can store results/values 0 Variables can be changed any time 0 Variables can be incremented by one to count things

Review: Loops 0 Used to repeat things a few to many, many times 0 Can repeat: 0 Forever (FOREVER block) 0 A specific number of times (REPEAT 10 block) 0 Until a test is True (REPEAT UNTIL block)

Generating Random Numbers 0 Usually, computers are very predictable will also equal 8 for a computer 0 Spell checking, etc. 0 Sometimes we want computers to simulate life by being less predictable 0 We can use Random Numbers to: 0 Simulate chance (rolling dice, unpredictable events, etc.) 0 Track results in variables 0 Run thousands/millions of simulations very fast 0 We use the Pick Random block (on the green tab)

Investigation 0 Pair up. If you get stuck, ask another pair. 0 Simulate the following by having a sprite Say: 0 the result of rolling one six-sided die 0 the result of rolling two, three, four, or five six-sided dice 0 the result of rolling one ten-sided die 0 the result of picking a random card from a deck 0 sprite must say "Ace of Clubs", "6 of Hearts", etc. 0 Hint: use Join block on green tab to put words/numbers together, and IF blocks

When to use Pick random 0 When you want to simulate chance: 0 50/ /1 0 When you want to wait a random amount of time 0 Wait (pick random 6 to 10) 0 When you want to pick a random thing from a list of things 0 Picking a word in Hangman (future project in class) 0 When you want to make game behavior unpredictable 0 Sometimes go left, sometimes right, etc.

Coding problem 0 Write the following programs: 0 Computer rolls 2 dice, calculate the probability of each roll (2-12) 0 Use the computer to roll 5 dice to play Yahtzee 0 Roll dice, pick all/some/none to keep, repeat 3 times 0 Mark (on paper, write code), to track which scores to take after 3 roles 0 Repeat until can't play, or all categories filled

Review 0 You’ve just learned the basics of random numbers and using computers to measure probability 0 Simulate chance 0 Experiment to calculate results 0 Future thinking: Monte Carlo calculations 0 Finance: predict retirement outcomes 0 Sports: predict team scores 0 Airplane boarding optimization: predict and test models