Question
In a football or soccer game, you have 22 players, from both teams, in the field. What is the probability of having any two players
In a football or soccer game, you have 22 players, from both teams, in the field. What is the probability of having any two players with the same birthday? (just assume 365 days a year and dont have to do the exact calendar month and day, use the day number from 1 to 365)
Write a program to simulate the birthday for each player per iteration and then tabulate the results in terms of occurrence of same birthdays over number of iterations. Do cases of 10, 50, 100 and 500 iterations, or more. The larger the number of iterations (samples), the closer the result is to the theoretical probability. What do you call this theory, or law? ( Ive already given two-third of the name in the last sentence and question)
Hints:
The problem statement implies you need to do a match-search after generating the birthdays; and then do the booking keeping of the results for all iterations. Good opportunity to apply "arrays". And, before running it using srand() and rand() to generate the birthdays, put your fixed data there to verify the search, book keeping and data output algorithms first.
All prior documentation and code structure requirements also apply to this project.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started