This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: S-72.2410 Information Theory Haanp¨ a¨a & Linja-aho Homework 3, solutions 2009 Homework 3, solutions Deadline: November 23rd, 16:00 The box for returning exercises is in the E-wing, 2nd floor corridor. 1. Apply the two Lempel-Ziv universal coding methods, LZ77 and LZ78, considered in the course to compress the following strings: 111000111000111000111111 110001110000111110000101 Also the compressed strings should be in binary format. Solution: LZ77 for the first string. The string is parsed: 1,110,001,110001110001111,11 and the codewords are (relative position of match, length of the match and first non-matching character): (0,0,1) (1,2,0) (1,2,1) (6,14,1) (1,1,1) For presenting the triplets in binary, we need three bits for the first value (max. value = 6), four bits for the second value (max. value = 14) and one bit for the last value: 000,0000,1 001,0010,0 001,0010,1 110,1110,1 001,0001,1 And for the second string: 1,10,001,110000,1111,1000010,1 (0,0,1) (1,1,0) (0,2,1) (6,5,0) (7,3,1) (9,5,0) (0,0,1) For presenting the triplets in binary, we need four bits for the first value (max. value = 9), three bits for the second value (max. value = 5) and one bit for the last value: 0000,000,1 0001,001,0 0000,010,1 0110,101,0 0111,011,1 1001,101,0 0000,000,1 Note: if you scan backwards and accept the first match (and do not look for the best possible match), you get a different solution and it is ok. There are many slightly different versions of the algorithm. LZ78 for the first string: 1,11,0,00,111,000,1110,001,1111,1 and the codewords (place of match in dictionary, and the non-matching character): (0,1) (1,1) (0,0) (3,0) (2,1) (4,0) (5,0) (4,1) (5,1) For the first value, we need three bits: 000,1 001,1 000,0 011,0 010,1...
View Full Document
This note was uploaded on 10/27/2010 for the course ECE 221 taught by Professor Sd during the Spring '10 term at Huston-Tillotson.
- Spring '10