OFFSET
1,1
COMMENTS
a(365) = 88.
For n <= 1000, a(n) = 1.436 + 1.812*n^0.654 - 0.817/n^3 provides an estimate accurate to 0.6 units.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..1000
Christian N. K. Anderson, Table of n and exact probabilities of a(n)-1 and a(n) for n = 1..1000
Patrice Le Conte, Coincident Birthdays
EXAMPLE
The probability that out of 87 people 3 share a birthday in a year with 365 days is 0.4994549. The corresponding probability for 88 people is 0.5110651. Therefore a(365)=88.
PROG
(R) library(gmp); #prob of a maximum of exactly k coincident birthdays is
BigQ<-function(nday, p, k) { #nday=days in a year; p=people
if(p<k | nday<1) return(0)
if(k==1) return(prod(1-(1:p-1)/nday))
tot=0;
for(i in 1:floor(p/k)) {
q=(1-as.bigz(i)/nday)^(p-k*i) * prod((p-as.bigz(1:(k*i))+1)/nday) * prod((nday-as.bigz(1:i)+1)/((1:i)*factorialZ(k)))
tot=tot+as.numeric(q)*ifelse(k*i<p & k>1, sum(sapply(2:k-1, function(j) BigQ(nday-i, p-k*i, j))), 1)
}
tot
}
BDaySharedByAtLeast<-function(nday, people, k) {
if(nday<1 | people<k) return(0)
if(k==1) return(prod(1-(1:people-1)/nday))
prob=1; for(j in 2:k-1) prob=prob-BigQ(nday, people, j); prob
}
y=rep(0, 100); for(i in 1:100) { j=ifelse(i==1, 3, y[i-1]); while(BDaySharedByAtLeast(i, j, 3)<.5) j=j+1; y[i]=j}; y
CROSSREFS
KEYWORD
nonn
AUTHOR
Kevin L. Schwartz and Christian N. K. Anderson, May 17 2013
STATUS
approved