赵月  

5、给定如表4-9所示的概率模型,求出序列a1a1a3a2a3a1 的实值标签。

由题可知:

p(a1)=0.2 ,p(a2)=0.3  ,p(a3)=0.5

我们可以将u(0)初始化为1,将l(0)初始化为0。

可得:

u(1) =0+(1-0)Fx(1)=0.2 

l(1) =0+(1-0)Fx(0)=0

所以a1a1的标签所在的区间为[0,0.2);

可得:

l(2) =0+(0.2-0)Fx(0)=0

u(2) =0+(0.2-0)Fx(1)=0.04

所以序列a1a1的标签所在的区间为[0,0.04);

可得:

l(3) =0+(0.04-0)Fx(2)=0.02

u(3) =0+(0.04-0)Fx(3)=0.04

所以序列a1a1a3的标签所在的区间为[0.02,0.04);

可得:

l(4) =0.02+(0.04-0.02)Fx(1)=0.024

u(4) =0.02+(0.04-0.02)Fx(2)=0.03

所以序列a1a1a3a2的标签所在的区间为[0.024,0.03);

可得:

l(5) =0.024+(0.03-0.024)Fx(2)=0.027

u(5) =0.024+(0.03-0.024)Fx(3)=0.03

所以序列a1a1a3a2a3的标签所在的区间为[0.027,0.03);

可得:

l(6) =0.027+(0.03-0.027)Fx(0)=0.027

u(6) =0.027+(0.03-0.027)Fx(1)=0.0276

所以生成序列a1a1a3a2a3a1的实值标签如下:

Tx(a1a1a3a2a3a1)=(0.027+0.0276)/2=0.0273

 

6、对于表4-9所示的概率模型,对于一个标签为0.63215699的长度为10的序列进行解码。

映射:a1<=>1,a2<=>2,a3<=>3

cdf:Fx(0) =0, Fx(1) =0.2,Fx(2) =P(a1)+P(a2)=0.5,Fx(3) =P(a1)+P(a2)+P(a3)=1.0

上界:U(0)=1,   下界:L(0)=0

已知公式:U(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn)

              L(n)=L(n-1)+(U(n-1)-L(n-1))Fx(xn-1)

当x1=3时,则区间为[0.5,1),标签为0.63215699在区间为[0.5,1)内,所以满足条件;

 

  u(2)=l(1)+(u(1)-l(1))*Fx(x2)=0.5+(1-0.5)*Fx(x2)=0.5+0.5Fx(x2)

   l(2)=l(1)+(u(1)-l(1))*Fx(x2-1)=0.5+(1-0.5)*Fx(x2-1)=0.5+0.5Fx(x2-1)

当x2=2时,则区间为[0.6,0.75),标签为0.63215699在区间为[0.6,0.75)内,所以满足条件;

 

  u(3)=l(2)+(u(2)-l(2))*Fx(x3)=0.6+(0.75-0.6)*Fx(x2)=0.6+0.15Fx(x3)

   l(3)=l(32+(u(2)-l(2))*Fx(x3-1)=0.6+(0.75-0.6)*Fx(x2-1)=0.6+0.15Fx(x3-1)

当x3=2时,则区间为[0.63,0.675),标签为0.63215699在区间为[0.63,0.675)内,所以满足条件;

 

   u(4)=l(3)+(u(3)-l(3))*Fx(x4)=0.63+(0.675-0.63)*Fx(x4)=0.63+0.045*Fx(x4)

     l(4)=l(3)+(u(3)-l(3))*Fx(x4-1)=0.63+(0.675-0.63)*Fx(x4-1)=0.63+0.045*Fx(x4-1)

当x4=1时,则区间为[0.63,0.639),标签为0.63215699在区间为[0.63,0.639)内,所以满足条件;

 

    u(5)=l(4)+(u(4)-l(4))*Fx(x5)=0.63+(0.639-0.63)*Fx(x5)=0.63+0.009*Fx(x5)

     l(5)=l(4)+(u(4)-l(4))*Fx(x5-1)=0.63+(0.639-0.63)*Fx(x5-1)=0.63+0.009*Fx(x5-1)

当x5=2时,则区间为[0.6318,0.6345),标签为0.63215699在区间为[0.6318,0.6345)内,所以满足条件;

 

      u(6)=l(5)+(u(5)-l(5))*Fx(x6)=0.6318+(0.6345-0.6318)*Fx(x6)=0.6318+0.0027*Fx(x6)

       l(6)=l(5)+(u(5)-l(5))*Fx(x6-1)=0.6318+(0.6345-0.6318)*Fx(x6-1)=0.6318+0.0027*Fx(x6-1)

当x6=1时,则区间为[0.6318,0.63234),标签为0.63215699在区间为[0.6318,0.63234)内,所以满足条件;

 

     u(7)=l(6)+(u(6)-l(6))*Fx(x7)=0.6318+(0.63234-0.6318)*Fx(x7)=0.6318+0.00054*Fx(x7)

       l(7)=l(6)+(u(6)-l(6))*Fx(x7-1)=0.6318+(0.63234-0.6318)*Fx(x7-1)=0.6318+0.00054*Fx(x7-1)

当x7=3时,则区间为[0.63207,0.63234),标签为0.63215699在区间为[0.63207,0.63234)内,所以满足条件;

 

     u(8)=l(7)+(u(7)-l(7))*Fx(x8)=0.63207+(0.63234-0.63207)*Fx(x8)=0.63207+0.00027*Fx(x8)

       l(8)=l(7)+(u(7)-l(7))*Fx(x8-1)=0.63207+(0.63234-0.63207)*Fx(x8-1)=0.63207+0.00027*Fx(x8-1)

当x8=2时,则区间为[0.632124,0.632205),标签为0.63215699在区间为[0.632124,0.632205)内,所以满足条件;

 

      u(9)=l(8)+(u(8)-l(8))*Fx(x9)=0.632124+(0.632205-0.632124)*Fx(x9)=0.632124+(8.1e-5)*Fx(x9)

       l(9)=l(8)+(u(8)-l(8))*Fx(x9-1)=0.632124+(0.632205-0.632124)*Fx(x9-1)=0.632124+(8.1e-5)*Fx(x9-1)

当x9=2时,则区间为[0.6321402,0.6321645),标签为0.63215699在区间为[0.6321402,0.6321645)内,所以满足条件;

 

      u(10)=l(9)+(u(9)-l(9))*Fx(x10)=0.6321402+(0.6321645-0.6321402)*Fx(x10)=0.6321402+(2.43e-5)*Fx(x10)

       l(10)=l(9)+(u(9)-l(9))*Fx(x10-1)=0.6321402+(0.6321645-0.6321402)*Fx(x10-1)=0.6321402+(2.43e-5)*Fx(x10-1)

当x10=3时,则区间为[0.63215235,0.6321645),标签为0.63215699在区间为[0.63215235,0.6321645)内,所以满足条件。

 

综上可得对于一个标签为0.63215699的长度为10的序列进行解码结果为:3221213223

posted on 2015-09-28 11:07  赵月  阅读(95)  评论(0编辑  收藏  举报