Data Compression FRQ Practice

Responses receive AI feedback against a rubric after submission. Scores are practice estimates.

Question 1 of 5

Original message: GOOGOOGAAGG. A compressor outputs (GOO,2)(GAA,1)(GG,1) using a dictionary of blocks.

(a) Expand the compressed form and show the resulting string. (b) State whether this process is lossless or lossy for this message. (c) Explain how your answer to (b) follows from comparing original and expanded text.

Question 2 of 5

A 5-sample audio clip has amplitudes [4, 4, 4, 9, 9]. A lossy compressor stores only [4, 9] plus the note "first value repeats 3 times, second repeats 2 times," but then rounds each stored amplitude to the nearest multiple of 5, yielding [5, 10] before expansion.

(a) What sequence is produced after expansion with the rounded values? (b) Compare that sequence to [4, 4, 4, 9, 9]. (c) Explain why the original list cannot be restored from the rounded compressed form.

Question 3 of 5

A legal team must email a scanned contract. Exact wording and signatures must remain recoverable for court. Separately, a flyer photo will be posted online where small color shifts are fine if the file loads quickly.

(a) Recommend lossless or lossy for the contract scan and justify. (b) Recommend lossless or lossy for the flyer photo and justify. (c) Explain why the same algorithm is not ideal for both tasks.

Question 4 of 5

Before compression, a black-and-white fax line is 16 bits: 0000000011111111. Compressor RLE stores (0,8)(1,8). Compressor AVG replaces the line with a single bit equal to the majority value (1).

(a) Expand RLE and state whether the 16-bit original returns. (b) Expand AVG (fill all 16 positions with the majority bit) and compare to the original. (c) Classify each compressor as lossless or lossy for this example.

Question 5 of 5

A teacher says: "If a compressed file is smaller, the compression must be lossy."

(a) Give a concrete counterexample idea (you may invent short strings and sizes). (b) State the correct relationship between file size and lossless/lossy. (c) Describe one situation where a lossy file might still be preferred even though a lossless option exists.