344. May Beetles. In a box sit May beetles. Among them, there are $n$ males and $m$ females. Mr. Entomologist takes beetles out of the box in random order, one by one, without replacement, until he has $k$ males, $1 \leqslant k \leqslant n$. Let $x_{k}$ be the total number of beetles he has taken out of the box. Find the probability that $x_{k}=x$, where $x=k, k+1, \ldots, k+m$, and determine the expected value of $x_{k}$.
344. If we arrange all $n+m$ beetles in a single row, making sure they don't scatter, the positions for the $n$ males can be chosen in $C_{m+n}^{n}$ ways. Among the first $x-1$ positions, we can place $k-1$ males in $C_{x-1}^{k-1}$ ways, and the remaining $n-k$ males can be placed among the remaining $m+n-x$ positions in $C_{m+n-x}^{n-k}$ ways. Therefore, the probability $f(x)$ that $x_{h}=x$ is

$$
\begin{gathered}
f(x)=\frac{C_{x-1}^{k-1} C_{m+n-x}^{n-k}}{C_{m+n}^{n}} \\
x=k, k+1, \ldots, k+m
\end{gathered}
$$

and the expected value of $x_{k}$ is

$$
E\left(x_{k}\right)=\sum_{x=k}^{k+m} x f(x)
$$

Let $y=x-k$ and consider the sum

$$
\sum_{x=k}^{k+m} x C_{x-1}^{k-1} C_{m+n-x}^{n-k}=k \sum_{y=0}^{m} C_{y+k}^{y} C_{m+n-y-k}^{m-y}
$$

Note that $C_{y+k}^{y}$ is the coefficient of $t^{y}$ in the expansion of $(1-t)^{-k-1}$ in powers of $t$, and $C_{m+n-y-k}^{m-y}$ is the coefficient of $t^{m-y}$ in the expansion of $(1-t)^{-n+k-1}$. Since $(1-t)^{-k-1}(1-t)^{-n+k-1}=(1-t)^{-n-2}$, our sum is equal to the number $k$ multiplied by the coefficient of $t^{m}$ in the expansion of $(1-t)^{-n-2}$. Therefore,

$$
E\left(x_{p}\right)=\frac{k C_{m+n+1}^{m}}{C_{m+n}^{n}}=\frac{k(m+n+1)}{n+1}
$$

[J. Hickman, M. M., 45, 106 (February 1972) ${ }^{*}$.]