To figure out the exact probability of finding two people with the same birthday in a given group, it turns out to be easier to ask the opposite question: what is the probability that NO two will share a birthday, i.e., that they will all have different birthdays? With just two people, the probability that they have different birthdays is 364/365, or about .997. So, the probability that two people have the same birthday is 1 - .997 or just .003.
If there are three people, the probability that the third person has a different birthday from the first two (i.e., the probability that all three will have different birthdays) is (364/365) x (363/365), or .992. So, the probabilitiy that at least two of them share the same birthday is 1 - .992 or .008.
With a fourth person, the probability that all four have different birthdays is (364/365) x (363/365) x (362/365), which is approximately .983. And so on. When a twenty-third person enters the room, the final fraction that you multiply by is 343/365, and the answer you get drops below .5 for the first time, being approximately .493. This is the probability that all 23 people have a different birthday. So, the probability that at least two people share a birthday is 1 - .493 = .507. You can see the calculations for ALL group sizes in my letter to Marilyn vos Savant (see the link above).