# Math Help - Probability problem

1. ## Probability problem

There are 2 boxes with $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 $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 $1\le k\le n$ we will calculate the probability that when T is first empty there will be exactly $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 $(n-1)$ tails come up and $(n-k)$ heads to have shown. This is a total of $(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?
$\binom {2n-k-1} {n-1}\left( {\frac{1}{2}} \right)^{2n - k}$.
Those $(n-1)$ tails may occur anywhere among the first $(2n-k-1)$ flips, then one more tail.
To get either box we double that.
$P(X=k)=\binom {2n-k-1} {n-1}\left( {\frac{1}{2}} \right)^{2n - k-1}$.