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 Mathematics & Software · Entry J1412

Resources

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: California Science & Engineering Fair public projects

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google