R/common_aniv.R

# computes the probability of having at least two people with the same aniversary

common_aniv<-function(n_people){
  proba=1
  for ( i in 1:n_people){
    proba = proba * (365-i)/365
  }
  return( 1-proba)
}
tleblevecIMP/ICgeostats documentation built on May 31, 2019, 3:49 p.m.