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

The Birthday Problem The Birthday Problem is stated as follows: if there is a gr

ID: 1858621 • Letter: T

Question

The Birthday Problem 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
a 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.) Write a
test program that calculates and prints out the probability that two or more
of n people will have the same birthday for n 2, 3, . . . , 40.

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 ;