How to calculate the expected value of where the first dice roll is greater than the second dice roll? Consider an $N$-sided die. I roll it twice. I want to find the expectation of the first dice roll given that it is greater than the second dice roll.
So if we let $X$ and $Y$ denote the random variable value for the first and second rolls, respectively. We want to find $E[X | X > Y]$. Conditioning on $X > Y$ means we only consider the following ordered pairs $(2,1), (3,1), (3,2), (4,1), (4,2), (4,3)$ and so on. For an $N$-sided die there are $1 + 2 + \ldots + N-1 = \frac{N(N-1)}{2}$ of these ordered pairs.
So
$$
E[X | X > Y] = \frac{2}{N(N-1)} (1 * 2 + 2 * 3 + 3 * 4 + \ldots + (N-1)*N)
$$
So this leads in to a series. I am wondering if there's an easier way to solve this without having to solve this series? I feel like there should be based on the nice structure of this problem
 A: For $2\leqslant i\leqslant N$ we have by definition of conditional probability:
$$
\mathbb P(X=i\mid X>Y) = \frac{\mathbb P(X=i,X>Y)}{\mathbb P(X>Y)}.$$
Since
$$
\{X=i,X>Y\} = \bigcup_{j=1}^{i-1}\left(\{X=i\}\cap\{Y=j\}\right),
$$
it follows that
\begin{align}
\mathbb P(X=i,X>Y) &= \mathbb P\left(\bigcup_{j=1}^{i-1}\left(\{X=i\}\cap\{Y=j\}\right)\right)\\
&= \sum_{j=1}^{i-1}\mathbb P(X=i)\mathbb P(Y=j)\\
&= \sum_{j=1}^{i-1}\frac1{N^2}\\
&= \frac{i-1}{N^2}.\tag1
\end{align}
Now, $\mathbb P(X=Y)=\frac1N$, and since
$$
\Omega = \{X=Y\}\cup\{X<Y\}\cup\{X>Y\},
$$
by symmetry we have
$$
\mathbb P(X>Y) = \frac12(1-\mathbb P(X=Y)) =\frac{N-1}{2N}.\tag2
$$
Combining $(1)$ and $(2)$, we find that
$$
\mathbb P(X=i\mid X>Y) = \frac{\frac{i-1}{N^2}}{\frac{N-1}{2N}} = \frac{2 (i-1)}{N(N-1)}.
$$
We can then compute the conditional expectation directly:
\begin{align}
\mathbb E[X\mid X>Y] &= \sum_{i=2}^N i\cdot\mathbb P(X=i\mid X>Y)\\
&= \sum_{i=2}^N i\cdot\frac{2 (i-1)}{N(N-1)}\\
&= \frac23(N+1).
\end{align}
