# Drawing balls from a pocket

I have a pocket of N=4 balls of different colors, say green, red, blue and yellow.

• You can draw as many times as you want
• After each draw, the ball will be put back to the pocket so that the chance of drawing each ball is always equal
• You need to pre-determine how many times you want to draw and must draw that many times even if you already drew a green ball

To win the game, your draws have to have at least one green ball and no red balls. How many times should you draw to maximize your winning chance?

• I would draw until I got a green ball, and then try and mind-game the administrator of the test into thinking that I had already drawn as many times as I said. /s Nov 13, 2017 at 22:59
• I believe you mean "bag," rather than pocket, unless it's part of an article of clothing. Nov 14, 2017 at 3:48
• @jpmc26 These are all colours of snooker balls, which could make sense of the pockets reference. Nov 14, 2017 at 10:23
• @bobajob aren't all common colors also snooker ball colors?
– jwg
Nov 14, 2017 at 10:49
• @jwg Orange, indigo and violet spring to mind as counter-examples from the 'rainbow colours', but point taken. Either way, snooker pockets remain a way of making sense of the title. Nov 14, 2017 at 11:20

You have the best chances if

you draw 2 balls. The probability is $\frac{5}{16}$

To calculate the probability, given $n$ draws you need to know that:

• There are $3^n$ ways to get no reds
• There are $2^n$ ways to get no reds and no greens
• There are $4^n$ possible draws.

So the probability of drawing at least one green, but no reds is:

\begin{equation}\frac{3^n-2^n}{4^n}\end{equation}

This is optimized with the result given.

Results for the first few $n$ are:

\begin{eqnarray} n=1 &\longrightarrow \frac{1}{4} &= 0.25 \\ n=2 &\longrightarrow \frac{5}{16} &= 0.3125\\ n=3 &\longrightarrow \frac{19}{64} &\approx 0.297\\ n=4 &\longrightarrow \frac{65}{256} &\approx 0.2539\\ n=5 &\longrightarrow \frac{211}{1024} &\approx 0.206 \end{eqnarray}

The chance not to draw a red ball in $n$ drawings is

$\left( \frac{3}{4} \right)^n$.

If you don't draw a red ball, the chances of drawing at least one green ball are

$1 - \left( \frac{2}{3} \right)^n$.

So the total winning chance is

$\left( 1 - \left( \frac{2}{3} \right)^n \right)\left( \frac{3}{4} \right)^n$,

which is maximal for

$n = 2$. Then the probability of winning is $\frac{5}{16}$.

• Same as my result. Good job! Nov 13, 2017 at 23:23
• @DrXorile You too! Also, your way of explaining is different – so it will be understandable for a variety of differently thinking people. Nov 13, 2017 at 23:27
• Is this basically saying that when the odds are against you, the law of large numbers acts against you so the minimal number of choices has the best results? Nov 14, 2017 at 4:05
• @yitzih not exactly. If that were true, you'd expect to see "1" always be the correct option. You can generalize it for k colors as ((k-1)/k)^n - ((k-1)(k-2)/(k(k-1)))^n, which looks ugly but is easy to check in excel. If you plug it in there, you'll see that n tracks slightly under 2/3 k for at least the first few hundred k. Nov 14, 2017 at 4:45