x3x4x5x6x7 X x1x2
5.3对信源 = 编二进制和三进制哈夫曼码,计算
P(X) 0.20.190.180.170.150.10.01 各自的平均码长和编码效率。
解:
=∑kip(xi)=2×0.2+2×0.19+3×0.18+3×0.17+3×0.15+4×0.1+4×0.01
i
=2.72
H(X)H(X)2.609η
====95.9%
R2.72K
=∑kip(xi)=1×0.2+2×(0.19+0.18+0.17+0.15+0.1+0.01)
i
=1.8
H(X)H(X)2.609η====91.4%
R1.8×log3K2
log2mL