In Huffman's coding, if the symbol A has probability 0.3, B has probability…

2018

In Huffman's coding, if the symbol A has probability 0.3, B has probability 0.15, C has probability 0.1, D has probability 0.25 and E has probability 0.2, then the minimum number of bits required to represent all the symbols together is

  1. A.

    14

  2. B.

    11

  3. C.

    12

  4. D.

    15

Attempted by 48 students.

Show answer & explanation

Correct answer: C

The Correct Option is: Option 3 (12)

Technical Explanation | तकनीकी व्याख्या

To find the minimum number of bits, we first construct the Huffman Tree by combining the two smallest probabilities at each step:

  1. Symbols with Probabilities: C (0.1), B (0.15), E (0.2), D (0.25), A (0.3).

  2. Step 1: Combine the smallest: C (0.1) + B (0.15) = CB (0.25).

  3. Step 2: Combine the next smallest: E (0.2) + D (0.25) = ED (0.45).

  4. Step 3: Now we have CB (0.25), A (0.3), and ED (0.45). Combine CB (0.25) + A (0.3) = CBA (0.55).

  5. Step 4: Combine the last two: CBA (0.55) + ED (0.45) = Root (1.0).

Assigning Bits (Path Length):

  • A: 2 bits (Root -> CBA -> A)

  • B: 3 bits (Root -> CBA -> CB -> B)

  • C: 3 bits (Root -> CBA -> CB -> C)

  • D: 2 bits (Root -> ED -> D)

  • E: 2 bits (Root -> ED -> E)

Calculation (if we assume 1 occurrence of each symbol for representation):

Total bits = (sum of bit length) is not the standard way to interpret "represent all together" in a coding context unless a frequency count is given. However, for 5 unique symbols where probabilities represent their relative frequency in a theoretical message:

Total bits for a set of these symbols = 2(0.3) + 3(0.15) + 3(0.1) + 2(0.25) + 2(0.2) = 0.6 + 0.45 + 0.3 + 0.5 + 0.4 = 2.25 bits per symbol.

Note: here we assume a total of 100 occurrences:

A=30, B=15, C=10, D=25, E=20.

Total bits = (30 x 2) + (15 x 3) + (10 x 3) + (25 x 2) + (20 x 2) = 60 + 45 + 30 + 50 + 40 = 225 bits.

If the question implies the sum of the bit lengths assigned to each unique symbol: 2 + 3 + 3 + 2 + 2 = 12.

Explore the full course: Up Lt Grade Assistant Teacher 2025