Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Find the birthday guys: Suppose that you have a party and invite 30 people. What

ID: 3641464 • Letter: F

Question

Find the birthday guys:
Suppose that you have a party and invite 30 people. What do you think is the probability that two of these people have the same birthday?
For this exercise, you are to write a program that uses simulation to answer this question. The program should simulate a party by selecting birthdays randomly, and then checking to see if two of the birthdays are the same. The probability that two people have the same birthday can be determined by simulating a large number of such parties, and keeping track of how many times there are two people with the same birthday. The final result is given by the ratio of the number of times that two people have the same birthday and the number of parties you have simulated.
Make your program flexible by allowing the user to specify the number of trials to run (i.e., the number of parties to simulate) as well as the number of people to invite. Use the time function to seed the random number generator.

Explanation / Answer

#include #include #include int main() { srand(time(NULL)); int day[30],month[30], count=0; for(int k=0;k
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote