Answer: 23 people are needed. It is easier to calculate the opposite probability: that everyone has different birthdays. With a person there is no restriction. The second must have a birthday on a different day: $$
\frac{364}{365}.
$$ The third must avoid the two previous birthdays: $$
\frac{363}{365}.
$$ And so on. For $n$ people, the probability that they all have different birthdays is: $$
\frac{365}{365}\cdot\frac{364}{365}\cdot\frac{363}{365}\cdots\frac{365-n+1}{365}.
$$ With 22 people, the probability of there being at least one match is still less than 50%. With 23 people, the probability that they all have different birthdays drops to approximately: $$
0{,}493.
$$ Therefore, the probability that at least two share a birthday is: $$
1-0{,}493=0{,}507.
$$ That is, approximately 50.7%. So the minimum number of people needed is 23.