Homework 4 Solution

# 0000 1 1111 0000 1 1111 0 0000 1 0 1111 11 0000 00 11

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 000 00 111 11 00 111 11111 00000 1111111 11 11 1 1 11 11 11 0000000 00 00 0 0 00 00 00 111 000 11 00 111 000 11 1 00 0 111 000 11111 00000 111 000 1 1 1 11 11 1 1 1 11 11 0 0 0 00 00 0 0 0 00 00 1 2 3 4 5 6 7 8 9 10 1 0 1111 0000 1 0 1 0 1 1111 0 0 0000 1 1111 0000 1 1111 0 0000 1 0 1111 11 0000 00 11 1111 00 0000 11 00 111 000 1 0 1 11 00 11 00 11 00 1 111 000 00 11 00 1 11 00 11 00 0 11 1 111111 00 0 000000 11 00 1111 0000 111 000 11 00 1 11 0 00 11111 111111 00000 000000 11 00 11 1 00 0 1 0 1 11 0 00 1 0 111 1 111 11 000 0 000 00 11 00 1 0 1 11 0 00 11 00 111 000 10 000 00 11 00 111 11 1 00 111 0001 11 111 11 0 00 000 00 1 0 000 1 00 0 1 11 011 0 111 1 000 0 1 0 1 111 0 000 1 1 00 0 11 111 11 11111 0 000 00 00000 1 1 0 111 1 000 0 1 0 1 111 1 0 000 0 1 0 11 111 11 000 00 111 000 1 1 0 1 0 1 11 0 00 11 00 1 0 111 0 000 6 111 000 11 00 9 1 0 78 111 0001 111 000 11 00 1 0 0 111 000 111 000 11 00 1 0 01 111 1 000 0 11 00 111 000 111 000 11 00 1 0 1 0 11 00 111 1 000 0 11 00 1 0 11 00 111 000 3 11 00 45 111 0001 11 00 0 111 000 11 00 111 000 11 00 11 1 00 0 11 1 00 0 1 2 We thus have the following preﬁx-free code: symbol relative frequency codeword a 1 00000 b 2 00001 c 3 0001 d 4 1100 e 5 1101 f 6 001 g 7 100 h 8 101 i 9 111 j 10 01 (b) From (a), the expected length of a codeword is 1 (1(5) 55 + 2(5) + 3(4) + 4(4) + 5(4) + 6(3) + 7(3) + 8(3) + 9(3) + 10(2)) = For a message with 1000 symbols, we would therefore expect to use a total of (1000)(173/55) ≈ 3145.45 0’s and 1’s. 5 173 55 ≈ 3.14545....
View Full Document

## This note was uploaded on 01/13/2014 for the course MAD 5305 taught by Professor Suen during the Spring '12 term at University of South Florida.

Ask a homework question - tutors are online