I am self-learning basic calculus-based undergrad probability. I'd like someone to verify if my work checks out and the mathematical expectation is correct.
[BH 4.35] A group of $50$ people are comparing their birthdays (as usual, assume heir birthdays are independent, are not on February 29). Find the expected number of pairs of people with the same birthday, and expected number of days in the year on which atleast two of these people were born.
Solution.(My Attempt)
Let $A_j$ be the event that the $j$th pair shares their birthday and let $I_{A_j}$ be the indicator function of $A_j$.
\begin{align*} P(A_j) = \frac{1}{365} \end{align*}
Let $X$ be the number of pairs of people with the same birthday.
\begin{align*} X &= I_{A_1} + I_{A_2} + \ldots + I_{A_{50 \choose 2}}\\ E(X) &= \sum_{j=1}^{50 \choose 2} E(I_{A_j}) = {50 \choose 2}\frac{1}{365} \end{align*}
The probability that no person is born on a pre-specified day of the year is,
\begin{align*} \frac{364^{50}}{365^{50}} = \left(1 - \frac{1}{365}\right)^{50} \end{align*}
The probability that exactly $1$ person is born on a prespecified day of the year is,
\begin{align*} \frac{{50 \choose 1} (364)^{49}}{365^{50}} \end{align*}
Let $B_j$ be the event "Atleast $2$ of these people are born on a pre-specified day $j$ of the year", and let $I_{B_j}$ be the indicator function of the event.
\begin{align*} P(B_j) = 1 - \frac{364^{50} + 50\cdot 364^{49}}{365^{50}} \end{align*}
Let $Y$ be the number of days of the year on which atleast $2$ or more people are born. Then,
\begin{align*} Y &= \sum_{j = 1}^{365} I_{B_j}\\ E(Y) &=365 \left(1 - \frac{364^{50} + 50\cdot 364^{49}}{365^{50}}\right) \end{align*}