Top Banner
Lectures prepared by: Elchanan Mossel Yelena Shvets Introduction to probability Stat 134 FAll 2005 Berkeley Follows Jim Pitman’s book: Probability Section 2.1
37

Lectures prepared by: Elchanan Mossel Yelena Shvets

Jan 13, 2016

Download

Documents

dyre

Lectures prepared by: Elchanan Mossel Yelena Shvets. Binomial Distribution. Toss a coin 100, what’s the chance of 60 ?. hidden assumptions: n-independence; probabilities are fixed. ={ }. Magic Hat:. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lectures prepared by: Elchanan Mossel Yelena Shvets

Lectures prepared by:Elchanan MosselYelena Shvets

Introduction to probability

Stat 134 FAll 2005

Berkeley

Follows Jim Pitman’s book:

ProbabilitySection 2.1

Page 2: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionToss a coin 100, what’s the chance of 60 ?

hidden assumptions: n-independence; probabilities are fixed.

100

(a sequence with 60 ) = (# of sequences with 60 )*P(particular sequence with 60 )=

1 (# of sequences with 60 )*

2

P

Page 3: Lectures prepared by: Elchanan Mossel Yelena Shvets

Magic Hat:

Each time we pull an item out of the hat it magically reappears. What’s the chance of drawing 3 I-pods in 10 trials?

={ }

23

13

23

23

23

13

13

23

23

23

3 71 2P(3 in 10 draws) = (# of sequences with 3 )

3 3( () )

Page 4: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

56

k=0

565656

625*1 =

1296

Page 5: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

56

k=1

56

5616

500*4 =

1296

Page 6: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

56

k=2

16

1656

150*6 =

1296

Page 7: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

56

k=3

161616

20*4 =

1296

Page 8: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

16

k=4

16

16

16

1*1 =

1296

Page 9: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionSuppose we roll a die 4 times. What’s the chance of k ? Let .

={ }

56

56

56

56

16

k=0

k=1

k=2

k=3

k=4

56

56

56

625*1 =

1296

56

56

16

500*4 =

1296

16

16

56

150*6 =

1296

16

16

16

20*4 =

1296

16

16

16

1*1 =

1296

Page 10: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionHow do we count the number of sequences of length 4 with 3 . and 1 .?

.1

1.

..1 .2. 1..

...1 ..3. .3.. 1...

....1 ...4. ..6.. .4... 1....

Page 11: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution

This is the Pascal’s triangle, which gives, as you may recall the binomial coefficients.

Page 12: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution1a

1b

1a2 2ab 1b2

1a3 3a2

b3ab

2 1b3

1a4 4a3

b6a2b2 4ab3 1b4

(a + b) =

(a + b)2 =

(a + b)3 =

(a + b)4 =

Page 13: Lectures prepared by: Elchanan Mossel Yelena Shvets

Newton’s Binomial Theorem

nn k (n-k)

k=0

( + ) =

n! =

k

a a

- !

b

k

b

! n

n

k

n

k

Page 14: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution

For n independent trials each with probability p of success and (1-p) of failure we have

k (n-k)(#successes=k) = p (1-p)n

Pk

This defines the binomial(n,p) distribution over the set of n+1 integers {0,1,…,n}.

Page 15: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution

This represents the chance that in n draws there was some number of successes between zero and n.

nk (n-k) n

k=0

n1= p (1-p) =(p + (1-p))

k

Page 16: Lectures prepared by: Elchanan Mossel Yelena Shvets

Example: A pair of coinsA pair of coins will be tossed 5 times.Find the probability of getting on k of the tosses, k = 0 to 5.

1P

4;

3

P4

;

binomial(5,1/4)

Page 17: Lectures prepared by: Elchanan Mossel Yelena Shvets

Example: A pair of coinsA pair of coins will be tossed 5 times.Find the probability of getting on k of the tosses, k = 0 to 5.

55 1 3P

4 4

k k

k

# =k

To fill out the distribution table we could compute 6 quantities for k = 0,1,…5 separately, or use a trick.

Page 18: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:consecutive odds ratioConsecutive odds ratio relates

P(k) and P(k-1).

k+1 n- -1

-

k

k n k

p qP( ) n! n! =

P( -1) ! n- ! -1 ! n- +1 ! p q

pn- +1

kk k k k k

k

qk=

/

Page 19: Lectures prepared by: Elchanan Mossel Yelena Shvets

543210k

P( )P(

kk-1)

P(k)

Example: A pair of coinsUse consecutive odds ratio

to quickly fill out the distribution table

pP( ) n- +1k kk k

= P( -1) q

for binomial(5,1/4):

5 113

4 12 3

3 13 3

2 14 3

1 15 3

534

.2375 1

P(0)13

.3404 1

P(1)2 3

.2643 1

P(2)3 3

.08792 1

P(3)4 3

.01461 1

P(4)5 3

.000977

Page 20: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial DistributionWe can use this table to find the following conditional probability:

P(at least 3 | at least 1 in first 2 tosses)

= P(3 or more & 1 or 2 in first 2 tosses)

P(1 or 2 in first 2)

Page 21: Lectures prepared by: Elchanan Mossel Yelena Shvets

543210k

P( )P(

kk-1)

P(k)

bin(5,1/4):

5 113

4 12 3

3 13 3

2 14 3

1 15 3

.237 .340 .264 .0879 .0146 .000977

10k

P( )P(

kk-1)

P(k)

2 113

234

.5635 1

P(0)13

.375

2

1 12 3

4 1P(1)

2 3

bin(2,1/4):

.0625

Page 22: Lectures prepared by: Elchanan Mossel Yelena Shvets

Stirling’s formulaHow useful is the binomial formula? Try using your calculators to compute P(500 H in 1000 coin tosses) directly:

Your calculator may return error when computing 1000!. This number is just too big to be stored.

Page 23: Lectures prepared by: Elchanan Mossel Yelena Shvets

The following is calledthe Stirling’s approximation.

nnn! 2 n ( )

e

It is not very useful if applied directly : nn is a very big number if n is 1000.

Page 24: Lectures prepared by: Elchanan Mossel Yelena Shvets

Stirling’s formula: nnn! 2 n ( )

e

1000

500 in 10001000! 1

P( ) = 500!500!2

10001000

500 in 1000500 500

1000( )1 1000 1eP( )

500 500500*500 22 ( ) ( )e e

1000500 in 1000

1 2 1000P( ) ( )

500 2*5002

500 in 10001

P( ) 500

500 in 1000P( ) .0252313252

Page 25: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution

Toss coin 1000 times;

P(500 in 1000|250 in first 500)=

P(500 in 1000 & 250 in first 500)/P(250 in first 500)=

P(250 in first 500 & 250 in second 500)/P(250 in first 500)=

P(250 in first 500) P(250 in second 500)/ P(250 in first 500)=

P(250 in second 500)=500500! 1 1

= = 0 356824823250!250!2 250

.

Page 26: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution: Mean

Question: For a fair coin with p = ½,

what do we expect in 100 tosses?

Page 27: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mean

Recall the frequency interpretation:

p ¼ #H/#Trials

So we expect about 50 H !

Page 28: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mean

Expected value or Mean

of a binomial(n,p) distribution

= #Trials £ P(success)

= n p slip !!

Page 29: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution: Mode

Question:

What is the most likely number of successes?

Mean seems a good guess.

Page 30: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode

Recall that

50 in 1001

P( ) .079788456150

To see whether this is the most likely number of successes we need to compare this to P(k in 100) for every other k.

Page 31: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode

The most likely number of successes is called the mode

of a binomial distribution.

Page 32: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode

If we can show that for some m

P(1) · … P(m-1) · P(m) ¸ P(m+1) … ¸ P(n),

then m would be the mode.

Page 33: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode

P(k)P(k) P(l) 1,

P(l)

so we can use successive odds ratio:

to determine the mode.

pP(k) n-k+1,

P(k-1) k q

Page 34: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode

1-pkP(k-1) P(k) 1,

n-k+1 p

P(k-1) P(k) k(1-p) (n-k+1)p

P(k-1) P(k) k np+p;

pP(k) n-k+1,

P(k-1) k 1-psuccessive odds

ratio:

If we replace · with > the implications will still hold.

> >

> >

> >

So for m=bnp+pc we get that

P(m-1) · P(m) > P(m+1).

Page 35: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode - graph SOR

- 6

- 4

- 2

0

2

4

6

10 20 30 40 50 60 70 80 90

100

k

P(k)log( )

P(k-1)

mode = 50

Page 36: Lectures prepared by: Elchanan Mossel Yelena Shvets

Binomial Distribution:Mode - graph distr

k

P(k)

mode = 50

0.00

0.02

0.04

0.06

0.08

0.10

0.12

0

10 20 30 40 50 60 70 80 90

100

Page 37: Lectures prepared by: Elchanan Mossel Yelena Shvets

Lectures prepared by:Elchanan MosselYelena Shvets

Introduction to probability

Stat 134 FAll 2005

Berkeley

Follows Jim Pitman’s book:

ProbabilitySection 2.1