Common Birth Dates asked for the expected number of pairs of common birth dates for a cohort of 1000 people whose ages were clustered around a certain value.
Now consider a similar question to the traditional birthday problem: If you attend a concert or other event where people tend to be of a similar age, how large would such an event need to be in terms of number of attendees, so that you'd have at least a 50% probability that there would be at least two people born on the exact same day (year, month and day)?
Again to make things specific: assume the standard deviation about whatever the mean age to be is 12 years and it follows a normal distribution.
Again feel free to vary the assumptions about the distribution.
Take P as the Normal pdf, mean age in days, mu = 60 * 356 and sigma = 12 * 365 +3,
and 120 years being max, m=43825 days, then the likelihood of any pair of audience members _not_ sharing birthdays is:
ppair = sum{i=0 to m} P(i) (1-P(i))
There are n (n-1)/2 ~ (n^2)/2 possible pairs. Setting probability 0.5 to them all not sharing a birthday is:
ppair^( (n^2) /2) = 0.5
0.5 n^2 ln (ppair) = ln 0.5
n = sqrt (2 ln (0.5) /ln (ppair) ) = 146
This disagrees with the simulation, which gave n = 157
The n-1 ~ n approximation does not explain the discrepancy...
Program follows. What's my error?
program ana
implicit none
real*8 num,p,g,ppair,term
integer i,m
m=43825
ppair=0
do i=0,m
p=g(i*1d0)
ppair=ppair+p*(1d0-p)
enddo
num=sqrt(2d0*log(0.5d0)/log(ppair))
print 1,num
1 format('House = ',f5.1)
end
function g(x)
implicit none
real*8 g,mu,sigma,pi,x
pi=4d0*atan(1d0)
mu=60d0*365d0
sigma=12d0*365d0+3d0
g = ( 1d0/ (sigma * sqrt(2d0*pi)) ) *
1 exp ( -(x-mu)**2d0 / (2d0*sigma**2) )
return
end
lord@rabbit 12478 % ana
House = 146.1
Edited on November 18, 2021, 5:48 pm