← Back to course
1/6
Week 10 Β· Data, Compression and Models

Monday

Too many bits
// Shrinking photos, cleaning logs and simulating growth
⏱ about 20 min

Monday: Too Many Bits

Beacon has a new job. Every evening it must send a photo of each greenhouse bed back to mission control.

Comet queues up the first batch and taps send. The progress bar barely moves.

"The relay is slow tonight," she groans. "At this rate the tomatoes will be ripe before the photos arrive."

Wren studies one photo grid. "What do you notice? Half of this picture is the same white wall, square after square."

Nova hovers beside the screen. "Repeated data is a clue," she says. "Ask what you really need to send."

Comet stops tapping. "So we do not need a faster relay. We need smaller photos."

Wren nods. "Smaller, but still useful to the plant team."

Compression

Data compression can reduce the size of data that is stored or sent. Size here means the number of bits.

Fewer bits does not always mean less information. A shorter way of writing can keep every detail.

How much data shrinks depends on two things: how much repetition, or redundancy, the data has, and which compression algorithm is used.

A photo with large patches of the same color has lots of redundancy. A busy, speckled photo has less.

CHECK YOUR COMPRESSION IDEAS
  • Read the question.
  • Tap your answer.
What does data compression reduce?
Which photo would probably shrink more?
Wren says fewer bits always means less information. Is he right?
The amount a photo shrinks depends on its redundancy and on what else?

Two kinds of compression

Lossless compression usually reduces the number of bits and still lets you rebuild the original exactly.

Lossy compression can greatly reduce the number of bits, usually more than lossless compression. But you can only rebuild an approximation of the original.

Here is an analogy, not a rule: think of a packed suitcase. Lossless is like folding everything neatly. Lossy is like leaving a few things behind.

StatementTrue or false?
Lossless compression lets you rebuild the original exactly.?
Lossy compression lets you rebuild the original exactly.?
Lossy compression usually shrinks data more than lossless compression.?
Data with lots of repetition is a good fit for compression.?
Compression always throws away some information.?
WHY THIS EXERCISEKnowing what each kind keeps tells you which one fits a job.
Compression that rebuilds the original exactly is called ____.
Compression that rebuilds only an approximation is called ____.
Repetition in data is also called ____.
FROM A FULL PHOTO TO THE RELAY
  • ?Beacon takes a full photo of a greenhouse bed.
  • ?Beacon looks for repeated patches in the photo.
  • ?Beacon writes the photo in a shorter code.
  • ?The shorter code travels over the relay.
  • ?Mission control decodes it back into a photo.
WHY THIS EXERCISECompression happens before sending, and decoding happens after.
Try it
Write the sentence "the tomatoes need water and the tomatoes need light" on paper.
Invent a shorter way to write it that a partner could still turn back into the exact sentence.
For a grown-up
This week your student shrinks paper pixel grids, cleans an invented data log and runs a dice-style growth simulation in pseudocode.
Everything is on paper. No lesson asks your student to open an app, a website or a programming tool.
What is the word for repetition in data that makes compression work well? Type one word.
WHY THIS EXERCISERedundancy is what a compression algorithm looks for.
On paper, sketch two 4 by 4 photo grids: one that would compress very well and one that would compress badly. Label which is which.

Good thinking, developer. Tomorrow you will clean up the Beacon log.