# Thread: Probability problem

1. ## Probability problem

There are 2 boxes with $\displaystyle n$ pencils each one.

Randomly we remove a pencil of these boxes, and is not import of what box we remove the pencil.

In a inesperd moment, a box of them this empty one...

Calculate the probability that in the other box (nonempty) they are $\displaystyle k$ pencils.

2. Lets restructure the wording.
Suppose the two boxes are labeled H & T, both with n pencils.
We flip a coin, if it is heads we take one pencil from box H and tails we take one from T; then continue.
If $\displaystyle 1\le k\le n$ we will calculate the probability that when T is first empty there will be exactly $\displaystyle k$ remaining in box H.
Because this is a symmetric problem we will just double that to answer the question.
To have the above setup we need the last flip to be a tail.
Before that we need to have had $\displaystyle (n-1)$ tails come up and $\displaystyle (n-k)$ heads to have shown. This is a total of $\displaystyle (2n-k-1)$ flips occurring in any order. The one more flip on which tails, then box T is empty and box H contains k pencils.
What is the probability of that?
$\displaystyle \binom {2n-k-1} {n-1}\left( {\frac{1}{2}} \right)^{2n - k}$.
Those $\displaystyle (n-1)$ tails may occur anywhere among the first $\displaystyle (2n-k-1)$ flips, then one more tail.
To get either box we double that.
$\displaystyle P(X=k)=\binom {2n-k-1} {n-1}\left( {\frac{1}{2}} \right)^{2n - k-1}$.