GCSE Computer Science · 1.2.5
Compression
Name
Class
Date
Mark / 29
Section A
Circle the letter of the correct answer. One mark each.
- 1What is the main purpose of compression?1
- ATo protect a file with a password
- BTo reduce file size so less storage is used and transmission is faster
- CTo improve the quality of a file
- DTo convert a file into binary
- 2Which statement about lossy compression is correct?1
- AAll data is retained and the original can be restored
- BSome data is permanently removed and cannot be recovered
- CIt only works on text files
- DIt increases the file size
- 3Which of these uses lossless compression?1
- AA streamed video
- BAn MP3 file
- CA ZIP archive
- DA JPEG image
- 4Why must a program file be compressed using a lossless method?1
- ARemoving any data would corrupt the instructions and the program would not run
- BLossy compression only works on images
- CLossless compression is always faster
- DProgram files are too small for lossy compression
- 5How does lossless compression reduce file size?1
- ABy reducing the sample rate
- BBy converting the file to a lower resolution
- CBy deleting the least important pixels
- DBy recording repeated data more efficiently so it can be perfectly reconstructed
- 6A user saves a photograph as a JPEG, opens it, and saves it as a JPEG again several times. What happens?1
- AQuality degrades further with each save
- BThe file size grows each time
- CThe image is restored to its original quality
- DNothing changes after the first save
- 7Which is the strongest reason a music streaming service uses lossy compression?1
- ALossless cannot be used for audio
- BLossy compression is free and lossless is not
- CMuch smaller files mean faster streaming and far less bandwidth used
- DLossy files sound better than the original
- 8What happens to a lossless compressed file when it is decompressed?1
- AIt loses a small amount of quality
- BIt is restored exactly to the original
- CIt becomes a lossy file
- DIt stays compressed
- 9A hospital must store patient scan images for legal review. Which compression should be used?1
- ALossless, because losing any detail could affect a diagnosis
- BNo compression is possible on images
- CLossy, because the files would be smaller
- DLossy, because scans are not important
- 10Which pair of formats are both lossy?1
- APNG and MP3
- BZIP and GIF
- CPNG and FLAC
- DMP3 and JPEG
Section B
Answer in the space provided. The number of marks tells you how many separate points to make.
- 1StateState two reasons why files are compressed.2
- 2ExplainExplain the difference between lossy and lossless compression.4
- 3ExplainA company needs to email a large spreadsheet containing financial records to its accountant. Explain which type of compression should be used and why.4
- 4DescribeDescribe how lossless compression is able to reduce the size of a file without losing any data.3
- 5EvaluateA video streaming service compresses all of its films using lossy compression. Evaluate this decision.6
Mark scheme
Section A
Section B
1 State two reasons why files are compressed. 2
One mark for each of the following, to a maximum of 2.
- Uses less storage space
- Faster to transmit or download because less data is sent
Model answer. Files are compressed so that they take up less storage space on a device, allowing more files to be stored. They are also compressed so that they can be transmitted more quickly across a network, because there is less data to send, which reduces both the download time and the bandwidth used.
2 Explain the difference between lossy and lossless compression. 4
One mark for each of the following, to a maximum of 4.
- Lossy permanently removes some of the data from the file
- The original file cannot be recovered after lossy compression
- Lossless reduces size without removing any data
- The original file can be perfectly restored when decompressed
Model answer. Lossy compression reduces file size by permanently removing some of the data, typically detail that the human eye or ear is unlikely to notice, such as very high frequencies in audio or subtle colour differences in an image. Because the data has been deleted, the original file cannot be recovered from the compressed version. Lossless compression reduces file size without removing any data at all, instead recording the information more efficiently by identifying repetition and encoding it compactly. When a losslessly compressed file is decompressed, the original is restored exactly, byte for byte.
3 A company needs to email a large spreadsheet containing financial records to its accountant. Explain which type of compression should be used and why. 4
One mark for each of the following, to a maximum of 4.
- Lossless compression should be used
- Every value in a financial spreadsheet is significant
- Lossy compression would permanently remove data, corrupting the records
- Lossless still reduces the size so it is quicker to email, and the file opens exactly as it was
Model answer. The company should use lossless compression, for example by placing the spreadsheet in a ZIP archive. In a financial spreadsheet every single figure is significant, and the accountant needs the file to be exactly as it was created. Lossy compression works by permanently discarding data that is judged unimportant, and applied to a spreadsheet this would destroy or alter values, producing records that are inaccurate and legally worthless. Lossless compression still makes the file meaningfully smaller, so it attaches and sends more quickly and is less likely to hit an email size limit, but when the accountant decompresses it the spreadsheet is restored exactly as it was, with every value intact.
4 Describe how lossless compression is able to reduce the size of a file without losing any data. 3
One mark for each of the following, to a maximum of 3.
- It identifies repeated data or patterns within the file
- The repetition is recorded more efficiently, for example storing a value once with a count
- The original can be reconstructed exactly from this record
Model answer. Lossless compression works by finding repetition within the data rather than throwing anything away. The algorithm identifies patterns and sequences that occur more than once, and records them more efficiently, for example by storing a repeated value a single time together with a count of how many times it should appear, or by building an index of common sequences and replacing each occurrence with a short reference to that index. Because the record contains everything needed to rebuild the original, decompression reconstructs the file exactly as it was, so no data is lost.
5 A video streaming service compresses all of its films using lossy compression. Evaluate this decision. 6
One mark for each of the following, to a maximum of 6.
- Lossy gives a much greater reduction in file size than lossless
- Smaller files use less bandwidth, allowing streaming without buffering
- Less storage is needed on the servers, reducing cost
- Some quality is permanently lost
- The removed data is chosen to be least noticeable to viewers, so the impact is limited
- Concludes that lossy is appropriate here, with a caveat such as keeping lossless masters
Model answer. Using lossy compression is the right decision for a streaming service. Lossy compression achieves a far greater reduction in file size than lossless could, often reducing a film to a small fraction of its original size, and this directly determines whether streaming is viable at all. Smaller files require far less bandwidth per viewer, which means films start quickly and play without buffering even on slower home connections, and it also means the service can serve many more simultaneous viewers from the same infrastructure. Storage costs fall too, since a library of thousands of films takes up a fraction of the space it otherwise would. The cost is that quality is permanently reduced and the original cannot be recovered from the compressed copy. However, lossy video compression is designed to discard the information the human visual system is least sensitive to, so on a typical television or phone screen most viewers notice little or no difference. On balance the decision is correct, because without lossy compression streaming at scale would be impossible. The service should, however, retain uncompressed or losslessly compressed master copies of each film, so that higher quality versions can be produced in future as bandwidth improves, rather than being permanently limited by today's compressed files.