Combinatorics and Computing Probabilities
60:00
05:00
25:00
Simulation Code in R
25:00
05:00
20:00
-Let’s see if we can work it out with probability, and then see if anyone in the room shares a birthday (don’t check yet!)
Say we have \(K\) people in a room
Define the event \(A = \{\text{At least two people in a room share a birthday}\}\)
Consider the complement event, \(A^{C} = \{\text{no one in the room shares a birthday}\}\)
In this case, computing \(P(A^{C})\) seems like the easier route, so we will do that
\[P(\text{2 people don't share birthday out of 2}) = \frac{365 \times 364}{365 \times 365}\]
\[P(\text{At least 2 people share a birthday out of 2}) = 1- \frac{365 \times 364}{365 \times 365}\]
\[P(\text{2 people don't share birthday out of 3}) = \frac{365 \times 364 \times 363}{365 \times 365 \times 365}\]
\[P(\text{At least 2 people share a birthday out of 3}) = 1-\frac{365 \times 364 \times 363}{365 \times 365 \times 365}\]
\[P(\text{K people don't share birthday}) = \frac{365}{365} \times \frac{364}{364}\times \frac{363}{365} \times \cdots \frac{(365-K+1)}{365}\] \[P(\text{At least 2 people share a birthday out of K}) = 1-\frac{365}{365} \times \frac{364}{364}\times \frac{363}{365} \times \cdots \frac{(365-K+1)}{365}\]
It turns out, this equals 0.5 at 23 people! Not really that many at all!
Let’s test it out, make (hopefully 2) groups of 23 and lets see if anyone in those groups shares a birthday!
