《数据压缩导论(第四版)》P100
...................................................................
5.给定如表所示的概率模型,求出序列a1a1a3a2a3a1 的实值标签。
解:
公式:
从概率模型可知:
Fx(1)=0.2,Fx(2)=0.5,Fx(3)=01
l(0)=0,u(0)=1
对序列a1a1a3a2a3a1即对序列113231进行编码,故:
对序列“1”编码:
l(1)= l(0)+( u(0)- l(0)) Fx(0)=0+(1-0)*0=0
u(1)= l(0)+( u(0)- l(0)) Fx(1)= 0+(1-0)*0.2=0.2
对序列“11”编码:
l(2)= l(1)+( u(1)- l(1)) Fx(0)=0+(0.2-0)*0=0
u(2)= l(1)+( u(1)- l(1)) Fx(1)= 0+(0.2-0)*0.2=0.04
对序列“113”编码:
l(3)= l(2)+( u(2)- l(2)) Fx(2)=0+(0.04-0)*0.5=0.02
u(3)= l(2)+( u(2)- l(2)) Fx(3)= 0+(0.04-0)*1=0.04
对序列“1132”编码:
l(4)= l(3)+( u(3)- l(3)) Fx(1)=0.02+(0.04-0.02)*0.2=0.024
u(4)= l(3)+( u(3)- l(3)) Fx(2)=0.02+(0.04-0.02)*0.5=0.03
对序列“11323”编码:
l(5)= l(4)+( u(4)- l(4)) Fx(2)=0.024+(0.03-0.024)*0.5=0.027
u(5)= l(4)+( u(4)- l(4)) Fx(3)=0.024+(0.03-0.024)*1=0.03
对序列“113231”编码:
l(6)= l(5)+( u(5)- l(5)) Fx(0)=0.027+(0.03-0.027)*0=0.027
u(6)= l(5)+( u(5)- l(5)) Fx(1)=0.027+(0.03-0.027)*0.2=0.0276
序列a1a1a3a2a3a1实值标签为: Tx(113231)=(0.0276+0.027)/2=0.0273
6.对于5题表给出的概率模型,对于一个标签为0.63215699的长度为10的序列进行解码。
解:
从5题概率模型可知:
Fx(1)=0.2,Fx(2)=0.5,Fx(3)=01
l(0)=0,u(0)=1
公式:
根据题设进行长度为10的序列进行编码:
1.t*=(0.63215699-0)/(1-0)=0.63215699
Fx(2)≤t*≤Fx(3)
l(1) =l(0) +(u(0) -l(0) )Fx(2)=0+(1-0)*0.5=0.5
u(1) =l(0) +(u(0) -l(0) )Fx(3)=0+(1-0)*1=1
则第一个序列为:3
2. t*=(0.63215699-0.5)/(1-0.5)=0.264314
Fx(1)≤t*≤Fx(2)
l(2) =l(1) +(u(1) -l(1) )Fx(1)=0.5+(1-0.5)*0.2=0.6
u(2) =l(1) +(u(1) -l(1) )Fx(2)=0.5+(1-0.5)*0.5=0.75
则第二个序列为:2
3. t*=(0.63215699-0.6)/(0.75-0.6)=0.2143799
Fx(1)≤t*≤Fx(2)
l(3) =l(2) +(u(2) -l(2) )Fx(1)=0.6+(0.75-0.6)*0.2=0.63
u(3) =l(2) +(u(2) -l(2) )Fx(2)=0.6+(0.75-0.6)*0.5=0.675
则第三个序列为:2
4. t*=(0.63215699-0.63)/(0.675-0.63)=0.04793311
Fx(0)≤t*≤Fx(1)
l(4) =0.63+(0.675-0.63)*0=0.63
u(4) =0.63+(0.675-0.63)*0.2=0.639
则第四个序列为:1
5.t*=(0.63215699-0.63)/(0.639-0.63)=0.2396656
Fx(1)≤t*≤Fx(2)
l(5) =0.63+(0.639-0.63)*0.2=0.6318
u(5) =0.63+(0.639-0.63)*0.5=0.6345
则第五个序列为:2
6. t*=(0.63215699-0.6318)/(0.6345-0.6318)=0.1322185
Fx(0)≤t*≤Fx(1)
l(6) =0.6318+(0.6345-0.6318)*0=0.6318
u(6) =0.6318+(0.6345-0.6318)*0.2=0.63234
则第六个序列为:1
7. t*=(0.63215699-0.6318)/(0.63234-0.6318)=0.6610926
Fx(2)≤t*≤Fx(3)
l(7) =0.6318+(0.63234-0.6318)*0.5=0.63207
u(7) =0.6318+(0.63234-0.6318)*1=0.63234
则第七个序列为:3
8. t*=(0.63215699-0.63207)/(0.63234-0.63207)=0.3221852
Fx(1)≤t*≤Fx(2)
l(8) =0.63207+(0.63234-0.63207)*0.2=0.632124
u(8) =0.63207+(0.63234-0.63207)*0.5=0.632205
则第八个序列为:2
9. t*=(0.63215699-0.632124)/(0.632205-0.632124)=0.40728395
Fx(1)≤t*≤Fx(2)
l(9) =0.632124+(0.632205-0.632124)*0.2=0.6321402
u(9) =0.632124+(0.632205-0.632124)*0.5=0.6321645
则第九个序列为:2
10. t*=(0.63215699-0.6321402)/(0.6321645-0.6321402)=0.6909
Fx(2)≤t*≤Fx(3)
l(10)= 0.6321402+( 0.6321645- 0.6321402) *0.2=0.63215
u(10)= 0.6321402+(0.6321645 -0.6321402) *0.5=0.63216
则第十个序列为:3
故,标签为0.63215699的长度为10的序列进行解码为:3221213223