Skip to main content

Source vs channel coding; Huffman for five symbols

Short answer

Source coding removes redundancy; channel coding adds it for reliability. For five symbols with probabilities 0.55,0.15,0.15,0.1,0.05, Huffman gives S0=0, others 3-bit, average length 1.90 bits/symbol, efficiency 97.04%.

Distinguish between the Source coding and Channel coding. A discrete memoryless source has an alphabet of five symbols S0, S1, S2, S3, S4 with probabilities of 0.55, 0.15, 0.15, 0.1 and 0.05 respectively. Determine the Huffman code for each symbol and calculate the coding efficiency.

Source coding vs channel coding

Source codingChannel coding
Removes redundancy from the source outputAdds controlled redundancy
Aim: efficiency (fewer bits per symbol)Aim: reliability (error detection/correction)
Reduces bit rate and bandwidthIncreases bit rate and bandwidth
Uses symbol probabilitiesUses algebraic structure of codes
Limited by entropy: Lˉ≥H\bar L \ge HLimited by channel capacity: R≤CR \le C
Examples: Huffman, Shannon–Fano, LZWHamming, cyclic (CRC), convolutional
Placed right after the sourcePlaced before the modulator

Huffman code

Probabilities: S0 = 0.55, S1 = 0.15, S2 = 0.15, S3 = 0.1, S4 = 0.05.

Reduction (sum of two lowest moved up as high as possible):

StageProbabilities (descending)Combined
10.55, 0.15, 0.15, 0.1, 0.050.1 + 0.05 = 0.15
20.55, 0.15, 0.15, 0.150.15 + 0.15 = 0.3
30.55, 0.3, 0.150.3 + 0.15 = 0.45
40.55, 0.450.55 + 0.45 = 1
Symbolpip_iHuffman codelil_i
S00.5501
S10.151003
S20.151013
S30.11103
S40.051113

Coding efficiency

Symbolpip_ilog⁡2(1/pi)\log_2(1/p_i)pilog⁡2(1/pi)p_i\log_2(1/p_i)
S00.550.86250.4744
S10.152.73700.4105
S20.152.73700.4105
S30.13.32190.3322
S40.054.32190.2161
Total11.8438
H=1.8438 bits/symbolLˉ=0.55(1)+0.15(3)+0.15(3)+0.1(3)+0.05(3)=0.55+1.35=1.90 bits/symbolη=HLˉ=1.84381.90=97.04%\begin{aligned} H &= 1.8438\ \text{bits/symbol} \\ \bar L &= 0.55(1)+0.15(3)+0.15(3)+0.1(3)+0.05(3) = 0.55 + 1.35 = 1.90\ \text{bits/symbol} \\ \eta &= \frac{H}{\bar L} = \frac{1.8438}{1.90} = 97.04\% \end{aligned}

Answer: S0 = 0 and the other four symbols get 3-bit codes (table); Lˉ=1.9\bar L = 1.9 bits/symbol, efficiency 97.04 %.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Communication Systems chapter 6 questions →