一、 参考书《数据压缩导论(第4版)》 Page 100
5.给定如表所示的概率模型,求出序列a1a1a3a2a3a1的实值标签。
字母 | 概率 |
a1 a2 a3 |
0.2 0.3 0.5 |
答:由题可知,p(a1)=0.2, p(a2)=0.3, p(a3)=0.5
因为x(ai)=i, 所以有:x(a1)=1, x(a2)=2, x(a3)=3
Fx(0)=0 , Fx(1)=0.2 , Fx(2)=0.5 , Fx(3)=1.0
a1: L(0)=0 , U(0)=1
L(1)=L(1-1)+(U(1-1)-L(1-1))·Fx(x1-1)=0
U(1)=L(1-1)+(U(1-1)-L(1-1))·Fx(X1)=0.2
a1: L(1)=0 , U(1)=0.2
L(2)=L(2-1)+(U(2-1)-L(2-1))·Fx(x1-1)=0+(0.2-0)·0=0
U(2)=L(2-1)+(U(2-1)-L(2-1))·Fx(X1)=0+(0.2-0)·0.2=0.04
a3:L(2)=0 , U(2)=0.04
L(3)=L(3-1)+(U(3-1)-L(3-1))·Fx(x3-1)=0+(0.04-0)·0.5=0.02
U(3)=L(3-1)+(U(3-1)-L(3-1))·Fx(X3)=0+(0.04-0)·1=0.04
a2: L(3)=0.02 , U(3)=0.04
L(4)=L(4-1)+(U(4-1)-L(4-1))·Fx(x2-1)=0.02+(0.04-0.02)·0.2=0.024
U(4)=L(4-1)+(U(4-1)-L(4-1))·Fx(X2)=0.02+(0.04-0.02)·0.5=0.03
a3: L(4)=0.024 , U(4)=0.03
L(5)=L(5-1)+(U(5-1)-L(5-1))·Fx(x3-1)=0.024+(0.03-0.024)·0.5=0.027
U(5)=L(5-1)+(U(5-1)-L(5-1))·Fx(X3)=0.024+(0.03-0.024)·1=0.03
a1: L(5)=0.027 , U(5)=0.03
L(6)=L(6-1)+(U(6-1)-L(6-1))·Fx(x1-1)=0.027+(0.03-0.027)·0=0.027
U(6)=L(6-1)+(U(6-1)-L(6-1))·Fx(X1)=0.027+(0.03-0.027)·0.2=0.0276
L(6)=0.027 , U(6)=0.0276
所以a1a1a3a2a3a1的实值标签T(11321)=(0.027+0.0276)/2=0.0273
6.对于表给出的概率模型,对于一个吻标签为0.63215699的长度为10的序列进行解码。
字母 | 概率 |
a1 a2 a3 |
0.2 0.3 0.5 |
答: 由题可知,p(a1)=0.2, p(a2)=0.3, p(a3)=0.5
因为x(ai)=i, 所以有:x(a1)=1, x(a2)=2, x(a3)=3
Fx(0)=0 , Fx(1)=0.2 , Fx(2)=0.5 , Fx(3)=1.0
可以看出,该标签在a3区间[0.5,1.0)里
所以:1.0-0.5=0.5 有:0.5*0.2=0.1
0.5*0.3=0.15
0.5*0.5=0.25
新分段为:0.1+0.5=0.6
0.6+0.15=0.75
0.75+0.25=1.0
可以看出,该标签在a2区间[0.6,0.75)里
所以:0.75-0.6=0.15 有:0.15*0.2=0.03
0.15*0.3=0.045
0.15*0.5=0.075
新分段为:0.6+0.03=0.63
0.63+0.045=0.675
0.675+0.075=0.75
可以看出,该标签在a2区间[0.63,0.675)里
所以:0.675-0.63=0.045 有:0.045*0.2=0.009
0.045*0.3=0.0135
0.045*0.5=0.0225
新分段为:0.63+0.009=0.639
0.639+0.0135=0.6525
0.6525+0.0225=0.675
可以看出,该标签在a1区间[0.63,0.639)里
所以:0.639-0.63=0.009 有:0.009*0.2=0.0018
0.009*0.3=0.0027
0.009*0.50=0.0045
新分段为:0.0018+0.63=0.6318
0.6318+0.0027=0.6345
0.6345+0.0045=0.639
可以看出,该标签在a2区间[0.6318,0.6345)里
所以:0.6345-0.6318=0.0027 有:0.0027*0.2=0.00054
0.0027*0.3=0.00081
0.0027*0.50=0.00135
新分段为:0.00054+0.6318=0.63234
0.63234+0.00081=0.63315
0.63315+0.00135=0.6345
可以看出,该标签在a1区间[0.6318,0.63234)里
所以:0.63234-0.6318=0.00054 有:0.00054*0.2=0.000108
0.00054*0.3=000162
0.00054*0.50=0.00027
新分段为:0.000108+0.6318=0.631908
0.631908+0.000162=0.63207
0.63207+0.00027=0.63234
可以看出,该标签在a3区间[0.63207,0.63234)里
所以:0.63234-0.63207=0.00027 有:0.00027*0.2=0.000054
0.00027*0.3=0.000081
0.00027*0.50=0.000135
新分段为:0.000054+0.63207=0.632124
0.632124+0.000081=0.632205
0.632205+0.000135=0.63234
可以看出,该标签在a2区间[0.63124,0.632205)里
所以:0.632205-0.63124=0.000965 有:0.000965 *0.2=0.000193
0.000965 *0.3=0.0002895
0.000965 *0.50=0.0004825
新分段为:0.000193+0.63124=0.631433
0.0002895+0.631433=0.6317225
0.6317225=0.0004825=0.632205
可以看出,该标签在a2区间[0.631433,0.6317225)里
所以:0.6317225-0.631433=0.0002895 有:0.0002895 *0.2=0.0005790
0.0002895 *0.3=0.0008685
0.0002895*0.50=0.00014460
新分段为:0.0005790+0.631433=0.632155
0.632017+0.0008685=0.632164
0.6328805+0.00014460=0.6330251
可以看出,该标签在a3区间[0.632124,0.632155)里
所以:0.632155-0.632124=0.000031 有:0.000031 *0.2=0.0000062
0.000031*0.3=0.0000063
0.000031*0.50=0.0000155
新分段为:0.0000062+0.631433=0.6321612
0.6321612+0.0000063=0.6321675
0.631455+0.0000155=0.632183
一个吻标签为0.63215699的长度为10的序列的解码为:a3a2a2a1a2a1a3a2a2a3