My question is: Find the probability that at least 2 people in a room of 30 share the same birthday.
I looked at this problem - Having birthday at the same day after watching the Birthday Probability video ;
the way to solve this problem is 1 - P(unique birthdays) which is quite straightforward.
But, Q1: how to solve it the other way around? Instead of finding unique birthdays, just find P(Same birthdays). How would that happen?
I thought if everyone from 2 to 30 ppl share 365 bdays and order matters then,
365Pr / 365 where r = 2 to 30
and then summing them up will give the total probability
sum([permutation(365,ppl)/365 for ppl in xrange(2,31)])
Decimal('5.965783049451056333110639647E+73')
Evidently that's not the case. so how to solve #1 ?
Also
Q2: What if there were 1000 people in a room since 365 < 1000, how would that go?
UPDATE
With the Q1, what I mean is the chances 2 people share the same bday and 3 ppl might share some other day, while 4 ppl might not share the same day, 17 ppl might share some other day. For the sake of academic discussion, however complex this might be, I am only interested in knowing how does one solve this, say if we reduce the number of people to 5 just to reduce the complexity, I still would like to know how to approach this problem.
UPDATE ON Q1 Specifically I am asking what is the method/logic to calculate problems on such conditional probability?
Say, there are 4 genes discovered so far and 6 bases in total; What are the Chances of 2 or more genes sharing same bases.
Given 4 genes ('ABCD') there are following sets of possibilities: [['AB', 'CD'], ['AC', 'BD'], ['AD', 'BC'], ['BC', 'AD'], ['BD', 'AC'], ['CD', 'AB'], ['ABC'], ['ABD'], ['ACD'], ['BCD'], ['ABCD']]
So what are the chances?
The cases where people share birthdays are more complicated than that. You could have three people with one birthday and two with another. All the combinations can be computed, but it is a lot of work, which is why we calculate the chance that all the birthdays are unique and subtract from $1$. The chance that there is exactly one pair who share a birthday is ${30 \choose 2}$ (the people to match)$365P29$(ways to choose the birthdays-the second of the pair has his chosen by the first)$/365^{30}$ (ways to choose the birthdays without restrictions).
In your code, each term is much greater than $1$, so cannot be a probability.
For question 2, the chance that some pair shares a birthday is $1$. Why do you ask?
For your edit, with five people you can list all the partitions into birthday groups: $11111,2111,311,41,5,221,32$ You can compute the chance of each one by the above techniques add all but $11111$. That will give the chance that there is at least one pair of people sharing a birthday. It is still more work than computing the chance of $11111$ and subtracting, but doable. The chance of $2111$ is $\frac{{5 \choose 2}365\cdot 364\cdot 363\cdot 362}{365^5}\approx 0.02695$