Skip to content

Instantly share code, notes, and snippets.

View cdesante's full-sized avatar

Christopher DeSante cdesante

  • Indiana University
View GitHub Profile
@cdesante
cdesante / birthday.r
Created August 17, 2012 18:20
The Birthday Problem
#The birthday Problem.
#Simple computation:
N <- 1:50
pshare <- 1- exp(-(N*(N-1)/2)/365)
cbind(N, pshare)
#just want one value:
bday <- function(X){
N <- X