- 2070 Asar (CS II) · 1+3+1 marks
Source coding; Huffman for five symbols (0.3, 0.25, 0.2, 0.15, 0.1)
Short answer
Source coding represents symbols with minimal average bits. Huffman coding assigns S0=00, S1=10, S2=11, S3=010, S4=011, giving average length 2.25 bits and efficiency 99.03%.
What is source coding? Develop Huffman coding of a 5 symbol source with probabilities: S0 = 0.3, S1 = 0.25, S2 = 0.2, S3 = 0.15, S4 = 0.1. And also calculate Coding efficiency.
Source coding
Source coding is the process of representing the symbols of an information source by binary code words with the least average number of bits, by removing redundancy, so that the average code length approaches the source entropy (e.g. Huffman, Shannon–Fano coding).
Huffman code
: S0 = 0.3, S1 = 0.25, S2 = 0.2, S3 = 0.15, S4 = 0.1.
Reduction (sum of two lowest moved up as high as possible):
| Stage | Probabilities (descending) | Combined |
|---|---|---|
| 1 | 0.3, 0.25, 0.2, 0.15, 0.1 | 0.15 + 0.1 = 0.25 |
| 2 | 0.3, 0.25, 0.25, 0.2 | 0.25 + 0.2 = 0.45 |
| 3 | 0.45, 0.3, 0.25 | 0.3 + 0.25 = 0.55 |
| 4 | 0.55, 0.45 | 0.55 + 0.45 = 1 |
| Symbol | Huffman code | ||
|---|---|---|---|
| S0 | 0.3 | 00 | 2 |
| S1 | 0.25 | 10 | 2 |
| S2 | 0.2 | 11 | 2 |
| S3 | 0.15 | 010 | 3 |
| S4 | 0.1 | 011 | 3 |
Coding efficiency
| Symbol | |||
|---|---|---|---|
| S0 | 0.3 | 1.7370 | 0.5211 |
| S1 | 0.25 | 2.0000 | 0.5000 |
| S2 | 0.2 | 2.3219 | 0.4644 |
| S3 | 0.15 | 2.7370 | 0.4105 |
| S4 | 0.1 | 3.3219 | 0.3322 |
| Total | 1 | 2.2282 |
Answer: S0, S1, S2 get 2-bit codes and S3, S4 get 3-bit codes; efficiency 99.03 %.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Source vs channel coding; Huffman for five symbols · Communication Systems, chapter 6
- Huffman code for seven-symbol source · Communication Systems, chapter 6
- Importance of source coding; Huffman for eight symbols at 1000 symbols/s · Communication Systems, chapter 6
- Importance of source coding; fixed vs Shannon-Fano (five symbols) · Communication Systems, chapter 6
- Huffman code for five-symbol DMS vs fixed length · Communication Systems, chapter 6
- Importance of source coding; Shannon-Fano vs fixed length (seven symbols) · Communication Systems, chapter 6
- Huffman code for five symbols (0.2, 0.35, ...) · Data Communication, chapter 8
- Huffman code for six symbols (0.04, 0.1, ...) · Data Communication, chapter 8
- Huffman code for symbols A to E (0.4, 0.3, ...) · Data Communication, chapter 8
- Laplace: current with S1 closing and S2 opening at 4 ms · Electrical Circuit Theory, chapter 4