Aaron samples from a uniform$(0,1)$ distribution. Then Brooke repeatedly samples from the same distribution until she obtains a number higher than Aaron’s. How many samples is she expected to make?
I need some help reconciling two solutions that I found:
For the first solution:
For the second Solution (found two on math.stackexchange):
How many tries to get higher number than uniform random variable?
Therefore, my question is this:
If the first solution is correct, I don't quite understand the step of using the inverse function to find the distribution of $N = g(A)$, and the reason behind taking the derivative of $\frac{d}{dn}g^{-1}(n)$.
If the second solution is correct, we get the expected number of draws as $\infty$, does that make sense ?
Personally, the approach in the second solution makes sense to me, but I am unable to come up with an intuition for why the number of draws is $\infty$, where as the first solution provides a finite number.
Could someone help confirm this ?

Let $E:=\mathsf{E}[N\mid A]$. Then for $z\ge 1$, $$ \mathsf{P}(E\le z)=\mathsf{P}(A\le 1-z^{-1})=1-z^{-1}, $$ and, therefore, the pdf of $E$ is given by $$ f_E(z)=\frac{d}{dz}(1-z^{-1})=z^{-2}1_{[1,\infty)}. $$ Then $$ \mathsf{E}[N]=\mathsf{E}[E]=\int_1^{\infty} \frac{z}{z^2}\, dz=\infty. $$ The same result can be obtained directly, i.e., $$ \mathsf{E}[E]=\mathsf{E}\left[\frac{1}{1-A}\right]=\int_0^1 \frac{1}{1-a}\,da=\infty. $$