首页 > 代码库 > 第四次作业

第四次作业

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

习题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的序列进行解码。

 解:

  由表4-9可以知道F(x1)=0.2,F(x2)=0.5,F(x3)=1.

 先假设 l(0)=0,u(0)=1.

(1)  t*=(0.63215699-0)/(1-0)=0.63215699

     Fx(2)=0.5<= t*<= Fx(3)=1

     l(1)= l(0)+( u(0)- l(0)) Fx(2)=0.5

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

     则第一个字符为a3

(2) t*=(0.63215699-0.5)/(1-0.5)=0.26431398

     Fx(1)=0.2<= t*<= Fx(2)=0.5

     l(2)= l(1)+( u(1)- l(1)) Fx(1)=0.6

     u(2)= l(1)+( u(1)- l(1)) Fx(2)=0.75

     则第二个字符为a2

(3)  t*=(0.63215699-0.6)/(0.75-0.6)=0.21437993

     Fx(1)=0.2<= t*<= Fx(2)=0.5

     l(3)= l(2)+( u(2)- l(2) Fx(1)=0.63

     u(3)= l(2)+( u(2)- l(2)) Fx(2)=0.635

     则第三个字符为a2

(4) t*=(0.63215699-0.63)/(0.635-0.63)=0.431398

      Fx(1)=0.2<= t*<= Fx(2)=0.5

       l(4)= l(3)+( u(3)- l(3)) Fx(1)=0.631

       u(4)= l(3)+( u(3)- l(3)) Fx2)=0.6325

       则第四个字符为a2

(5)  t*=(0.63215699-0.631)/(0.6325-0.631)=0.77132667

        Fx(2)=0.5<= t*<= Fx(3)=1

        l(5)= l(4)+( u(4)- l(4)) Fx(2)=0.63175

        u(5)= l(4)+( u(4)- l(4)) Fx(3)=0.6325

       则第五个字符为a3

(6) t*=(0.63215699-0.63175)/(0.6325-0.63175)=0.5426533

         Fx(2)=0.5<= t*<= Fx(3)=1

          l(6)= l(5)+( u(5)- l(5)) Fx(2)=0.632125

          u(6)= l(5)+( u(5)- l(5)) Fx(3)=0.6325

         则第六个字符为a3

(7)     t*=(0.63215699-0.632125)/(0.6325-0.632125)=0.04265333

           Fx(k)=0<= t*<= Fx(1)=0.2

           l(7)= l(6)+( u(6)- l(6)) Fx(0)=0.632125

           u(7)= l(6)+( u(6)- l(6)) Fx(1)=0.632275

           则第七个字符为a1

(8)  t*=(0.63215699-0. 632125)/(0. 632125-0. 632275)=0.21326667

            Fx(1)=0.2<= t*<= Fx(2)=0.5

            l(8)= l(7)+( u(7)- l(7)) Fx(1)=0.632155

            u(8)= l(7)+( u(7)- l(7)) Fx(5)=0.6322

           则第八个字符为a2

(9)  t*=(0.63215699-0.632155)/(0.6322-0. 632155)=0.04422222

            Fx(0)=0<= t*<= Fx(1)=0.2

            l(9)= l(8)+( u(8)- l(8)) Fx(0)=0.632155

            u(9)= l(8)+( u(8)- l(8)) Fx(1)=0.632164

            则第九个字符为a1

(10) t*=(0.63215699-0.632155)/(0.632164-0.632155)=0.22111111

           Fx(1)=0.2<= t*<= Fx(2)=0.5

           l(10)= l(9)+( u(9)- l(9)) Fx(1)=0.6321568

           u(10)= l(9)+( u(9)- l(9)) Fx(2)=0.6321595

           则第十个字符为a2

           所以标签值为0.63215699的长度为10的序列解码后的序列为:a3a2a2a2a3a3a1a2a1a2

第四次作业