Solution (source code)

= Solution

After the first child, $X_2$ is uniform on $\{0,\ldots,N-1\}$. Conditional on $X_2=k\geq1$, the mean number removed is $(k+1)/2$; conditional on $X_2=0$, it is zero. The <law of total expectation> therefore gives
$$
\begin{aligned}
\mathbb EY_2
&=\frac1N\sum_{k=1}^{N-1}\frac{k+1}2\\
&=\boxed{\frac{(N-1)(N+2)}{4N}}.
\end{aligned}
$$
For $N=1$, the sum is empty and the same formula gives zero.