1) Minimum variance
Character |
Probability |
Codeword |
$a_1$ |
0.4 |
00 |
$a_2$ |
0.2 |
10 |
$a_3$ |
0.2 |
11 |
$a_4$ |
0.1 |
010 |
$a_5$ |
0.1 |
011 |
Entropy $(H ) =_n (log_2 ( 1 / P_n)) \\
H = 2.122 bits/ Symbol$
Average Length $(L ) = _n . l_n \\
L = 2.2 bits/ Symbol$
Coding efficiency $(η ) = H /L = 96.45$ %
- Redundancy of the Code $(R) = 1 – η = 3.55$ %
2) Huffman Tree
$a_1 = 0.2 \\
a_2 =0.4 \\
a_3 = 0.2 \\
a_4 = 0.1 \\
a_5 = 0.1 \\
n = 3 bits$
Compression ratio = $N_{BC} / N_{AC} = 30 /22 = 136$ %
Huffman Tree
$a_2 - \gt 1 \\
a_1 - \gt 01 \\
a_3 - \gt 000 \\
a_4 - \gt 0000 \\
a_5 - \gt 0011$
$$\text{Figure 1.2 Huffman Tree}$$
At input : $a_5 , a_1 , a_2 , a_1 , a_3 , a_2 , a_2 , a_3 , a_4 , a_2$
Output at Transmitter: 0011 , 01, 101 ,000, 11 ,000 ,001 ,01
Channel is Noiseless
Output at receiver