gambles in your life andre dabrowski mathematics and statistics

30
Gambles in Your Gambles in Your Life Life Andre Dabrowski Mathematics and Statistics

Upload: anissa-murphy

Post on 13-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Gambles in Your LifeGambles in Your Life

Andre Dabrowski

Mathematics and Statistics

Page 2: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Pick the Prize!

Page 3: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

One Chance in Three

Prob[Winner]

=#(winning choices) / #(all possible choices)

= / #( )

= 1/3

Page 4: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Prob[event]Prob[event]

Page 5: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Gambles in your Life• P[winner]

• =#(winning choices)/#(all choices)

• =1/#(all choices)

Page 6: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

“Lottery 216”1. Everyone has a sample ticket.

2. Every ticket has 3 numbers, each number chosen from {1,2,3,4,5,6}.E.G. 136 or 524 or 652, but not 744.

3. Is 222 more or less likely to win than 452?

4. What is your chance of winning?

Page 7: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Is 222 more or less likely to win than 452?

• Put one marker in the box for each ticket.

• Mix them up.

• Draw one out.

• All tickets have the same chance at winning!

• So 222 has the same chance as 452 of winning.

Page 8: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

What is your chance of winning?

• P[winner]=1/#(all possible choices)• #(all possible choices)• = #(choices for first digit)

X #(choices for second digit) X #(choices for third digit)

• = 6 X 6 X 6 = 216• P[winner]=1/216.

Page 9: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Lotto 6/49

• P[win by matching all 6 numbers]• =1/#(all possible choices)

• #(all possible choices)• = 49 x 48 x 47 x 46 x 45 x 44 / 720• 1 in 13,983,816 chances!

Page 10: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Which is more likely?

• Matching all 6 numbers in a 6/49 lottery

• Being struck by lightning sometime during the year.

1/ 13,983,816 About 1/ 1,000,000

Page 11: Gambles in Your Life Andre Dabrowski Mathematics and Statistics
Page 12: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

UO Xmas Lottery!1. Everyone has a ticket.

2. We will draw from a box to choose the winner.

3. P[winning]=1/216.

Page 13: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Now that we know HOW to calculate

probabilities, we can look for interesting ones to compute.

Page 14: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

The Birthday Problem

• There are 365 days in the year.

• The chance that any one person shares your birthday is 1/365. Pretty small!

• What is the chance at least two people in this room share birthdays?

Page 15: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

P[no matching birthdays]

• P[no match for 2 people]

• =

• = 365 X 364 / 365 X 365 = 364/365.

#(ways of choosing 2 without matching)

#(ways of choosing 2 birthdays)

Page 16: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

• P[no match in 5 people]=

365 X 364 X 363 X 362 X 361

365 X 365 X 365 X 365 X 365

= .97 approximately

=

#(ways of choosing 5 without matching)

#(ways of choosing 5 birthdays)=

Page 17: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

• P[no match in 25 people]=

#(ways of choosing 25 without matching)

#(ways of choosing 25 birthdays)=

365 X 364 X … X 342 X 341

365 X 365 X … X 365 X 365=

= 0.43 approximately

There is about a 57% chance a class of 25 will have at least two sharing a birthday.

Page 18: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

• P[birthday match in k people]

Page 19: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Gambles in your Life• Small probabilities can become large if we do many simultaneous experiments.

• Coincidences are not really coincidences in large groups. Yell “Hey Pete” in a crowd and someone will answer!

• How reliable are complex systems? A system can survive one component failing, but what is the chance two fail at once?

Page 20: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

UO Xmas Birthday Giveaway!

First two birthdays to match win!

Page 21: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

We know

• How to compute probabilities for simple games

•How do we compute probabilities for more complicated problems?

Page 22: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Simple --8 Heads in a Row

in 8 tosses• Chance of 8 heads in a row

• = ½ ½ … ½ ½ ½

• =1/256

• Pretty small!

Page 23: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Harder -- 8 Heads in a Row somewhere in 100 tosses

• Toss a fair coin 100 times.• What is the chance of at least 8 heads

in a row somewhere in the string of 100?

• HHTHTTHTTTHTHHTHTHTH TTTHTHTHTHHTHHHHHHHH TTHHHTHTHTHHHTTHTHTH HHTHTHHTHTHTTTHTTTTHT THTTHTHTHHHTHTHTHTHTT

Page 24: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Monte Carlo Methods• “Toss” a coin 100 times• Find the longest string of H’s• Repeat this 100,000 times

--- 10,000,000 tosses!• P[at least 8 H’s in a row] is

approximately • #( at least 8 H’s in a row)/100,000

Page 25: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Monte Carlo Methods• “Toss” a coin 100 times

using a computer• Find the longest string of H’s

Repeat this 100,000 times --- 10,000,000 tosses!using a computer

• P[at least 8 H’s in a row] is approximately#(at least 8 H’s in a row)/100,000

Page 26: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Monte Carlo Methods• libname here 'h:/XmasLecture';• libname there 'c:/tmp';• %macro dupit;• %do ii=1 %to 100;• x_&ii=(ranuni(0)<.5);• %end;• %mend;

• data there.runs;• do i=1 to 100000 by 1;• output;• end;• data there.runs; set there.runs;• %dupit;• run;• %macro runs;• %do ii=2 %to 100;• %let iii=%eval(&ii-1);• a=0+run_&iii;• b=0+x_&ii;• run_&ii=a*(a>0)*(b=1)+(b=1);• runmax=max(runmax,run_&ii);• %end;• %mend;

•data there.runs; set there.runs;•run_1=0+(x_1=1);•runmax=0;•%runs;

•data here.runs; set there.runs;•keep runmax;•run;

•data there.runs; run;•proc gchart data=here.runs;•axis1 value=(height=10);•vbar runmax / midpoints = 1 to 15 by 1 type=percent caxis=axis1;•run;

•proc freq data=here.runs;•table runmax / nofreq nocumulative;•run;•quit;

Page 27: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

100,000 Simulations

Page 28: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

The FREQ Procedure

runmax Frequency Percent

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

2 23 0.02

3 2709 2.71

4 16421 16.42

5 26184 26.18

6 23039 23.04

7 14645 14.65

>7 16979 16.98

All 100000 100.00

P[run of 8 H or more]

= .17 approx.,

= 1/6 >> 1/256.

The chance of 4 or more heads in a row is about 97%.

We can use this to pick out which sequences on the sheet are unlikely to really have been generated at random.

Page 29: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Gambles in your Life• “good” days and “bad” days.

• Long lineups for no reason.

• Design of bridges, power plants.

• Weather prediction.

• Biological evolution.

Page 30: Gambles in Your Life Andre Dabrowski Mathematics and Statistics

Thanks for coming!