Run-length message
Encode adjacent repeats and reconstruct the exact original sequence.
Adult planning suggestion: about4–6 · Language & storytelling
- Players
- 2–3 per group
- Time
- 10–15 minutes
- Materials
- Fourteen large A/B cards, paper strip, pencil.
Prepare
Prepare a twelve-place strip and seven A plus seven B cards. Place AAABBBAABBBB as the first message; it uses five A and seven B, both available in the fourteen-card set. Keep unused cards separate.
Play
The sender scans left to right, writing the symbol and count for each uninterrupted run. At a change of symbol, start a new pair. Hide the original and give only those pairs to the receiver, who writes each symbol the stated number of times. The checker compares every position after reveal.
Worked example
AAABBBAABBBB becomes A3 B3 A2 B4. Its total is 3+3+2+4=12. A5 B7 is incorrect because it loses the order of the separated runs. ABA becomes A1 B1 A1; encoding may be longer than the original, which is a useful result rather than a failure.
Finish and check
Complete three messages and rotate jobs. Award a shared check mark only for an exact reconstruction, then correct any mismatch together. A successful decoder must know both the symbols and the run counts; counts alone are not our chosen format.
Adaptation and limits
For early years, start with a six-place strip and let an adult write the digits. Use letters or two contrasting textures, not colour alone. No speed ranking. The printed task uses our own examples; the background reference explains the general compression idea.
Purpose, observation and provenance
Within this activity: Encode adjacent repeats and reconstruct the exact original sequence.
Check whether separated A groups were wrongly merged and whether decoded length matches.
Our rules, examples and printable diagrams are separately prepared. The earliest inventor of the broader mechanism is not established here.
Computer Science Field Guide — Run length encoding — Technical background only; our symbol-count convention, examples and young-age facilitation are separately designed.
Age bands are planning suggestions. Goals describe observable actions, not measured long-term gains or institutional endorsement.
Free alternative: Copy the supplied grids, labels and cards onto reused paper. No specialist product is needed. Adults may prepare pieces or act as a scribe.
Printable materials
Preview at 100% scale, with browser headers and footers off. Cut with suitable help. Keep host keys separate. This is a manual tabletop kit, not an online opponent, automatic judge or solver.
Player materials · Run-length message
Original: AAABBBAABBBB; encode: ___ ___ ___ ___.
Decode A2 B1 A3: ______; length ___ .
Create a twelve-place message using at most seven A and seven B.
| 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|
| ___ | ___ | ___ | ___ | ___ | ___ |
| 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|
| ___ | ___ | ___ | ___ | ___ | ___ |
Player record · keep the host key separate
| Original | Encoding | Reconstruction |
|---|---|---|
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
Host key · separate from players
A3 B3 A2 B4; A2 B1 A3 decodes AABAAA (6). ABA needs three runs.
Run the round
Prepare a twelve-place strip and seven A plus seven B cards. Place AAABBBAABBBB as the first message; it uses five A and seven B, both available in the fourteen-card set. Keep unused cards separate.
The sender scans left to right, writing the symbol and count for each uninterrupted run. At a change of symbol, start a new pair. Hide the original and give only those pairs to the receiver, who writes each symbol the stated number of times. The checker compares every position after reveal.
AAABBBAABBBB becomes A3 B3 A2 B4. Its total is 3+3+2+4=12. A5 B7 is incorrect because it loses the order of the separated runs. ABA becomes A1 B1 A1; encoding may be longer than the original, which is a useful result rather than a failure.
Complete three messages and rotate jobs. Award a shared check mark only for an exact reconstruction, then correct any mismatch together. A successful decoder must know both the symbols and the run counts; counts alone are not our chosen format.
For early years, start with a six-place strip and let an adult write the digits. Use letters or two contrasting textures, not colour alone. No speed ranking. The printed task uses our own examples; the background reference explains the general compression idea.
Related activities
When a Run-Length Message Gets Longer
Agree on what the receiver will read
Before comparing message lengths in Run-length message, establish the notation: a letter followed by a positive count, with a space between pairs. A2 means two consecutive A cards. The receiver must know that the letter comes first; otherwise a list of numbers alone leaves the starting symbol uncertain. Use only A and B for this round. That avoids a separate problem about distinguishing a digit used as a symbol from a digit used as a count. The notation is part of the shared instructions, not something the decoder should infer afterward.
Look for adjacent runs rather than totals
Arrange this fresh twelve-card message: AABBAAAABBBA. It uses seven A cards and five B cards, within the supplied quantities. Scan from the left and pause whenever the letter changes. The resulting pairs are A2 B2 A4 B3 A1. Although there are seven A cards altogether, A7 B5 is not an equivalent message. It moves separated A runs together and changes the order. A frequency total answers how many of each letter appeared; the run record also preserves where the changes occurred. Keep both kinds of record labelled if you compare them.
Decode before deciding whether it saved space
Hide the original while another participant expands the five pairs. A2 contributes AA, B2 contributes BB, A4 contributes AAAA, B3 contributes BBB, and A1 supplies the final A. Put those pieces together in their recorded order and compare every position after revealing the original. Adding the counts gives twelve, which is a useful length check. It is not a complete accuracy check: the incorrect A7 B5 also expands to twelve characters. A reconstruction can have the right size and the wrong content. Exact agreement comes before celebrating a shorter representation.
Make the counting convention explicit
For a simple paper comparison, count letters and decimal digits while ignoring the spaces between pairs. The five-pair encoding above has ten counted characters, compared with twelve in the original. If you choose to count the four separating spaces as well, it has fourteen. Neither calculation is mysterious once the convention is stated. Do not switch conventions between examples to make one method look better. These counts describe the written notation on the worksheet. They are not measurements of computer file bytes, storage headers or the efficiency of a real compression format.
Compare two deliberately different messages
AAAAAABBBBBB has two runs, so A6 B6 uses four letters-and-digits characters under the first counting convention. ABABABABABAB has twelve runs, so its twelve symbol-count pairs use twenty-four. The second encoding is longer than its original, despite being perfectly reversible. That is an observation about this input, not a reason to change a correct answer. The Computer Science Field Guide explores run encoding and representation costs with images. Its numerical image convention differs from our explicit letter-and-count pairs, so do not mix the two decoding rules.
Keep the comparison fair when creating a message
Use the same twelve positions and the same available cards when participants create another example. Ask one sender to make few changes of letter and another to make frequent changes. Predict which will need more pairs, then test it. There is no need to make the messages random or to collect anyone's private text. A helper can write the counts while the sender points to each uninterrupted group. Return the cards between attempts so the second sender has the full supply, rather than inheriting a shortage caused by the first arrangement.
Finish with two separate findings
Record whether the receiver reconstructed the exact message and whether the chosen written representation was shorter under the agreed count. Both findings matter, and either length result can accompany a successful round. Rotate sender, receiver and checker after the comparison. If a mismatch remains, mark the earliest different position and inspect the run containing it. Keep this activity's conclusion local: repeated adjacent symbols can make this notation compact, while frequent changes can make it expand. A twelve-card experiment does not establish which compression method is best for photographs, sound recordings or arbitrary files.