I recently learned of the Birthday Problem in probability theory, which essentially states that it only takes 23 people in a room to have a 50% chance that 2 of those people have the same birthday. When I try to calculate this myself, I keep coming up with a very different answer, and I am trying to figure out where I am going wrong. Given the problem "how many people does it take to make it 50% likely that 2 will have the same birthday?", here is how I went about solving it:
First, set this up instead as the problem:
"Given $n$ people (where $n$ is selected arbitrarily), what is the probability that 2 people will have the birthday $q$ (where $q$ can be some number between $1$ and $365$ representing a day of the year)"
Well, the probability of having at least 1 person with the birthday of $q$ is $\frac{n}{365}$. To get the probability of 2 people, you would multiply the probability of having one person by $\frac{n-1}{365}$ (based on the Multiplication Rule of Probability, and the fact that we don't want to count the same person twice).
So we can say, given $n$ people, the probability that 2 of them will both have the birthday $q$ (and therefore the same birthday) is $\frac{n(n-1)}{365^2} = \frac{n^2-n}{365^2}$.
Then I just say, given a probability of $\frac12$, solve for $n$.
$$\frac{n^2-n}{365^2} = \frac12$$ $$n^2-n = \frac{365^2}{2}$$ $$n^2 - n - \frac{365^2}{2} = 0$$ $$n\approx259$$
So, based on this method, it should take $259$ people to have a greater than 50% probability that 2 of them will have the same birthday, not $23$.
Where did I go wrong with solving it this way?