0% found this document useful (0 votes)
60 views1 page

Arithmetic Coding and Decoding Programs

The document discusses arithmetic coding and its applications. It includes generating an arithmetic code tag for a given string, examples of uniquely decodable codes, decoding an arithmetic tag given probabilities of characters, and implementing a digram coding algorithm to generate tokens for a string using an initial dictionary.

Uploaded by

JAIMINCHAVDA
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views1 page

Arithmetic Coding and Decoding Programs

The document discusses arithmetic coding and its applications. It includes generating an arithmetic code tag for a given string, examples of uniquely decodable codes, decoding an arithmetic tag given probabilities of characters, and implementing a digram coding algorithm to generate tokens for a string using an initial dictionary.

Uploaded by

JAIMINCHAVDA
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like