230k views
2 votes
Here's the same compressed text that you saw on the last level, but now we also see the size of the original, uncompressed text. On the previous level you reconstructed the text by tracing back through the dictionary. Now we're going to think about if this is a "good" compression rate.

Compressed Dictionary: bu the Compressed text size: 17 bytes Dictionary size: 26 bytes Total: 43 bytes Original text size: 58 bytes
In the text box below, answer the following two questions:
What is the compression rate? The compression rate says by how much the text was compressed from the original as a percentage. Don't forget that the compressed version of the text is the compressed text size + dictionary size. (see note below)
Is this a "good" compression rate? Why or why not?
(NOTE: to calculate, the compression rate is slightly different than simply stating the compressed size as a fraction of the original. It's just opposite sides of the same coin. For example: if you find the compressed text + dictionary size is 70% of the original, that means the text was compressed by 30%.)

User Akbiggs
by
4.2k points

1 Answer

5 votes

Answer and Explanation:

The compression rate says by how much the text was compressed from the original as a percentage. Don't forget that the compressed version of the text is the compressed text size + dictionary size.

From the given picture:

compressed text size = 17 bytes

dictionary size = 26 bytes

compressed text size + dictionary size = 17 + 26 = 43 bytes

original test size = 58 bytes

compression rate as percentage = (43 / 58) * 100 = 74.14% ( rounded to two decimal )

Space savings = 100 - compression rate

= 100 - 74.14 = 25.86%

Is this a "good" compression rate? Why or why not?

Compression data is a heuristic problem. It’s hard to say the exact compression rate that is good or bad. If you feel satisfied by ~ 26% of compression, then it is a good compression rate.

The compression rate above frees up 26% space for you, so that you can put additional information

without losing information. In that way it is a good compression rate.

User Zhi Rui
by
4.7k points