OCR J277 GCSE Computer Science · 1.2 Memory and Storage

Stretch tasks Compression

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

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

Task 3

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

Task 4

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.

Read the lesson: Compression

Compression: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. 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
  2. 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
  3. What does lossy compression do?

    • Adds data to correct errors
    • Permanently removes some data
    • Removes no data at all
    • Encrypts the file
  4. A lossy file can be restored to its original quality later.

    • True
    • False
  5. Which is a lossless format?

    • PNG
    • JPEG
    • MP3
    • MP4
  6. 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
  7. Run-length encoding turns AAAAABBB into 5A 3B. What does CCCCCCDD become?

  8. 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
  9. Saving a JPEG again and again can make it look worse each time.

    • True
    • False
  10. Which TWO are lossy formats?

    Tick 2.

    • MP3
    • ZIP
    • PNG
    • FLAC
    • JPEG
  11. 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
  12. 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

  1. Give two reasons why files are compressed. [2 marks]

  2. Explain why a spreadsheet must not be compressed with lossy compression. [2 marks]

  3. Describe how run-length encoding compresses AAAAAAAABBBB. [2 marks]

  4. Explain one advantage and one disadvantage of lossy compression. [2 marks]

Quiz Challenge, round 3: Big Think

  1. For each file, choose lossy or lossless compression and justify your choice: a film streamed to phones, and a legal contract. [4 marks]

  2. Compare lossy and lossless compression. [6 marks]

This or That: tick the right answer

  1. Which format is lossy?

    • PNG
    • JPEG
  2. Which shrinks a file more?

    • Lossless
    • Lossy
  3. A JPEG is saved again as a PNG. What happens to the detail it lost?

    • It stays lost
    • It comes back
  4. Which suits a ZIP of a program's files?

    • Lossless
    • Lossy
  5. What does AAAABBBCC become with run-length encoding?

    • 3A 4B 2C
    • 4A 3B 2C
  6. Why does compression help streaming?

    • There is less data to send
    • The screen gets brighter
  7. What does lossless compression look for?

    • Repetition it can record compactly
    • Data people will not notice
  8. 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

TermMeaning
A Lossy1 Reducing the size of a file
B Lossless2 Data a connection carries per second
C JPEG3 Original restored perfectly
D PNG4 Permanently removes some data
E Bandwidth5 A lossy image format
F Compression6 A lossless image format

Sort It: tick one box in each row

Lossy or lossless?

StatementLossyLossless
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

  1. Reducing the size of a file Smaller files use less storage and travel faster over a network.
  2. It uses less storage space; It sends faster over a network Less space, faster transmission and less bandwidth.
  3. Permanently removes some data It throws away detail people are least likely to notice.
  4. False The removed data is gone for good.
  5. PNG PNG, GIF, ZIP and FLAC are lossless. JPEG, MP3 and MP4 are lossy.
  6. A program file Removing any part of a program would corrupt its instructions.
  7. 6C 2D Six Cs then two Ds: 6C 2D.
  8. It throws data away Lossless can only describe the data more efficiently. Lossy removes some of it.
  9. True Each lossy save throws away a little more.
  10. JPEG; MP3 JPEG and MP3 remove data. ZIP, PNG and FLAC keep every bit.
  11. Lossless, so no quality is lost with each edit Masters must survive repeated editing without building up damage.
  12. 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 answer

    Compressed 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 answer

    Lossy 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 answer

    It 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 answer

    Advantage: 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 answer

    The 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 answer

    Lossy 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

  1. JPEG JPEG throws away detail. PNG is lossless.
  2. Lossy Lossy removes data, so it can make files far smaller.
  3. It stays lost Lossy is irreversible: saving as PNG only stops any further loss.
  4. Lossless Every byte of a program matters, so nothing can be removed.
  5. 4A 3B 2C Four As, three Bs and two Cs.
  6. There is less data to send Smaller files travel faster and use less bandwidth.
  7. Repetition it can record compactly Lossless describes repeated data more efficiently. Lossy hunts for data people will not notice.
  8. 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

  1. Lossy Permanently removes data people will not notice That is exactly what lossy compression does.
  2. Lossy JPEG photos JPEG removes colour detail the eye barely notices.
  3. Lossy Saving again and again makes it worse Each lossy save removes a little more detail.
  4. Lossy Streaming video Small files matter far more than tiny details when streaming.
  5. Lossless Records repetition, such as 8A 4B 8C Run-length encoding is a lossless method.
  6. Lossy Gives the biggest reduction in size Throwing data away shrinks files the most.
  7. Lossless FLAC audio FLAC shrinks music without losing any of it.
  8. Lossless ZIP archives A ZIP must give back every file exactly.
  9. Lossless PNG images PNG keeps every pixel exactly.
  10. Lossless The original can be restored perfectly No data is removed, so nothing is lost.
  11. Lossy MP3 music MP3 removes sounds most people cannot hear.
  12. Lossless Must be used for program files Losing any part of a program would corrupt it.