← Back to course
Intro to CS 9-10 / Week 10 / Mission Quest
6/6
Week 10 · Data, Compression and Models

Mission Quest

Mission Quest: The photo squeeze
// Shrinking photos, cleaning logs and simulating growth
⏱ about 20 min

Mission Quest: The Photo Squeeze

It is quiet night in the outpost. The relay is shut down for repairs until morning.

Comet has an idea. "Let's send pictures across the table instead. Codes only, no peeking."

Wren draws a tiny paper spaceship on an 8 by 8 grid and writes its run-length codes.

Comet rebuilds it square by square. It matches exactly.

"Now the lossy round," Wren says. He drops every one-square run.

Comet rebuilds the second version and laughs. "My spaceship lost its window."

Nova hovers above both grids. "Smaller, but different," she says. "Was it worth it?"

  1. Compression reduces the number of bits. Fewer bits does not always mean less information.
  2. Lossless compression rebuilds the original exactly. Lossy rebuilds an approximation but usually shrinks more.
  3. Cleaning makes data uniform without changing its meaning. Metadata are data about data.
  4. A correlation does not prove a cause, and one source is often not enough.
  5. A simulation is an abstraction for a purpose. It can use RANDOM and can carry bias from what it leaves out.
◇ THE PHOTO SQUEEZE
Each player needs a pencil and three 8 by 8 grids, on graph paper or ruled by hand.
Each player secretly draws a simple picture on an 8 by 8 grid. Use two letters, such as B for black and W for white.
Write the run-length code for every row, like 3W 2B 3W.
Swap only the codes. Rebuild each other's picture on a blank grid and compare.
Count the symbols in all your codes. Did your picture shrink or grow?
Round two: drop every one-square run and send again. What got lost?
For a grown-up
Ask: what is the difference between lossless and lossy compression? When would each one be the right choice?
Ask: why might a camera that collects data automatically raise privacy questions?
Everything in this course happens on paper. No app, website or account is needed.
QUEST CHECK
  • Read the question.
  • Tap your answer.
Which picture compresses better with a run-length code?
After the lossy round, can you rebuild the exact original?
What is the run-length code for W W W B B W W W?
Which kind of compression lets you rebuild the original exactly? Type one word.
WHY THIS EXERCISELossless is the choice when every detail matters.
On paper, sketch the picture you sent and the lossy picture your partner rebuilt, side by side.
← Friday