Find the probability that at least two people out of $k$ people will have the same birthday 
The Birthday problem. Find the probability that at least two people out of $(k=5)$ people will have the same birthday.

The usual approach would be to use $$p=1-\frac{P_{365,5}}{365^5}$$
However, I want to know what went wrong with my approach:
$$
p=\Pr (A_5\cup A_4\cup A_3\cup A_2)
$$
where $A_i$ is the event where $i$ persons have the same birthday so
$$
p=\frac{1}{365^5}(365^5+365^4 \cdot 364+365^3\cdot 364 \cdot 363+365^2 \cdots362)
$$
I used $365^5$ since $5$ people may have the same birthday, therefore we get a value from $365$ with repetition. Furthermore, $4$ people can have the same birthday so we pick $365^4 \cdot 364$ and so on.
This is obviously wrong since $p>1$ however may I ask what went wrong with my thinking?
 A: First, let’s calculate the probability that nobody has the same birthday. Since birthdays are independent, we can use the formula that $P(A\cap B) = P(A)*P(B)$.
Let $A_{i,j}$ be the event that the $i$th and $j$th person don’t share the same birthday. We then want to calculate
$$
P(A_{1,2}\cap A_{1,3}\cap A_{1,4}\cap A_{1,5}\cap\ldots\cap A_{4,5})
$$
That is, the probability that none of them share the same birthday is the probability that for every two different people we pick, they have a different birthday. By independence, we get that this is equal to
$$
P(A_{1,2})*P(A_{1,3})*ldots*P(A_{4,5})
$$
Clearly, $A_{i,j}$ has the same probability every time—it’s always $\frac{364}{365}$. Thus, we can simplify this to
$$
\left(P\left(\frac{364}{365}\right)\right)^m
$$
where $m$ is the total number of different people we can compare. Since we compare $2$ people at once, and we have $5$ people total, we have $m = {5\choose 2} = 10$ ways of choosing two distinct people.
Thus,
Our probability that nobody has the same birthday is
$$
\left(\frac{364}{365}\right)^{10}
$$
The probability that AT LEAST $2$ people share the same birthday is the complement probability of nobody having the same birthday. Thus,
$$
1 -\left( \frac{364}{365}\right)^{10}
$$
is the probability you’re looking for.
However, your way of computing it doesn’t work out. It seems like you’re trying to first compute the probability that all 5 people have the same birthday + the probability that 4 people have the same birthday + etc etc.
I’m not sure exactly what you tried to do in your method, though. But basically, you can look up how to calculate the probability of exactly $k$ people sharing the same birthday out of a group of $n$, and add that total for each $k\in\{2, 3, \ldots, n\}$
A: Let $X$ denote the number of people with the same birth day .
Well $X$ can be either $0$ , or it can be $2,3,4,5$. Because $X=1$ does not make sense
Then $X=0,2,3,4,5$
$$P(X=0)=\frac{\binom{365}{5}\cdot 5!}{365^{5}}$$
$$P(X=2)=\frac{\binom{5}{2}\binom{365}{1}\binom{364}{3}\cdot \frac{4!}{2!}}{365^{5}}$$
and so on
Then $$P(X\geq 2)=1-P(X<2)=1-\frac{\binom{365}{5}\cdot 5!}{365^{5}}$$
