OER.ai

← Text Compression (You Can Say That Again!)

Sub plan

Text Compression (You Can Say That Again!)

Generated from the original open resource by CS Unplugged. Built only from the resource — nothing invented. Free, no login.

Objective

Students will learn what text compression is and why computers use it — that computers can save space by finding repeated letters, words, or phrases in text and replacing them with a "pointer" back to where that text first appeared, instead of writing it out again.

Materials

  • "You Can Say That Again!" resource packet (OHP Master page 25, Worksheet Activity pages 26–29)
  • Printed copies of the Worksheet Activity "You can say that again!" (page 26) for each student
  • Printed copies of "Short and Sweet" (page 28) for each student
  • Chalkboard/whiteboard or chart paper to write "The Rain" poem (in place of OHP, since no projector is required — just copy the poem by hand or read it aloud)
  • Pencils

Warm-up (~5 min)

  1. Write (or read aloud) the poem "The Rain" from page 25 on the board:
Pitter patter / Pitter patter / Listen to the rain / Pitter patter / Pitter patter / On the window pane
  1. Ask students: "Do you notice anything repeated in this poem?" Let a few students point out that "Pitter patter" appears four times.
  2. Explain: "Computers have to store a LOT of information, so they try to save space by not writing the same thing twice. Instead, they point back to where it already appeared. This is called compression. Today we'll practice thinking like a computer."

Main Activity (~25 min)

  1. Explain the boxes-and-arrows idea (5 min): Tell students that instead of rewriting "Pitter patter" every time, a computer could draw a box around the repeated words and an arrow pointing back to the first time it appeared. Demonstrate this on the board with "The Rain" poem — box the repeated "Pitter patter" lines and draw an arrow back to the first occurrence.
  1. Hand out Worksheet Activity: "You can say that again!" (page 26) (15 min):
  2. Students fill in missing words/letters in the poem using the arrows/boxes provided on the worksheet.
  3. Remind students: "The arrows always point to an earlier part of the text, and you read the puzzle from left to right, top to bottom — just like normal reading."
  4. Once finished, students who finish early may attempt the extension instructions on the same worksheet: choosing a simple poem or nursery rhyme (such as Three Blind Mice, Mary Mary Quite Contrary, or Hickory Dickory Dock) and designing their own puzzle with boxes and arrows.
  5. Remind them of the hint: leave lots of space around letters/words so there's room for boxes and arrows, and to write out the poem first before deciding where the boxes go.
  1. Class check-in (5 min): Go over the completed poem together as a class (solution: "Pease porridge hot / Pease porridge cold / Pease porridge in the pot / Nine days old / Some like it hot / Some like it cold / Some like it in the pot / Nine days old."). Ask a few students to share how they figured out the missing words.

Wrap-up / Exit Ticket (~10 min)

  1. Hand out the "Short and Sweet" worksheet (page 28) — the "I know an old lady who swallowed a bird" poem.
  2. Instruct students: "Pretend you are a computer. Cross out any group of two or more letters that has already appeared earlier in the poem — those letters no longer need to be written again because a computer could just point back to them."
  3. Give students about 7 minutes to work on crossing out repeated letter groups.
  4. As an exit ticket, ask each student to write one sentence answering: "Why do computers compress text?" (Answer should reflect: to save storage space and/or make things transmit/download faster.) Collect these on their way out.

If Time Remains

Show students the "Ban---" example from the "Extra for Experts" worksheet (page 27). Explain that computers use numbers instead of arrows: "Banana" can be written as "Ban(2,3)" — count back 2 letters, then copy 3 letters forward. Challenge students to try writing one or two simple words (like "banana" or a repeated word from the day's poems) in this number-code style and see if a partner can decode it.

Original licensed under CC BY-NC-SA 4.0. This teaching material is provided free by OER.ai.