Selecting n matches from two pockets. Setting
An eminent mathematician fuels a smoking habit by keeping matches in both trouser pockets. When impelled by need he reaches a hand into a randomly selected pocket and grubs about for a match. Suppose he starts with n matches in each pocket.
determine the probability that at the moment the first pocket is emptied of matches (as opposed to the moment when the mathematician reaches in to find an empty pocket) the other contains exactly r matches.
Solution
Suppose the probability of reaching into now empty pocket is p, while the probability of reaching into the other pocket is q, then my expression is:
$$\Pr[\text{one pocket empty, other pocket r items}] = \binom{2n}{n+r}p^n q^{n-r}$$
Update
The original solution is incorrect as comments below pointed out. My new solution 
$$\binom{2n-r}{n}p^n q^{n-r}$$
If $p=q=1/2$, then the above expression further simplifies.
The thinking is that there are $n+(n-r)$ total trials and $n$ successes. Success is defined as picking the pocket that is now empty, sucess probability is then $p$. And we choose $n$ matches from this pocket and $n-r$ matches from the other. 
However, I implicitly fixed a pocket and say it needs to be emptied, and this way of thinking does not seem to generalize the case where there's m pockets.
 A: There are $\displaystyle {n\choose r}$ sets of matches that could be left over in a given pocket. Any one of $\displaystyle {n\choose 1}$ matches could be the last match to be picked from the other pocket. Excluding the $r$ matches in the "leftover" pocket and the last match from the "empty" pocket, there are $2n-r-1$ matches that must be picked by the smoker first, across both pockets: that is, he must pick $n-r$ matches from the leftover pocket and $n-1$ matches from the pocket to be emptied in some random fashion. Consequently, if he chooses one pocket with probability $p$ and the other with probability $q$, then the probability that there are $r$ matches left in one pocket at the point of emptying the other pocket is
$$
{n\choose r}{n \choose 1} \left( p^{n-1}q^{n-r} {}+{} q^{n-1}p^{n-r} \right) \left(2n-r-1\right)!\,,
$$
where I have used the symmetry of the pockets for the sum in the middle.
A: The probability you want is twice the probability where the left pocket empties first, by symmetry. The left pocket empties when there are $r$ matches left over in the right pocket precisely when:


*

*The first $2n - r - 1$ times the left pocket is chosen $n-1$ times and the right pocket $n-r$ times.

*The $2n-r$-th time the left pocket is chosen.


So the total probability is $$2 \cdot \frac{1}{2} \cdot {2n - r - 1\choose n -1} \cdot 2^{-(2n-r-1)} = {2n - r - 1\choose n -1} \cdot 2^{-(2n-r-1)}$$
If the left pocket is chosen with probability $p$ and the right one with probability $1-p$, then the answer would be $${2n - r - 1\choose n -1} \left(p^n (1-p)^{n-r} + p^{n-r}(1-p)^n \right)$$
