1
Stat 88, Spring 2016 A. Adhikari Probability and Mathematical Statistics in Data Science Material from lecture 02/09/2016, not in text Almost all of the material from the lecture on Tuesday 2/9 is on pages 4-11, 14, and 16 of the text. It should also be easy for you to follow Examples 2, 3, and 4 on pages 17-18. There was one calculation in the lecture that’s not in the text. It’s the exponential approxima- tion to the answer to the birthday problem. Here it is. The goal. To approximate P (B n ), the chance that there is at least one matching birthday in a class of n students (under assumptions stated in class and in the text). We know that P (B n )=1 - n-1 Y i=0 365 - i 365 Step 1. We will just approximate the product and then subtract from 1 at the end. That means we will be approximating P (D n ), the chance that all n students have different birthdays. P (D n )= n-1 Y i=0 365 - i 365 Step 2. Take log to convert the product to a sum, since sums are easier to work with than products. Notice that each term in the sum is the log of a number that is near 1, and that the term for i = 0 is 0. log(P (D n )) = n-1 X i=0 log 365 - i 365 = n-1 X i=1 log 1 - i 365 Step 3. Use the approximation log(1 + x) x for small x; this was explained in class and is on page 14 of the text. Then carry out the sum, using the formula k i=1 i = k(k + 1)/2 for positive integer k. log(P (D n )) n-1 X i=1 -i 365 = - 1 365 n-1 X i=1 i = - (n - 1)n 730 Step 4. Invert the log by exponentiation, and subtract from 1. P (D n ) e - (n-1)n 730 , P (B n ) 1 - e - (n-1)n 730 In class we showed graphically that this approximation is excellent.

Bday Approx

Embed Size (px)

DESCRIPTION

Probability

Citation preview

Page 1: Bday Approx

Stat 88, Spring 2016 A. AdhikariProbability and Mathematical Statistics in Data Science

Material from lecture 02/09/2016, not in text

Almost all of the material from the lecture on Tuesday 2/9 is on pages 4-11, 14, and 16 of thetext. It should also be easy for you to follow Examples 2, 3, and 4 on pages 17-18.

There was one calculation in the lecture that’s not in the text. It’s the exponential approxima-tion to the answer to the birthday problem. Here it is.

The goal. To approximate P (Bn), the chance that there is at least one matching birthday ina class of n students (under assumptions stated in class and in the text). We know that

P (Bn) = 1 −n−1∏i=0

365 − i

365

Step 1. We will just approximate the product and then subtract from 1 at the end. Thatmeans we will be approximating P (Dn), the chance that all n students have different birthdays.

P (Dn) =n−1∏i=0

365 − i

365

Step 2. Take log to convert the product to a sum, since sums are easier to work with thanproducts. Notice that each term in the sum is the log of a number that is near 1, and that theterm for i = 0 is 0.

log(P (Dn)) =n−1∑i=0

log(365 − i

365

)=

n−1∑i=1

log(1 − i

365

)

Step 3. Use the approximation log(1 + x) ≈ x for small x; this was explained in class and ison page 14 of the text. Then carry out the sum, using the formula

∑ki=1 i = k(k + 1)/2 for positive

integer k.

log(P (Dn)) ≈n−1∑i=1

−i

365= − 1

365

n−1∑i=1

i = − (n− 1)n

730

Step 4. Invert the log by exponentiation, and subtract from 1.

P (Dn) ≈ e−(n−1)n

730 , P (Bn) ≈ 1 − e−(n−1)n

730

In class we showed graphically that this approximation is excellent.