I am trying to prepare for an interview for a statistics-heavy position, and I always get stuck at probability questions. I made up this interesting question, and I realized I'm not sure I 100% know how to answer it.
I play a game with you where I pick a random number, $x$, between 1 and $n$ (inclusive), we call this number $x$. Then I pick a number, $y$, between $x$ and $n$, inclusive. I will then pay you \$$y$, depending on how much y is. How much are you willing to pay to play this game?
I think this is a cool question. Using capital letters for $X$, being the random variable which denotes the first pick and $Y$ being the second pick. PMF of $X$ can be modeled as: $P(X = x) = \frac{1}{n}$. PMF of $Y$ can be modeled as: $P(y|x) = \frac{1}{n-x}$. So summing up $P(y|x)$ for all $x$, we get the formula:
$$P(Y = y) = \frac{1}{n} \sum_{i=1}^n \frac{1}{n-i} $$
Now, first question, is this right? If so, then the next step is to find the expected value of $Y$, which is an easy jump:
$$E[Y] = \sum_{y=1}^n y * P(y) = \sum_{y=1}^n y * \frac{1}{n} \sum_{i=1}^n \frac{1}{n-i} $$
Second question: Can this be simplified? My math expertise is still being built, but this looks like a harmonic series. Is there any way we can use that knowledge to get a closed form solution?
The mean of a uniform distribution (discrete or continuous) is the average of its endpoints $E[X]=\frac{1+n}{2}$ so with iterated expectation $E[Y]=\frac{\frac{1+n}{2}+n}{2} = \frac{1+3n}{4}$
In your formulation,