In an urn there are $u$ balls, $b$ of which are black.
If we perform $n$ trials of one ball at a time with replacement, the probability of the event $E$ to get $n$ times a black ball is $P(E)=\left(\frac{b}{u}\right)^n$, whereas the probability of the event $L$ to get at least one black ball is $P(L)=1-\left(\frac{u-b}{u}\right)^n$.
Let $X$ be the non-negative, integer-valued random variable representing the number of trials it takes to get a success for the event $E$, and $Y$ the non-negative, integer-valued random variable representing the number of trials it takes to get a success for the event $L$.
What are the expected values $\mathbb{E}[X]$ and $\mathbb{E}[Y]$?
My attempt for $\mathbb{E}[X]$:
I denote with $P(E;k)$ the probability to get a success for the event $E$ at the trial $k$.
The variable $X$ can assume only the value $n$, therefore, by definition it should be $$\mathbb{E}[X]=\sum_{k=1}^n k P(E;k)=\sum_{k=1}^n k P(E)\delta_{n,k}=nP(E).$$
My attempt for $\mathbb{E}[Y]$:
I denote with $P(L;k)$ the probability to get a success for the event $L$ at the trial $k$.
The variable $Y$ can assume any value from $1$ to $n$, therefore, by definition, it should be $$\mathbb{E}[Y]=\sum_{k=1}^n k P(L;k)=\sum_{k=1}^n k \left[1-\left(\frac{u-b}{u}\right)^k\right].$$
Are these calculations correct?