TITLE: I have 100 boxes. C of them have a gift. I can open up to 16 boxes. What is the number of C that will give me probability over 0.5 to find a gift?
QUESTION [9 upvotes]: Details:
We start by opening a box. If nothing is in there, we open another one. Once we find a gift, we can stop. Each empty box that was opened is discarded (no revisit).
I can find the number of $C$ that will give probability over $0.5$ by writing a program to try for $C=1, C=2$ .. etc.. , but I can't solve the equation for $C$ to find a more "mathematical" and elegant answer.
My work until now is:
1) Found in 1st box: $P(1) = \frac{C}{N}$
2) Found in 2nd box: $P(2) = \frac{1-C}{N}\cdot\frac{C}{N-1}$
4) Found in 3rd box: $P(3) = \frac{1-C}{N}\cdot\frac{1-C/}{N-1}\cdot\frac{C}{N-2}$
Etc...
Adding them up makes things very complicated to solve for $C$.
Any ideas? Thank you in advance!

REPLY [2 votes]: As with a lot of binomial problems, the easiest way to calculate the probability of success from N tries is to start by calculating the probability of N failures and subtracting the answer from 1.
The probability of opening 16 empty boxes (and thus failing to find a prize) in this case is:
$\frac{100-C\choose 16}{100\choose 16}
= \frac{(100-C)!}{16!(84-C)!}\frac{16!84!}{100!}
= \frac{(100-C)!84!}{100!(84-C)!}
= \frac{84×83×...×(85-C)}{100×99×...×(101-C)}
= \frac{84}{100}×\frac{83}{99}×...×\frac{85-C}{101-C}
$
At this point we can proceed by trial and error multiplying by one term at a time.
For C=1 we get $\frac{84}{100}$ which is clearly $>\frac{1}{2}$
For C=2, $\frac{84}{100}×\frac{83}{99}=\frac{6972}{9900} \approx 0.704$
For C=3, $\frac{6972}{9900}×\frac{82}{98} \approx 0.589$
For C=4, $0.589...×\frac{81}{97} \approx 0.492$
So the minimum C for which the probability of losing drops below 0.5 (and thus the winning probability is above 0.5) is 4.