Probability – What is the Real Answer to the Birthday Question?

birthday paradoxprobability

"How large must a class be to make the probability of finding two people with the same birthday at least 50%?"

I have 360 friends on facebook, and, as expected, the distribution of their birthdays is not uniform at all. I have one day with that has 9 friends with the same birthday. (9 months after big holidays and valentines day seem to be big ones, lol..) So, given that some days are more likely for a birthday, I'm assuming the number of 23 is an upperbound.

Has there been a better estimate to this problem?

Best Answer

Luckily someone has posted some genuine birthday data with a bit of discussion of a related question (is the distribution uniform). We can use this and resampling to show that the answer to your question is apparently 23 - the same as the theoretical answer.

> x <- read.table("bdata.txt", header=T)
> birthday <- data.frame(date=as.factor(x$date), count=x$count)
> summary(birthday) 
      date         count     
 101    :  1   Min.   : 325  
 102    :  1   1st Qu.:1266  
 103    :  1   Median :1310  
 104    :  1   Mean   :1314  
 105    :  1   3rd Qu.:1362  
 106    :  1   Max.   :1559  
 (Other):360                 
> results <- rep(0,50)
> reps <-2000 # big number needed as there is some instability otherwise
> for (i in 1:50)
+ {
+ count <- 0
+ for (j in 1:reps)
+ {
+ samp <- sample(birthday$date, i, replace=T, prob=birthday$count)
+ count <- count + 1*(max(table(samp))>1)
+ }
+ results[i] <- count/reps
+ }
> results
 [1] 0.0000 0.0045 0.0095 0.0220 0.0210 0.0395 0.0570 0.0835 0.0890 0.1165
[11] 0.1480 0.1770 0.1955 0.2265 0.2490 0.2735 0.3105 0.3350 0.3910 0.4165
[21] 0.4690 0.4560 0.5210 0.5310 0.5745 0.5975 0.6240 0.6430 0.6950 0.7015
[31] 0.7285 0.7510 0.7690 0.8025 0.8225 0.8280 0.8525 0.8645 0.8685 0.8830
[41] 0.8965 0.9020 0.9240 0.9435 0.9350 0.9465 0.9545 0.9655 0.9600 0.9665
Related Question