Skip to content

vaithak/Birthday-Paradox-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Birthday Paradox Simulation

Statement

How many people are needed at a party such that there is a reasonable chance that at least
two people have the same birthday?

By birthday we mean any of the 365 days of the year.
Our intuition might lead us to assume that we need around 183 people
(i.e., about half the number of days in a year) for a collision to occur.

However, it turns out that we need far fewer people.

Mathematical Analysis

image

Graph made from the results of code

image

Compile and run code

  $ g++ -o birthday birthday.c++
  $ ./birthday