Demonstrating the Birthday Paradox Using a Computer Simulation
CSEF · 2012 Mathematics & Software
Overview
Objectives/Goals The objective is to determine if a computer program be used to demonstrate the birthday paradox where in a group of 23 people there is a 50.5% probability that two people have the same birthday. The experimenter thought that the birthday paradox could be simulated by a computer program because a computer program can be written to mimic a real life experiment and can run numerous trials quickly and easily. Methods/Materials A Java intermediate programming platform called BlueJ was used in developing the program. For a set number of groups of people with randomly generated birthdays the program determines how many of the groups had matching birthdays. The program does this for a set number of trials and outputs the number of groups with matching birthdays for each set of groups. The program was run with different combinations of the number of groups and the number of trials. To analyze the results, the averages, standard deviations, maximums, and minimums were calculated. Results With 12 different tests, the birthday paradox simulation correlated very closely to the calculated 50.5% probability of a match. While conducting the experiment, the experimenter found that the combination 500 trials and 100 groups did the best in terms of most accurate average, which was 50.424%. The second closest was 100 trials and 100 groups, with an average of 50.61%. The average for all "100 groups" sets of data was 50.4695%, which is very similar to the calculated probability. Conclusions/Discussion Based on the results, it seems that the birthday paradox can be demonstrated accurately by a computer simulation. Computer simulations are powerful because they can be made to resemble a live test, run large numbers of trials with different inputs, and do it all quickly.
Summary statement
This project simulated the birthday paradox, a complex probability, with a Java computer program.
Help received
Father helped me to learn Java and develop the computer program; Mother assisted in assembling the backboard.
Competition history
- CSEF 2012
Resources
Related projects
CSEF · 2006
What Is the Probability that Probability Is Correct? Can a Computer Generate Random Numbers Accurately?
CSEF · 2013
The Randomness of Humans and Computers
CSEF · 2005
Numbers, Numbers, Numbers
CSEF · 2006
Can a Computer Accurately Simulate Rolling Dice?
CSEF · 2009
Tricky Triangles: A Probability Problem with Theoretical Solution and Monte Carlo Simulations
CSEF · 2008
Generating Random Numbers
CSEF · 2007
Pseudo-Random Numbers
CSEF · 2002
Can People Choose Truly Random Numbers?
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects