OCR J277 GCSE Computer Science · 1.2 Memory and Storage
Stretch tasks Compression
Quiz Challenge
A quiz game against four computer players, then short and long written answers.
- Quiz Blitz12 questions against the clock
- Quick Fire4 short answers
- Big Think2 long answers
About 20 minutes
This or That
Pixel the cat asks 8 questions. Each has two answers: pick the right one.
- Two answers to every question
- A fish treat for every right answer
- Streaks win Pixel shades, then a party hat
About 4 minutes
Memory Match
Flip the cards two at a time to match each term card to its meaning card.
- 12 cards: each term has a meaning
- One peek at every card
- Combo points for pairs found in a row
6 pairs, about 4 minutes
Sort It
Sort each statement into the right box, like the tick-box tables in the exam.
- 12 cards to sort into 2 boxes
- Drag a card, tap a box or press its number
- Combo points for cards sorted in a row
12 cards, about 4 minutes
The games need JavaScript. Every question is below, with the answers at the end.
Compression: the questions
Quiz Challenge, round 1: Quiz Blitz
What is compression?
- Copying a file to the cloud
- Reducing the size of a file
- Making a file more secure
- Converting a file to binary
Which TWO are reasons to compress a file?
Tick 2.
- It sends faster over a network
- It makes the file more secure
- It improves the quality
- It adds metadata
- It uses less storage space
What does lossy compression do?
- Adds data to correct errors
- Permanently removes some data
- Removes no data at all
- Encrypts the file
A lossy file can be restored to its original quality later.
- True
- False
Which is a lossless format?
- PNG
- JPEG
- MP3
- MP4
Which file must use lossless compression?
- A program file
- A photo for a web page
- A song for streaming
- A video clip for social media
Run-length encoding turns AAAAABBB into 5A 3B. What does CCCCCCDD become?
Why does lossy compression shrink files more than lossless?
- It only works on text
- It throws data away
- It uses a faster algorithm
- It stores data in hexadecimal
Saving a JPEG again and again can make it look worse each time.
- True
- False
Which TWO are lossy formats?
Tick 2.
- MP3
- ZIP
- PNG
- FLAC
- JPEG
A photographer keeps master copies to edit later. Which compression suits them?
- No compression is ever used for photos
- Lossless, so no quality is lost with each edit
- Lossy, so the files are tiny
- Lossy, so the colours are brighter
What does lossy compression remove from a song?
- The lyrics
- The loudest parts
- Sounds most people cannot hear
- Every other note
Quiz Challenge, round 2: Quick Fire
Give two reasons why files are compressed. [2 marks]
Explain why a spreadsheet must not be compressed with lossy compression. [2 marks]
Describe how run-length encoding compresses AAAAAAAABBBB. [2 marks]
Explain one advantage and one disadvantage of lossy compression. [2 marks]
Quiz Challenge, round 3: Big Think
For each file, choose lossy or lossless compression and justify your choice: a film streamed to phones, and a legal contract. [4 marks]
Compare lossy and lossless compression. [6 marks]
This or That: tick the right answer
Which format is lossy?
- PNG
- JPEG
Which shrinks a file more?
- Lossless
- Lossy
A JPEG is saved again as a PNG. What happens to the detail it lost?
- It stays lost
- It comes back
Which suits a ZIP of a program's files?
- Lossless
- Lossy
What does AAAABBBCC become with run-length encoding?
- 3A 4B 2C
- 4A 3B 2C
Why does compression help streaming?
- There is less data to send
- The screen gets brighter
What does lossless compression look for?
- Repetition it can record compactly
- Data people will not notice
What matters most for a photo on a web page?
- Small size and fast loading
- Every last detail
Memory Match: match each term to its meaning
| Term | Meaning |
|---|---|
| A Lossy | 1 Reducing the size of a file |
| B Lossless | 2 Data a connection carries per second |
| C JPEG | 3 Original restored perfectly |
| D PNG | 4 Permanently removes some data |
| E Bandwidth | 5 A lossy image format |
| F Compression | 6 A lossless image format |
Sort It: tick one box in each row
Lossy or lossless?
| Statement | Lossy | Lossless |
|---|---|---|
| Permanently removes data people will not notice | ||
| JPEG photos | ||
| Saving again and again makes it worse | ||
| Streaming video | ||
| Records repetition, such as 8A 4B 8C | ||
| Gives the biggest reduction in size | ||
| FLAC audio | ||
| ZIP archives | ||
| PNG images | ||
| The original can be restored perfectly | ||
| MP3 music | ||
| Must be used for program files |
Answers
Round 1: Quiz Blitz
- Reducing the size of a file Smaller files use less storage and travel faster over a network.
- It uses less storage space; It sends faster over a network Less space, faster transmission and less bandwidth.
- Permanently removes some data It throws away detail people are least likely to notice.
- False The removed data is gone for good.
- PNG PNG, GIF, ZIP and FLAC are lossless. JPEG, MP3 and MP4 are lossy.
- A program file Removing any part of a program would corrupt its instructions.
- 6C 2D Six Cs then two Ds: 6C 2D.
- It throws data away Lossless can only describe the data more efficiently. Lossy removes some of it.
- True Each lossy save throws away a little more.
- JPEG; MP3 JPEG and MP3 remove data. ZIP, PNG and FLAC keep every bit.
- Lossless, so no quality is lost with each edit Masters must survive repeated editing without building up damage.
- Sounds most people cannot hear Frequencies too high or too quiet for most people to hear go first.
Round 2: Quick Fire
- They take up less storage space
- They are faster to send, using less bandwidth
Model answerCompressed files take up less storage space, and they are faster to send over a network because there is less data.
- Lossy compression permanently removes data
- Values would be missing or wrong, corrupting the spreadsheet
Model answerLossy compression permanently removes data, so some values would be missing or wrong, corrupting the spreadsheet.
- It records each run as a count and the character
- Giving 8A 4B
Model answerIt replaces each run of the same character with a count and the character, so AAAAAAAABBBB becomes 8A 4B.
- Advantage: much smaller files
- Disadvantage: quality is lost permanently, and the original cannot be restored
Model answerAdvantage: files become much smaller, so they load and stream faster. Disadvantage: some quality is lost permanently, and the original cannot be restored.
Round 3: Big Think
- Film: viewers will not notice the removed detail
- Film: a much smaller file streams faster and uses less data
- Contract: every word matters, so losing data could change the meaning
- Contract: lossless restores the original perfectly
Model answerThe film should use lossy compression. The data it removes is detail viewers will not notice on a phone, and the much smaller file streams faster and uses less data. The legal contract must use lossless compression, because every word matters: losing data could change the meaning. Lossless lets the original be restored perfectly.
- Lossy permanently removes data
- Lossy: the original cannot be recovered
- Lossy gives a much bigger reduction in size
- Lossy reduces the quality
- Lossless removes no data, so the original is restored perfectly
- Lossless gives a smaller reduction in size
- Gives examples, such as JPEG and MP3, or ZIP and PNG
- Lossless works by recording repetition more efficiently
Model answerLossy compression permanently removes data that people are unlikely to notice, so the original cannot be recovered. That gives a much smaller file, but the quality is reduced. It is used for JPEG photos, MP3 music and streaming video. Lossless compression removes no data: it records repeated patterns more efficiently, so the original is restored perfectly. It gives a smaller reduction in size, so files stay bigger, but it is essential for program files, documents and ZIP archives, where every byte matters.
This or That
- JPEG JPEG throws away detail. PNG is lossless.
- Lossy Lossy removes data, so it can make files far smaller.
- It stays lost Lossy is irreversible: saving as PNG only stops any further loss.
- Lossless Every byte of a program matters, so nothing can be removed.
- 4A 3B 2C Four As, three Bs and two Cs.
- There is less data to send Smaller files travel faster and use less bandwidth.
- Repetition it can record compactly Lossless describes repeated data more efficiently. Lossy hunts for data people will not notice.
- Small size and fast loading Visitors will not notice small losses, but they will notice a slow page, so lossy suits it.
Memory Match
- A 4 Lossy: Permanently removes some data
- B 3 Lossless: Original restored perfectly
- C 5 JPEG: A lossy image format
- D 6 PNG: A lossless image format
- E 2 Bandwidth: Data a connection carries per second
- F 1 Compression: Reducing the size of a file
Sort It
- Lossy Permanently removes data people will not notice That is exactly what lossy compression does.
- Lossy JPEG photos JPEG removes colour detail the eye barely notices.
- Lossy Saving again and again makes it worse Each lossy save removes a little more detail.
- Lossy Streaming video Small files matter far more than tiny details when streaming.
- Lossless Records repetition, such as 8A 4B 8C Run-length encoding is a lossless method.
- Lossy Gives the biggest reduction in size Throwing data away shrinks files the most.
- Lossless FLAC audio FLAC shrinks music without losing any of it.
- Lossless ZIP archives A ZIP must give back every file exactly.
- Lossless PNG images PNG keeps every pixel exactly.
- Lossless The original can be restored perfectly No data is removed, so nothing is lost.
- Lossy MP3 music MP3 removes sounds most people cannot hear.
- Lossless Must be used for program files Losing any part of a program would corrupt it.