Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Binary Binary numbers are a crucial concept in the field of computer science. Computers are built on top of the binary number system, and many
Binary
Binary numbers are a crucial concept in the field of computer science. Computers are built on top of the binary number system, and many algorithms make use of binary numbers. In this assignment, you will be taking a look at one application involving binary numbers.
Run Length Encoding
It is sometimes important to minimize the space used for storing data. This idea of data compression can be implemented in many forms. One of the simpler techniques is known as Run Length Encoding RLE RLE takes advantage of the fact that in many cases, data will contain a run of repeated s or s and these runs can be represented by a shorter code. RLE is a technique used in some image or sound formats to reduce the overall size of the file. There are many variations of this process, but for this assignment, you will use the bit encoding version described below.
Given binary data represented by a sequence of s and s break the number into runs of s and s and note the length of each run.
For any run of more than break the run into groups of or smaller.
For each run, create an encoded form by first placing the type of run or and then the binary representation of the run's length.
Write out the encoded form of data by taking each encoded run and separating them with spaces. Be sure to keep the original order of the data intact.
Example:
Given what is the RLE form of this data?
Breaking this into runs gives us ssssss
For each group, combine the length in binary followed by the type of run. Use spaces to
separate each run:
Data compression is the ratio of the compressed data over the uncompressed data. In this case, the compressed data is bits including the spaces, which must be counted and the original data is bits. This gives a data compression ratio of or
Answer the following questions.
What is the RLE of the following inputs?
a
b
c
For each of your answers to question compute the data compression ratio.
Why must runs over be split apart in this bit encoding
scheme?
Will this technique always result in a smaller RLE string
compared with the original data? Explain why or why not.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started