1.
Write a Program to generate Arithmetic Coding Tag for following string.
Input String : "AABCDADCD"
Output Tag :0.044620193
A
A
B
C
D
A
D
C
D
0.166667
0.055556
0.043210
0.043896
0.044810
0.044505
0.044607
0.044613
0.044620
2. Uniquely Decodable Code
1. {0,01,110,1010,0110,10110}
2. {0,10,110,1011,01010,10110}
3. {1,01,1011,1001,10101,11011,101110}
3. Write a program to decode arithmetic tag.
Tag : 0.152102623
Input Data : Prob (A)=0.5, Prob(B)=0.17,Prob(C)=0.33
Output: AABBCCAA
4. Write a program to implement Digram coding algorithm with takes string and initial dictionary
empty as follows and generate tokens.
String:" a a c a a c a b c a b a a a c "
Initial Dictionary :1-a, 2-b, 3-c