Been there, done that. At least, for 2 people.
Picture a bowl of 365 balls. Person 1 picks a ball, writes his name on it and puts it back.
Then Person 2 picks a ball.
The chance person 2 picks the ball person 1 picks is 1/365.
So far for 2 people.
For 3 people, the chance person 2 picks the ball person 1 has is 1/365 (0,2740%)
The chance that its not the case is 1-1/365=(364/365) =
In that case person 3 picks a ball. For person 3 there are 2 balls forbidden, so his chance to pick something bad is 2/365. So the chance that 3 persons have the same ball is: 1/365 + (364/365))(2/365) = 0,2740% + 0,5464% = 0,8204% note, 0,5464 != (does not equal) 2*0,2740)
for 4 people the chance of 2 people having the same ball is 1/365
in case not, the chance of 3 people having the same ball 1/365 + (364/365))(2/365)
in case not, the chance of 4 people picking the same ball is 1/365 + (364/365))(2/365) + (1-(1/365 + (364/365))(2/365)))(3/365) = 0,2740% + 0,5464% + 0,8152% = 1,656%
For 5: (1-1,1656%)(4/365) = 1,0831%
Total chance: 0,2740% + 0,5464% + 0,8152% + 1,0831% = 2,739%
For 6: (1-2,739%)(5/365) = 1,332%
Total chance: 4,071%
For 7: (1-4,071%)(6/365) = 1,577%
Total chance: 5,648%
For 8: (1-5,648%)(7/365) = 1,809%
Total chacne: 7,457%
For 9: (1-7,457%)(8/365) = 2,028%
Total: 9,485%
For 10: (1-9,485%)(9/365) = 2,231%
Total: 11,716%
For 11: (1-11,716%)(10/365) = 2,419%
Total: 14,135%
For 12: 2,588%
16,938%
13: 2,731%
19,67%
14: 2,861%
22,53%
15: 2,97%
25,50%
16: 3,06%
28,56%
17: 3,13%
31,69%
18: 0,318%
34,78%
19: 3,21%
37,99%
20: 3,23%
41,22%
21: 3,22%
44,44%
22: 3,20%
47,64%
23: 3,16%
51,0%
Yay, 23 people.
I might be off 1 or 2 because of roundings
Some stuff need to be added to make this work for 3 people which. I estimate 62 people. I'd have to calculate it numerically because for 3 people things get a lot longer, but the idea is the same as above.
Would be interesting to see what function it is for N amount of people to have 50/50 chance to have the same birthday.