[SOLVED] Text Compression
Im stuck on a Computer Science question and need an explanation.
Individual Homework: Text Compression In class we discussed measures of compression and a kind of text compression known as LempelZiv. Practice with these concepts in this homework. Compression measures 1. I have a particular image I want to save. In TIFF format (uncompressed) it is 39,526 bytes. In PNG format, it is 8,494 bytes. a. What is the compression ratio? (uncompressed size/compressed size, expressed as a ratio) b. What is the space savings? (1 compressed/original) 2. I have a sound effect I want to use in a video game. I downloaded it in WAV format (uncompressed). The file size is 1.2 MB. I used iTunes to create an MP3 (compressed) version. The file size of the compressed version is 46 KB. a. What is the compression ratio? (uncompressed size/compressed size, expressed as a ratio) b. What is the space savings? (1 compressed/original) Text compression Now consider the following text (69 bytes): HOW MUCH WOOD WOULD A WOODCHUCK CHUCK IF A WOODCHUCK COULD CHUCK WOOD 3. Compress this as well as you can using Lempel-Ziv encoding. You can use the text compression widget on Code.org. Write down each of the following: a. Dictionary (symbols and substitutions) b. Dictionary size (in bytes) c. Encoded text d. Encoded text size (in bytes) e. Total compressed size (dictionary + encoded text) f. Space savings (1 compressed/original)