---
title: "Source vs channel coding; Huffman for five symbols"
subject: "Communication Systems"
chapter: 6
key: "semester_6/communication_systems:source-channel-huffman-five"
source: https://www.bctengineer.com/q/semester_6/communication_systems/source-channel-huffman-five
site: BCT Engineering
---

# Source vs channel coding; Huffman for five symbols

Communication Systems · Chapter 6: Baseband Digital Data Transmission

- Asked in: 2074 Asoj (CS II), 3+2+2 marks
- Video: [Huffman Coding |  Lecture 6| Information Theory & Coding Technique| ITCCN](https://www.youtube.com/watch?v=yVG4FnH3Rc8) — Dr. Sarika Panwar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/communication_systems/source-channel-huffman-five
- Whole chapter: https://www.bctengineer.com/md/semester_6/communication_systems/chapter-6

## Question

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.

## 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%.

## Answer

#### Source coding vs channel coding

| Source coding | Channel coding |
|---|---|
| Removes redundancy from the source output | Adds controlled redundancy |
| Aim: efficiency (fewer bits per symbol) | Aim: reliability (error detection/correction) |
| Reduces bit rate and bandwidth | Increases bit rate and bandwidth |
| Uses symbol probabilities | Uses algebraic structure of codes |
| Limited by entropy: $\bar L \ge H$ | Limited by channel capacity: $R \le C$ |
| Examples: Huffman, Shannon–Fano, LZW | Hamming, cyclic (CRC), convolutional |
| Placed right after the source | Placed 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):**

| Stage | Probabilities (descending) | Combined |
|---|---|---|
| 1 | 0.55, 0.15, 0.15, 0.1, 0.05 | 0.1 + 0.05 = 0.15 |
| 2 | 0.55, 0.15, 0.15, 0.15 | 0.15 + 0.15 = 0.3 |
| 3 | 0.55, 0.3, 0.15 | 0.3 + 0.15 = 0.45 |
| 4 | 0.55, 0.45 | 0.55 + 0.45 = 1 |

| Symbol | $p_i$ | Huffman code | $l_i$ |
|---|---|---|---|
| S0 | 0.55 | 0 | 1 |
| S1 | 0.15 | 100 | 3 |
| S2 | 0.15 | 101 | 3 |
| S3 | 0.1 | 110 | 3 |
| S4 | 0.05 | 111 | 3 |

#### Coding efficiency

| Symbol | $p_i$ | $\log_2(1/p_i)$ | $p_i\log_2(1/p_i)$ |
|---|---|---|---|
| S0 | 0.55 | 0.8625 | 0.4744 |
| S1 | 0.15 | 2.7370 | 0.4105 |
| S2 | 0.15 | 2.7370 | 0.4105 |
| S3 | 0.1 | 3.3219 | 0.3322 |
| S4 | 0.05 | 4.3219 | 0.2161 |
| **Total** | 1 | | **1.8438** |

$$
\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); $\bar L = 1.9$ bits/symbol, efficiency **97.04 %**.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which statement distinguishes channel coding from source coding?
   A. Channel coding adds controlled redundancy for reliability
   B. Channel coding removes redundancy
   C. Channel coding reduces bit rate
   D. Channel coding is limited by entropy
   Answer: A. Channel coding adds redundancy for error detection/correction and is limited by capacity; source coding removes redundancy. (Key point: Source vs channel coding)

2. In the Huffman code for 0.55, 0.15, 0.15, 0.1, 0.05, S0 gets a 1-bit code because:
   A. It is most probable and is not merged until the last stage
   B. It is least probable
   C. Its probability is a power of 2
   D. It is merged first
   Answer: A. Only the 0.55 symbol stays unmerged until the end, so it is directly under the root with length 1. (Key point: Huffman code lengths)

3. The average length of this Huffman code is:
   A. 1.84
   B. 1.90
   C. 2.00
   D. 3.00
   Answer: B. L = 0.55(1) + 0.45(3) = 1.90 bits/symbol. (Key point: Average length)

4. With H = 1.8438, the efficiency is:
   A. 97.04%
   B. 100%
   C. 92%
   D. 61.5%
   Answer: A. eta = 1.8438/1.90 = 97.04%. (Key point: Efficiency)

## Related in Communication Systems

- [Source coding; Huffman for five symbols (0.3, 0.25, 0.2, 0.15, 0.1)](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Asource-coding-huffman-five-s0) — Communication Systems, chapter 6
- [Huffman code for seven-symbol source](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahuffman-seven-symbols) — Communication Systems, chapter 6
- [Importance of source coding; fixed vs Shannon-Fano (five symbols)](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Asource-coding-fixed-sf-five) — Communication Systems, chapter 6
- [Importance of source coding; Huffman for eight symbols at 1000 symbols/s](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Asource-coding-huffman-eight-1000) — Communication Systems, chapter 6
- [Huffman code for five-symbol DMS vs fixed length](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahuffman-dms-five-symbols) — Communication Systems, chapter 6
- [Importance of source coding; Shannon-Fano vs BCD (four symbols)](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Asource-coding-sf-bcd-four) — Communication Systems, chapter 6

## Related in other subjects

- [Huffman code for five symbols (0.2, 0.35, ...)](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahuffman-five-symbols-02-035) — Data Communication, chapter 8
- [Huffman code for symbols A to E (0.4, 0.3, ...)](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahuffman-table-abcde) — Data Communication, chapter 8
- [Huffman code for six symbols (0.04, 0.1, ...)](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahuffman-six-symbols-004) — Data Communication, chapter 8
- [Huffman code for symbols A to E](https://www.bctengineer.com/question.md?key=semester_8%2Fmultimedia_system%3Ahuffman-numerical-abcde) — Multimedia System, chapter 5
