edited by
2,150 views
15 votes
15 votes

A bag contains $16$ balls of the following colors: 8 red, 4 blue, 2 green, 1 black, and 1 white. Anisha picks a ball randomly from the bag, and messages Babu its color using a string of zeros and ones. She replaces the ball in the bag, and repeats this experiment, many times. What is the minimum expected length of the message she has to convey to Babu per experiment?

  1. $\dfrac{3}{2}\\$
  2. ${\log 5}\\$
  3. $\dfrac{15}{8}\\$
  4. $\dfrac{31}{16}\\$
  5. $2$
edited by

1 Answer

Best answer
30 votes
30 votes

Answer is (C)

Using static Huffman compression you can encode the more common colours in fewer bits than the rare colours, that being the case on can expect that common colours will usually be chosen.

eg:

$\begin{array}{llll}  \text{red} & 1 \\ \text{blue} & 01 \\ \text{green} & 001 \\ \text{white} & 0001  \\ \text{black} & 0000 \\ \end{array}$

On average from $16$ draws there will be

$\begin{array}{llll}  \text{8 reds} & =  \ \text{8 bits} \\  \text{4 blues} & = \ \text{8 bits} \\ \text{2 greens} & =\; \text{6 bits} \\  \text{1 white} & =  \ \text{4 bits}  \\ \text{1 black} & = \ \text{4 bits} \\ \end{array}$

for a total of $\dfrac{30}{16} =\dfrac{15}{8}$ bits on average.

edited by
Answer:

Related questions

23 votes
23 votes
5 answers
1
13 votes
13 votes
2 answers
4
makhdoom ghaya asked Oct 26, 2015
1,733 views
The probability of throwing six perfect dices and getting six different faces is$1 -\dfrac{ 6!} { 6^{6}}$$\dfrac{6! }{ 6^{6}}$$6^{-6}$$1 - 6^{-6}$None of the above