[R] birthday problem (factorial limit)
Bernardo Rangel Tura
tura at centroin.com.br
Tue Sep 30 12:43:26 CEST 2008
Em Dom, 2008-09-28 às 19:43 +0200, Jörg Groß escreveu:
> Hi,
>
> I tried to calculate the formula for the birthday problem
> (the probability that at least two people out of a group of n people
> share the same birthday)
>
> But the factorial-function allows me only to calculate factorials up
> to 170.
>
>
> So is there a way to push that limit?
>
> to solve this formula:
>
> (factorial(365) / factorial((365-23))) / (365^23)
>
> (n=23)
Log experession
n<-23
exp(sum(log(1:365))-sum(log(1:(365-n)))-n*log(365))
[1] 0.4927028
--
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil
More information about the R-help
mailing list