The birthday paradox says that the probability that two people in a room will have the same birthday is more than half, provided n, the number of people in the room, is more than 23. This property is not really a paradox, but many people find it surprising. Design a Java program that can test this paradox by a series of experiments on randomly generated birthdays, which test this paradox for n = 5, 10, 15, 20,..., 100. Be sure to make your output the same as the output below, use Scanner, # of students, # of trials wanted to run, if you want to see all the matching trials (yes or no), the theoretical probability of a match, found matches, actual percentage, and if you want to run another trial (yes or no). This image is an example of the output:
The birthday paradox says that the probability that two people in a room will have the same birthday is more than half, provided n, the number of people in the room, is more than 23. This property is not really a paradox, but many people find it surprising. Design a Java program that can test this paradox by a series of experiments on randomly generated birthdays, which test this paradox for n = 5, 10, 15, 20,..., 100. Be sure to make your output the same as the output below, use Scanner, # of students, # of trials wanted to run, if you want to see all the matching trials (yes or no), the theoretical probability of a match, found matches, actual percentage, and if you want to run another trial (yes or no).
This image is an example of the output:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images