The Idea

An algorithm is just a set of rules clear enough for someone else to follow without needing to ask questions. When we say “teach grandma to sort,” we mean exactly this: can you write a rule so clear that another person can sort a completely new pile of objects correctly without you telling them anything extra?

This turns algorithm design into a two-player game — which is much more revealing than sorting alone. The “learner” will immediately find the gaps and ambiguities in the rule that the designer didn’t notice.

Roles

The Algorithm Designer (usually the child): Creates the sorting rule, teaches it through examples, and tests whether the learner got it right.

The Learner (the family member — grandparent, aunt, uncle, or parent): Learns the rule purely from examples, then applies it to new objects.

Step 1: Designer Creates the Rule (Secret!)

The designer decides on a sorting rule without telling the learner what it is. Write it down on a piece of paper and keep it hidden.

Good rules for ages 6–8:

  • Things that are alive vs. never alive (rock = never alive; wooden spoon = made from something alive)
  • Things used for eating vs. not eating
  • Things that can fit in your pocket vs. things that can’t
  • Natural things vs. made-by-humans things

Trickier rules for ages 8–9:

  • Things older than you vs. younger than you (a coin might be old or new; research required)
  • Things that make a sound vs. things that are silent
  • Things that change over time vs. things that stay the same (a rock stays the same; a candle changes)

Step 2: Sort the Training Examples

The designer picks 6–8 objects from the pile and sorts them into two groups. Without saying anything about the rule.

The learner watches. They can ask: “Why did that one go there?” But the designer can only say “because of the rule” and sort more examples. No explaining the rule directly — only showing.

This mimics how supervised machine learning works: the model sees labeled examples and must infer the rule.

Step 3: The Learner Guesses the Rule

After seeing 6–8 sorted examples, the learner says out loud what they think the rule is.

The designer can say “warm” or “cold” (closer or further from correct) but not reveal the actual rule yet.

If wrong, sort 3–4 more examples and try again.

Step 4: Test the Rule

Once the learner states the rule correctly (or close), give them 6 new objects they haven’t seen sorted. They apply the rule independently.

Check against the secret paper: how many did they get right?

Step 5: Reveal and Discuss

Now show the written rule. Discuss:

  • “Which examples were the most helpful for learning the rule? Which confused you?”
  • “Were there any objects that could go in either group?”
  • “What if we had used different examples? Would you have learned the same rule?”

The AI Connection

“This is exactly how machine learning works. The computer doesn’t get told the rule — it sees thousands of sorted examples and figures out the rule on its own. And just like you, it can make mistakes when the examples are unusual or when the rule is ambiguous.”

The key insight for children this age: the learner learned the rule without being told it. They inferred it from examples. That’s the whole trick of machine learning.

A gotcha to discuss: What if two of the training examples were sorted wrong? How would that affect the learner’s ability to learn the right rule? This is the “garbage in, garbage out” principle of training data.

Variations

Timed round: After the learner knows the rule, time how fast they can sort 20 objects. Then time the designer. Who’s faster at applying a rule they know well?

Three-way sort: Use three categories instead of two. The rule gets harder to infer from examples.

Rule evolution: After the learner figures out the rule, secretly change it slightly. Sort 4 new examples under the new rule. Can the learner notice the change?

Ready for more?

Explore all activities in the library, or find ones matched to your child's age.

All Activities → Browse by Age