UGC-NET Jul 2016 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0036

Consider a source with symbols $A, B, C, D$ with probabilities $1/2, 1/4, 1/8, 1/8$ respectively. What is the average number of bits per symbol for the Huffman code generated from above information?
  1. A
    $2$ bits per symbol
  2. B
    $1.75$ bits per symbol
  3. C
    $1.50$ bits per symbol
  4. D
    $1.25$ bits per symbol

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solution\[\boxed{L=\sum_i p_i\,\ell_i}\]Huffman merges: \(C+D=\tfrac14\), then with \(B\): \(\tfrac12\), then with \(A\): \(1\). Code lengths: \(A:1,\ B:2,\ C:3,\ D:3\).\[L=\tfrac12(1)+\tfrac14(2)+\tfrac18(3)+\tfrac18(3)=0.5+0.5+0.375+0.375=1.75.\]This equals the entropy because every probability is a power of \(\tfrac12\).Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com