OFFSET
1,1
COMMENTS
a(365)=187.
For n<1000, the formula a(n) = 2.79 + 2.456*n^0.732 - 1.825/n provides an estimate of a(n) accurate to 0.82.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 1..1000
Christian N. K. Anderson, Table of n, exact probabilities of a(n)-1 and a(n) for n = 1..1000.
Patrice Le Conte, Coincident Birthdays
EXAMPLE
For a year with 365 days, a(365), the probability that out of 186 people 4 of them share a birthday is 0.495825. The corresponding probability for 187 people is 0.502685, and therefore a(365)=187.
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, 4, y[i-1]); while(BDaySharedByAtLeast(i, j, 4)<.5) j=j+1; y[i]=j}; y
CROSSREFS
KEYWORD
nonn
AUTHOR
Kevin L. Schwartz and Christian N. K. Anderson, May 18 2013
STATUS
approved