第三次作业
参考书《数据压缩导论(第4版)》 Page 100
答:
5.
从概率模型可知:
Fx(k)=0, k≤0, Fx(1)=0.2, Fx(2)=0.5, Fx(3)=1, k>3.
我们可以利用公式确定标签所在的上下限。将u(0)初始化为1,将l(0)初始化为0。
该序列的第1个元素为a1,由上界、下界公式得标签所在区间上下界:
l(1) =0+(1-0)Fx(0)=0
u(1) =0+(1-0)Fx(1)=0.2
该标签包含在区间[0,0.2)中,该序列的第2个元素为a1,得:
l(2) =0+(0.2-0)Fx(0)=0
u(2) =0+(0.2-0)Fx(1)=0.04
标签所在的区间为[0,0.04)。该序列的第3个元素为a3,得:
l(3) =0+(0.04-0)Fx(2)=0.02
u(3) =0+(0.04-0)Fx(3)=0.04
标签所在的区间为[0.02,0.04)。该序列的第4个元素为a2,得:
l(4) =0.02+(0.04-0.02)Fx(1)=0.024
u(4) =0.02+(0.04-0.02)Fx(2)=0.03
标签所在的区间为[0.024,0.03)。该序列的第5个元素为a3,得:
l(5) =0.024+(0.03-0.024)Fx(2)=0.027
u(5) =0.024+(0.03-0.024)Fx(3)=0.03
标签所在的区间为[0.027,0.03)。该序列的第6个元素为a1,得:
l(6) =0.027+(0.03-0.027)Fx(0)=0.027
u(6) =0.027+(0.03-0.027)Fx(1)=0.0276
所以:Tag(a1a1a3a2a3a1)=(0.027+0.0276)/2=0.0273
6.
从概率模型可知:
Fx(k)=0, k≤0, Fx(1)=0.2, Fx(2)=0.5, Fx(3)=1, k>3.
设u(0)=1,l(0)=0
l(1)=0+(1-0)Fx(x1-1)=Fx(xk-1)
u(1)=0+(1-0)Fx(x1)=Fx(xk)
若xk=1,则该标签所在区间为[0,0.2)
若xk=2,则该标签所在区间为[0.2,0.5)
若xk=3,则该标签所在区间为[0.5,1)
由于0.63215699在[0.5,1)中,所以xk=3,该序列的第一个元为a3
l(2)=0.5+0.5Fx(xk-1)
u(2)=0.5+0.5Fx(xk)
若xk=1,则该标签所在区间为[0.5,0.6)
若xk=2,则该标签所在区间为[0.6,0.75)
若xk=3,则该标签所在区间为[0.75,1)
由于0.63215699在[0.6,0.75)中,所以xk=2,该序列的第二个元为a2
l(3)=0.6+0.15Fx(xk-1)
u(3)=0.6+0.15Fx(xk)
若xk=1,则该标签所在区间为[0.6,0.63)
若xk=2,则该标签所在区间为[0.63,0.675)
若xk=3,则该标签所在区间为[0.675,0.75)
由于0.63215699在[0.63,0.675)中,所以xk=2,该序列的第三个元为a2
l(4)=0.63+0.045Fx(xk-1)
u(4)=0.63+0.045Fx(xk)
若xk=1,则该标签所在区间为[0.63,0.639)
若xk=2,则该标签所在区间为[0.639,0.6525)
若xk=3,则该标签所在区间为[0.6525,0.675)
由于0.63215699在[0.63,0.639)中,所以xk=1,该序列的第四个元为a1
l(5)=0.63+0.009Fx(xk-1)
u(5)=0.63+0.009Fx(xk)
若xk=1,则该标签所在区间为[0.63,0.6318)
若xk=2,则该标签所在区间为[0.6318,0.6345)
若xk=3,则该标签所在区间为[0.6345,0.639)
由于0.63215699在[0.6318,0.6345)中,所以xk=2,该序列的第五个元为a2
l(6)=0.6318+0.0027Fx(xk-1)
u(6)=0.6318+0.0027Fx(xk)
若xk=1,则该标签所在区间为[0.6318,0.63234)
若xk=2,则该标签所在区间为[0.63234,0.63315)
若xk=3,则该标签所在区间为[0.63315,0.6345)
由于0.63215699在[0.6318,0.63234)中,所以xk=1,该序列的第六个元为a1
l(7)=0.6318+0.00054Fx(xk-1)
u(7)=0.6318+0.00054Fx(xk)
若xk=1,则该标签所在区间为[0.6318,0.631908)
若xk=2,则该标签所在区间为[0.631908,0.63207)
若xk=3,则该标签所在区间为[0.63207,0.63234)
由于0.63215699在[0.63207,0.63234)中,所以xk=3,该序列的第七个元为a3
l(8)=0.63207+0.00027Fx(xk-1)
u(8)=0.63207+0.00027Fx(xk)
若xk=1,则该标签所在区间为[0.63207,0.632124)
若xk=2,则该标签所在区间为[0.632124,0.632205)
若xk=3,则该标签所在区间为[0.632205,0.63234)
由于0.63215699在[0.632124,0.632205)中,所以xk=2,该序列的第八个元为a2
l(9)=0.632124+0.000081Fx(xk-1)
u(9)=0.632124+0.000081Fx(xk)
若xk=1,则该标签所在区间为[0.632124,0.6321402)
若xk=2,则该标签所在区间为[0.6321402,0.6321645)
若xk=3,则该标签所在区间为[0.6321645,0.632205)
由于0.63215699在[0.6321402,0.6321645)中,所以xk=2,该序列的第九个元为a2
l(10)=0.6321402+0.0000243Fx(xk-1)
u(10)=0.6321402+0.0000243Fx(xk)
若xk=1,则该标签所在区间为[0.6321402,0.63214506)
若xk=2,则该标签所在区间为[0.63214506,0.63215235)
若xk=3,则该标签所在区间为[0.63215235,0.6321645)
由于0.63215699在[0.63215235,0.6321645)中,所以xk=3,该序列的第十个元为a3
所以该序列为a3a2a2a1a2a1a3a2a2a3