[Math] Probability for number of contained coins

probability

Here is a situation for a probability question

Assume that you have a bag containing 10 coins. You know that there
may be either silver or gold coins in the bag, but you do not know how
many silver and gold coins there are.

Because the size is just 10, I figured I can work out all the possible cases so I can understand to answer the questions that follow. Representing the number of silver and gold coins as tuples, I think only the following configurations are possible:

(0,10), (1,9), (2,8), (3,7), (4,6), (5,5), (6,4), (7,3), (8,2), (9,1), (10,0)

They amount to a total of 11 configurations. If I had to derive this number logically without having to count all configurations, I can say I just need to choose the number for either silver or gold coins and there are 11 ways of choosing them(0 through 10, all inclusive). After the first number is chosen, second number is 10 less the first number.

The first question is

What is the initial probability p(nS) that the bag contains nS silver
coins?

I note that the question asks about the probability that the bags contains n silver coins. Given that eleven possibilities exist, I would define the probability that the bag contains n silver coins as

$$P(n) = \begin{cases}
1/11, & \text{if 0 $\le$ $n$ $\le$ 10} \\
0, & \text{otherwise}
\end{cases} $$

This is true also for the gold coins.

The second question is

You pull out one coin: it is silver. What is now the probability that
the bag contains 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 silver coins?

Given that the pulled out coin is silver, it is possible only in 10 of the 11 combinations. The combination it is not possible in is (0,10) where all coins are gold. I would define the probability of the above question as

$$P(n) = \begin{cases}
1/10, & \text{if 0 $\le$ $n$ $\le$ 9} \\
0, & \text{otherwise}
\end{cases} $$

The last question is

You now pull out another coin: it is gold. What is now the
probability that the bag contains 0, 1, 2, 3, 4, 5, 6, 7, 8 silver
coins?

So, we pulled out two coins in total and one of them is silver and other is gold. This case is possible only in 9 of the 11 total possible combinations. The combinations where this is not possible are when all the coins are silver(10,0) or all the coins are gold(0,10). Accordingly, I would define the probability of the above question as

$$P(n) = \begin{cases}
1/9, & \text{if 0 $\le$ $n$ $\le$ 8} \\
0, & \text{otherwise}
\end{cases} $$

My first obvious question is if my approach towards these questions is correct?

If no, what is the flaw in my logic?

If yes, how would I derive this using conditional probability techniques or Bayes theorem because it might not be possible to enumerate so easily for larger combinations/numbers?

Best Answer

The answer to the first question is correct.

What is the initial probability p(nS) that the bag contains nS silver coins?

$$P(nS) = 1/11 $$

Now, the second question

You pull out one coin: it is silver. What is now the probability that the bag contains 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 silver coins?

The analysis in the question is wrong because the question is about conditional probability. We want to find out the probability of the event that the bag contains n silver coins($0 \le n \le 9$), given that the first coin pulled out was a silver coin. We will use Bayes' theorem to solve this.

See this and this for Bayes theorem and this for an illustrative example. The idea of drawing all the probabilities as a tree demonstrated in this idea is quite helpful in understanding the problem. Now, solution to the problem.

Lets us call the event we pulled out one silver coin as $O$.

Let us call the event there are n silver coins remaining in the bag as $nS$, where $0 \le n \le 9$

We want to find out $P(nS | O)$

Using Bayes formula

$$P(nS|O) = \frac{P(O|nS). P(nS)}{P(O)}$$

From the above question, we know that

$$P(nS) = 1/11 $$

$P(O|nS)$ is defined as the probability where a silver coin is picked given there are n silver coins remaining in the bag after the ball is picked. Since there are n silver coins remaining after the first silver coin was picked, the probability $P(O|nS)$ can be defined as $\frac{n+1}{10}$

$$P(O|nS) = \frac{n+1}{10}$$

$P(O)$ is the probability that a silver coin is picked from the bag on the first turn. Since there are either silver or gold coins in the bag, there is equal probability for both. Thus,

$$P(O) = 1/2$$

This can also be derived by drawing the tree as illustrated in the video

$$P(O) = (\frac{1}{11}*\frac{0}{10}) + (\frac{1}{11}*\frac{1}{10}) + .... + (\frac{1}{11}*\frac{9}{10}) + (\frac{1}{11}*\frac{10}{10})$$

$$P(O) = \frac{1}{11}(\frac{0}{10} + \frac{1}{10} + .... + \frac{9}{10} + \frac{10}{10})$$

$$P(O) = \frac{1}{11}(\frac{0+1+2+ ... + 9 + 10}{10}) = \frac{55}{11*10} = \frac{1}{2}$$

Substituting these values in

$$P(nS|O) = \frac{P(O|nS). P(nS)}{P(O)}$$

$$P(nS|O) = \frac{n+1}{55}$$


You now pull out another coin: it is gold. What is now the probability that the bag contains 0, 1, 2, 3, 4, 5, 6, 7, 8 silver coins?

Let us call the event where two coins were pulled, and the first one is silver and other is gold as $T$.

Let us call the event there are n silver coins remaining in the bag as $nS$, where $0 \le n \le 8$

We want to find out $P(nS | T)$

Using Bayes formula

$$P(nS|T) = \frac{P(T|nS). P(nS)}{P(T)}$$

We know that

$$P(nS) = 1/11 $$

$P(T|nS)$ is defined as the probability where a silver coin is drawn first and gold coin is drawn next given there are n silver coins remaining in the bag after the two coins are picked. On the first turn, the probability for a silver coin to be picked is $\frac{n+1}{10}$. In the second turn, 9 coins would be left in the bag and n of them are silver coins, so, there would be $9-n$ gold coins. The probability of picking a gold coin in the second turn would be $\frac{9-n}{9}$. Combined, the probability would be

$$P(T|nS) = \frac{n+1}{10}*\frac{9-n}{9}$$

$P(T)$ is the probability that a black ball is picked from the bag first followed by a white ball. This can be derived from the probability tree

$$P(T) = (\frac{1}{11}*\frac{0}{10}) + (\frac{1}{11}*\frac{1}{10}*\frac{9}{9}) + (\frac{1}{11}*\frac{2}{10}*\frac{8}{9}) .... + (\frac{1}{11}*\frac{9}{10}*\frac{1}{9}) + (\frac{1}{11}*\frac{10}{10}*\frac{0}{9})$$

$$P(T) = \frac{1}{11}(\sum_{n=0}^{10} \frac{n(10-n)}{10*9})$$

$$P(T) = \frac{1}{11}(\frac{165}{90}) = \frac{1}{6}$$

Substituting these values in

$$P(nS|T) = \frac{P(T|nS). P(nS)}{P(T)}$$

$$P(nS|T) = \frac{8n+9-n^2}{165}$$

Related Question