5.28 The birthday problem is stated as follows: if there is a group of n people
ID: 1858656 • Letter: 5
Question
5.28
The birthday problem is stated as follows: if there is a group of n people in a room, what is the probability that two or more of them have the same birthday? It is possible to determine the answer to this question by simulation. Write a function that calculates the probability that two or more of n people will have the same birthday, where n is the calling argument. Hint: to do this the function should create an array of size n and generate n birthdays in the range 1 to 365 randomly. It should then check to see if any of the n birthdays are identical. The function should perform this experiment at least 5000 times and calculate the fraction of those times in which two or more people had the same birthday.
Explanation / Answer
for i=1 : 100 { f(i)=sin(.05*i) ; % Generates Function } % now calculating Derivative for i=1 : 99 m(i)=i; fdash(i)=(f(i+1-f(i))/.05 ;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.