Purchase Solution

Run length encoding of a bit sequence

Not what you're looking for?

Ask Custom Question

(a) Encode the following bit sequence using run-length encoding with 4-bit codes

eighteen zeroes, 11, fifty-six zeroes, 1, fifteen zeroes, 11.

(b) Encode the same sequence using run-length encoding with 5-bit codes

(c) Compare the two codes. Comment on two choices.

Purchase this Solution

Solution Summary

Solution also discusses two representations for Run Length Encoded sequences and illustrates a scheme to generate the encoded bit sequence with the help of an example.

Solution Preview

In run length encoding (RLE) we normally represent each subsequence of identical symbols by a pair (L,S), where L indicates the length of the subsequence and S indicates the recurring symbol in the sequence. So the encoded sequence will look like -

(L1,S1), (L2,S2), ......, (Ln,Sn)

where two consecutive symbols Si and Si+1 will not be same.

In case of binary sequence, only symbols are 0 and 1. Hence Si will alternate between 0 and 1, which simplifies our RLE sequence to

L1, L2, ...., Ln

However we can't use this simplified representation either in case (a) or ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.