Chapter 11 Randomness - Washington University in St. Louis

Download Report

Transcript Chapter 11 Randomness - Washington University in St. Louis

Chapter 11 Randomness
math2200
Randomness
►
Random outcomes
 Tossing coins
 Rolling dice
 Spinning spinners
►
If they are fair
 Nobody can guess the
outcome before it happens
 Usually some underlying set
of outcomes will be equally
likely
1234
Result
Number
Percentage
1
About 5%
2 or 4
About 20%
3
About 75%
It is not easy to be random!
It’s Not Easy Being Random
► Using
computers have become a popular
way to generate random numbers.
 Computers do better jobs than humans, but still
do not generate truly random numbers either.
 Since computers follow programs, the “random”
numbers we get from computers are really
pseudorandom.
 Pseudorandom values are random enough for
most purposes.
Example
►A
cereal manufacturer puts pictures of
famous athletes on cards in boxes of cereal
in the hope of boosting sales
 20% of the boxes contain a picture of Tiger
woods
 30% Lance Armstrong
 50% Serena Williams
20%
30%
50%
How many boxes do we expect to
buy to get a set?
► If
you are lucky, three boxes
► If you are very unlucky, infinitely many
► But on average, how many?
 Go ahead and buy, then count (too costly)
 A cheaper solution
►Use
a random model
►Assume the pictures are randomly placed in the
boxes and the boxes are randomly distributed to
stores.
Practical Randomness
► We
need an imitation of a real process so
we can manipulate and control it.
► In short, we are going to simulate reality.
Then what?
► Use
the model to generate random values
 Simulate the outcomes to see what happens
► We
call each time we obtain a simulated
answer to our question a trial
► How do we generate the outcomes at
random?
Random numbers
► How
to generate random numbers?
 Computer software
►Pseudorandom
numbers
 Computers follow programs!
 The sequence of pseudorandom numbers eventually repeat
itself
 But virtually indistinguishable from truly random numbers
 Books of random numbers
►Not
an interesting book, perhaps 
How do we get random integers in
TI-83?
► MATH
PRB
► 5:randInt(
► randInt(left,right, #)
 This allows repetition of the same integer
 randInt (0,9,100) produces 100 random digits
 randInt (0,57,3) produces three random
integers between 0 and 57
Back to cereal boxes
► How




to model the outcome?
20%, Woods (0,1)
30% Armstrong (2,3,4)
50% Williams (5,6,7,8,9)
0 to 9 are equally likely to occur
► How
to simulate a trial?
 Open cereal boxes till we have one of each picture
 Opening one box is the basic building block, called a
component of our simulation.
 For example, ‘29240’ corresponds to the following
outcomes: Armstrong, Williams, Armstrong, Armstrong,
Woods
Cereal (continue)
►
Response variable
 What we are interested in
► How many boxes it takes to get
► Length of the trial
► ‘29240’ corresponds to 5 boxes
►
Run more trials





►
all three pictures
89064: 5 boxes
2730: 4 boxes
8645681: 7 boxes
41219: 5 boxes
822665388587328580: 18 boxes
How many boxes do we expect to buy?
 Take an average
 Based on the first 5 trials: the average is 7.8 boxes
 To get an objective estimate: run infinitely many trials
Cautions
► Simulation
because
is different from the reality
 Model may not be 100% precise
 Only limited number of trials
► Run
enough trials before you draw
conclusions
Simulation Steps
1.
2.
3.
4.
5.
6.
7.
Identify the component to be repeated. open a box
Explain how you will model the component’s outcome.
Model 20% 30% 50% using integers 0-9
State clearly what the response variable is.# of boxes
opened until we get a set.
Explain how to combine the components into a trial to
model the response variable. Open boxes until we get a
set.
Run many trials.
Collect and summarize the results of all the trials.
Average number of boxes opened.
State your conclusion.
Lottery for a dorm room
► 57
students participated in a lottery for a
particularly desirable dorm room
 A triple with a fireplace and private bath in the
tower
 20 participants were members of the same
varsity team
 When all three winners were members of the
team, the other students cried foul
Is it really a foul?
►
►
Whether an all-team outcome could reasonably be
expected to happen if every one is equally likely to be
selected?
Simulation
 Component: selection of a student
 Model: 00-56 one number for one student
► 00-19:
20 varsity applicants
► 20-56: the other 37 applicants
 Trial: randomly select three numbers from 00-56 with or without
replacement?
 Response variable: ‘all varsity’ or not
►
Draw conclusions by counting how often ‘all varsity’
occurs
 The textbook gives 10% based on 10 trials.
 3.896% if run a huge number of trials.
What Can Go Wrong?
► Don’t
overstate your case.
 Beware of confusing what really happens with
what a simulation suggests might happen.
► Model
outcome chances accurately.
 A common mistake in constructing a simulation
is to adopt a strategy that may appear to
produce the right kind of results.
► Run
enough trials.
 Simulation is cheap and fairly easy to do.