Question: 2 . ( 3 6 points ) It is said that when there are 2 0 people in a room, the possibility that 2 of

2.(36 points) It is said that when there are 20 people in a room, the possibility that 2 of them have the same
birthday (we consider months and days only, not the years) is pretty high, almost around 0.5, at least
bigger than 0.1.
(a)(12 points) From the theory of probability, we know that such probability (consider ordinary year with 365
days) is equal to 1- P (365,20)/36520. Here P (365,20) is the number of permutations of choosing 20 from
365 or 365!/(345!), where 365! Is 365 factorial or 365*364*363*362*,..*3*2*1.
Prove this statement is correct or invalidate this by computing such a number (using C #programming)
(hint: compute (365.0/365.0)*(364.0/365.0)*(363.0/365.0)*...*(346.0/365.0), which is a for loop of
20 iterations, for i =1 to 20).
(b)(12 points) Generalize this question to compute the probability of n people with 2 of them having the same
birth date. Print out in tabular format, such probability for n =11,12, up to n =50, listing 5 in a row if possible.
For verification purpose, the output should look like below:
Printing out probabilities of 2 identical birthdays for 11 to 50 people
0.1411410.1670250.194410.2231030.252901
0.2836040.3150080.3469110.3791190.411438
0.4436880.4756950.5072970.5383440.5687
0.5982410.6268590.6544610.6809690.706316
0.7304550.7533480.7749720.7953170.814383
0.8321820.8487340.8640680.878220.891232
0.9031520.914030.923923

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!