1.1. Assume you have a source alphabet that includes the 5 symbols {a, b, c, d,
ID: 3750601 • Letter: 1
Question
1.1. Assume you have a source alphabet that includes the 5 symbols {a, b, c, d, (eof)}, and that your table is initialized with these symbols. Encode the following sequence using the LZW algorithm: “abbadabbadabbadabbadabbacadabbacadabba(eof)”
1.2.Assuming the same 5-symbol alphabet, use a decimal arithmetic code to encode the same message. You may want to write a short computer program to do this, rather than doing it by hand. Initially assume that all symbols have equal probability.
1.3. Repeat question 1.2, using the actual letter frequencies to determine the probability model.
View comments (1)
Explanation / Answer
1.1.
Algorithm:
if yes,
P = P + C
if not then,
1) Output the codeword which denotes P in the codestream
2)Add the string P+C to the dictionary
3)P = C ( this means P contains only the character c)
In this example, the dictionary contains: {a, b, c, d, (eof)}
sequence to be encoded is:: abbadabbadabbadabbadabbacadabbacadabba(eof)
5 eof
y= yes and n= no
same in next + new value = same in next line
like a series (1,2,3,4)
next line (same,5) = (1,2,3,4,5)
cont.. is used to reprsent all the previous string values due to lack of space
"same" and "cont.." is used because space is very short in table...
for example let the old string is :: abbabb
now if we write cont..ba
this means abbabba
For easiness, please tally the previous "current" column and the present current column to understand where we are.
now see the solve::
index symbols 1 a 2 b 3 c 4 dRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.