Invitation to Computer Science 8th Edition

Published by Cengage Learning
ISBN 10: 1337561916
ISBN 13: 978-1-33756-191-4

Chapter 4 - Exercises - Page 218: 17c

Answer

11100 0111 1111111 0111 11101 00 10 Saving : -1 (it requires one bit more than normal 4-Bit representation)

Work Step by Step

Value of M is 11100, O is 0111, L is 1111111, K is 11101, A is 00 and I is 10 according to the Variable-Length Encoding, meaning a total of 29 bits. With the 4-Bit Encoding it would take 7*4 = 28 bits. The difference is 28-29=-1 bits. Converting MOLOKAI to variable length code requires one bit more than 4-bit representation because it mostly consists of less frequent letters like M,L etc. which need more bits in variable length encoding.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.