by Zubair_Marediya » Wed Nov 21, 2012 11:25 am
Hi guys! I think I may have a possible solution. First off, @darksaber21, to answer your last post, add up the following numbers: (1/365)^2 + 2(1/365)(364/365) + (364/365)^2. It should add up to one. You were right about both of the other members having the same birthday, which is accounted for with the (1/365)^2 part, and about them not having the same birthday, which is accounted for with the (364/365)^2 part. The other missing part occurs when "member A" has the same birthday while "member B" does not. There are two different ways to set this situation up so 2(1/365)(364/365) accounts for this.
To build upon the problem above, if one simply wanted to calculate the probability of at least one member having the same birthday, they could simply do the following: 1 - (364/365)^2. Subtracting away the probability of no members having the same birthday gives the probability of at least one member having the same birthday.
In conclusion, the setup that we should extract from this is the following: 1 - (364/365)^(Number of members). So if there are twenty other members, you find that 1 - (364/365)^20 will give you about a 0.0534 probability of finding at least one other member with the same birthday. Similarly, if there are 380 other members, then you find that 1 - (364/365)^380 gives you about a 0.647 probability of finding at least one other member with the same birthday.
To test this, I wrote a function in a software that I have called MATLAB. In the function, there are two inputs, the number of simulations and the number of members. The function makes a row vector with a random numbers ranging from 1 to 365 for the number of simulations that wish to be ran. The length of this row vector is (Number of members + 1). The first number in this row represents the birthday of the newcomer, and the rest of the numbers represent the birthdays of the members. Here's an example if you are confused: If there are 5 members at the party, then the function will make an array like [4 75 32 98 277 123]. The "4" represents the birthday of the newcomer and the following five numbers represent the birthdays of the members. The function runs through all the simulations and outputs the results of finding at least one other member with the same birthday.
For the 20 member problem, running the code 10 times with 10000 simulations gave the following results: 0.0552, 0.0542, 0.0533, 0.0529, 0.0543, 0.0597, 0.0521, 0.0532, 0.0524, 0.0510. You can see that these numbers are pretty close to the expected 0.0534 probability.
For the 380 member problem, running the code 10 times with 10000 simulations gave the following results: 0.6485, 0.6523, 0.6511, 0.6485, 0.6454, 0.6466, 0.6408, 0.6407, 0.6382, 0.6473. You can see that these numbers are pretty close to the expected 0.647 probability.
I hope this is correct and I hope it helps!
P.S. Sorry about not using latex. I was just too lazy to figure it out right now!
2012 4A Calculator State Champ