第四次的作业
5。给定如表4-9所示的概率模型,求a1a1a3a2a3a1的实值标签。
表4-9 习题5,习题6的概率模型 |
字母 概率 |
a1 0.2 |
a2 0.3 |
a3 0.5 |
解:
p(a1)=0.2 ,p(a2)=0.3 ,p(a3)=0.5
FX(0)=0,FX(1)=0.2 ,FX(2)=0.5 ,FX(3)=1.0, U(0)=1 ,L(0)=0
由X(ai)=i, 得X(a1)=1,X(a2)=2,X(a3)=3
由公式,L(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn-1)
u(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn)
第一次出现a1时:
L(1)=L(0)+(U(0)-L(0))Fx(0)=0
U(1)=L(0)+(U(0)-L(0))Fx(1)=0.2
第二次出现a1时:
L(2)=L(1)+(U(1)-L(1))Fx(0)=0
U(2)=L(1)+(U(1)-L(1))Fx(1)=0.04
第三次出现a3时:
L(3)=L(2)+(U(2)-L(2))Fx(2)=0.02
U(3)=L(2)+(U(2)-L(2))Fx(3)=0.04
第四次出现a2时:
L(4)=L(3)+(U(3)-L(3))Fx(1)=0.024
U(4)=L(3)+(U(3)-L(3))Fx(2)=0.03
第五次出现a3时:
L(5)=L(4)+(U(4)-L(4))Fx(2)=0.027
U(5)=L(4)+(U(4)-L(4))Fx(3)=0.03
第六次出现a1时:
L(6)=L(5)+(U(5)-L(5))Fx(0)=0.027
U(6)=L(5)+(U(5)-L(5))Fx(1)=0.0276
所以,序列a1a1a3a2a3a1的实值标签为:T(113231)=(L(6)+ U(6))/2=0.0273。
6.对于表4-9给出的概率模型,对于一个标签为0.63215699的长度为10的序列号进行解码。
解:
由表得到: p(a1)=0.2 ,p(a2)=0.3 ,p(a3)=0.5
FX(0)=0,FX(1)=0.2 ,FX(2)=0.5 ,FX(3)=1.0, U(0)=1 ,L(0)=0
由X(ai)=i, 得X(a1)=1,X(a2)=2,X(a3)=3
由公式,L(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn-1)
u(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn)
所以: 设u(0)=1,l(0)=0
l(1)=0+(1-0)Fx(x1-1)=Fx(x1-1)
u(1)=0+(1-0)Fx(x1)=Fx(x1)
若x1=1,则该区间为[0,0.2)
若x1=2,则该区间为[0.2,0.5)
若x1=3,则该区间为[0.5,1)
1.由于0.63215699在[0.5,1)中,所以x1=3
l(2)=0.5+(1-0.5)Fx(x2-1)=0.5+0.5Fx(x2-1)
u(2)=0.5+(1-0.5)Fx(x2)=0.5+0.5Fx(x2)
若x2=1,则该区间为[0.5,0.6)
若x2=2,则该区间为[0.6,0.75)
若x2=3,则该区间为[0.75,1)
2.由于0.63215699在[0.6,0.75)中,所以x2=2
l(3)=0.5+(0.75-0.6)Fx(x3-1)=0.6+0.15Fx(x3-1)
u(3)=0.5+(0.75-0.6)Fx(x3)=0.6+0.15Fx(x3)
若x3=1,则该区间为[0.6,0.63)
若x3=2,则该区间为[0.63,0.675)
若x3=3,则该区间为[0.675,0.75)
3.由于0.63215699在[0.63,0.675)中,所以x3=2
l(4)=0.63+(0.675-0.625)Fx(x4-1)=0.63+0.045Fx(x4-1)
u(4)=0.63+(0.675-0.625)Fx(x4)=0.63+0.045Fx(x4)
若x4=1,则该区间为[0.63,0.639)
若x4=2,则该区间为[0.639,0.6525)
若x4=3,则该区间为[0.6525,0.675)
4.由于0.63215699在[0.63,0.639)中,所以x4=1
l(5)=0.63+(0.639-0.63)Fx(x5-1)=0.63+0.009Fx(x5-1)
u(5)=0.63+(0.639-0.63)Fx(x5)=0.63+0.009Fx(x5)
若x5=1,则该区间为[0.63,0.6318)
若x5=2,则该区间为[0.6318,0.6345)
若x5=3,则该区间为[0.6345,0.639)
5.由于0.63215699在[0.6318,0.6345)中,所以x5=2
l(6)=0.6318+(0.6345-0.6318)Fx(x6-1)=0.6318+0.0027Fx(x6-1)
u(6)=0.6318+(0.6345-0.6318)Fx(x6)=0.6318+0.0027Fx(x6)
若x6=1,则该区间为[0.6318,0.63234)
若x6=2,则该区间为[0.63234,0.63315)
若x6=3,则该区间为[0.63315,0.63345)
6.由于0.63215699在[0.6318,0.63234)中,所以x6=1
l(7)=0.6318+(0.63234-0.6318)Fx(x7-1)=0.6318+0.00054Fx(x7-1)
u(7)=0.6318+(0.63234-0.6318)Fx(x7)=0.6318+0.00054Fx(x7)
若x7=1,则该区间为[0.6318,0.631908)
若x7=2,则该区间为[0.631908,0.63207)
若x7=3,则该区间为[0.63207,0.63234)
7.由于0.63215699在[0.63207,0.63234)中,所以x7=3
l(8)=0.63207+(0.63234-0.63207)Fx(x8-1)=0.63207+0.00027Fx(x8-1)
u(8)=0.63207+(0.63234-0.63207)Fx(x8)=0.63207+0.00027Fx(x8)
若x8=1,则该区间为[0.63207,0.632124)
若x8=2,则该区间为[0.632124,0.632205)
若x8=3,则该区间为[0.632205,0.63234)
8.由于0.63215699在[0.632124,0.632205)中,所以x8=2
l(9)=0.632124+(0.632205-0.632124)Fx(x9-1)=0.632124+0.000081Fx(x9-1)
u(9)=0.632124+(0.632205-0.632124)Fx(x9)=0.632124+0.000081Fx(x9)
若x9=1,则该区间为[0.632124,0.6321402)
若x9=2,则该区间为[0.6321402,0.6321645)
若x9=3,则该区间为[0.6321645,0.632205)
9.由于0.63215699在[0.6321402,0.6321645)中,所以x9=2
l(10)=0.6321402+(0.6321645-0.6321402)Fx(x10-1)=0.6321402+0.00006243Fx(x10-1)
u(10)=0.6321402+(0.6321645-0.6321402)Fx(x10)=0.6321402+0.00006243Fx(x10)
若x10=1,则该区间为[0.6321402,0.63214506)
若x10=2,则该区间为[0.63214506,0.63215235)
若x10=3,则该区间为[0.63215235.0.6321645)
10.由于0.63215699在[0.63215235,0.6321645)中,所以x10=3
所以该序列为3221213223即a3a2a2a1a2a1a3a2a2a3