Birthday Paradox. How can you actually do this massive calculation? (Excel and TI84 don't work)

6.6k Views Asked by At

Recall, with the birthday problem, with 23 people, the odds of a shared birthday is APPROXIMATELY .5 (correct?)

P(no sharing of dates with 23 people) = $$\frac{365}{365}*\frac{364}{365}*\frac{363}{365}*...*\frac{343}{365} $$

$$= \frac{365!}{342!}*\frac{1}{365^{23}} $$

I want to do this multiplication, but nothing I have can handle it. How can I know for sure it actually is around .5 ?

$$\frac{365!}{342!}*\frac{1}{365^{23}} = .5$$

6

There are 6 best solutions below

2
On BEST ANSWER

You can certainly do this in Excel, and here's how you would do it:

$$\begin{array}{|c|c|c|c|} \hline & \text{A} & \text{B} & \text{C} \\ \hline 1 & 365 & \text{=A1} & \text{=B1/A1} \\ 2 & \text{=A1} & \text{=B1-1} & \text{=B2/A2} \\ 3 & \text{=A2} & \text{=B2-1} & \text{=B3/A3} \\ 4 & \text{=A3} & \text{=B3-1} & \text{=B4/A4} \\ \vdots & \vdots & \vdots & \vdots \\ 23 & \text{=A22} & \text{=B22-1} & \text{=B23/A23} \\ \hline & & & \text{=PRODUCT(C1:C23)} \\ \hline \end{array}$$ This shows the formulas you need to enter into the respective cells. You start with entering 365 into A1, then type in =A1 into cells A2 and B1. Next, type in the formula =B1-1 into B2, and =B1/A1 into C1. Next, copy down all the formulas up to row 23. Column C then computes each ratio in your original expression, and =PRODUCT(C1:C23) computes the product.

0
On

With respect to the question in the title, by doing the second line, you are making your calculator attempt to compute a number greater than $100^{200}$. It won't.

By doing the first line, you are making a multiplication of about $20$ numbers close to $1$. It will handle this just fine.

0
On

You can use Pari Gp in order to do this. You need multiple precision arithmetic due to the large powers and factorials. Pari GP is usually the right way to go if you need to do this kind of computations. Just open the program, type 1.0* 365!/342!/365^23 and you'll get the result $$ 0.49270276567601459277458277166296749976 $$

--

There are smarter way to do this, by paying attention to what you're doing. For example in Matlab/Octave you can do the following:

>> v = 343:365

>> v = v/365

>> prod(v)

and you get $0.492702765676015$

0
On

The following command works in LibreOffice, and would probably work in Excel as well:

=COMBIN(365,342)*FACT(23)/(365^23)

The key is that $365!$ and $342!$ are both enormous, but all the other numbers are manageable, so we need to find a built-in function to cancel these two monsters. Binomial coefficients will do.

2
On

You can make the calculation with just about any calculator out there. You only need the basics (* /). Stay clear of any large or small numbers, to avoid overflowing (or underflowing). So go divide-multiply-divide-multiply-and-so-on:

$$P \approx 364 / 365 * 363 / 365 * 362 / 365 \ldots $$

1
On

Here's an Excel implementation that gets around the large number issue by distributing the denominator(ie 365^(k-1)) across all factors in the factorial. For the probability of a shared birthday among k people, paste in kth row.

Pr[shared birthday | # of people = ROW()]:

=1 - PRODUCT((ROW(INDIRECT((365-(ROW()-1))&":364")))/365)