Two children tidy the same pile of toys. One picks up whatever is closest and walks it to the right box, again and again. The other first sorts the pile into heaps on the floor, then carries each heap once. Both rooms end up tidy, but one child walked many more times than the other.
People who write programs ask two questions about any method. First: does it work? Then: how many steps does it take? A computer is fast, but when it has to search through millions of things, a method with fewer steps makes a huge difference. Children of around 7 to 12 can discover this idea with cards, toys and a pencil. Here is how.
Same result, different number of steps
Start with the key idea: two ways can give exactly the same result and still need a different amount of work. To compare them fairly, count steps rather than timing them. A stopwatch depends on who is faster; counting steps doesn't.
Decide together what one step is before you start: turning over one card, carrying one load to a box, adding one number. Then do the job both ways and write down the two counts. That is all programmers mean when they talk about how "efficient" a method is.
Find a name: shuffled list or sorted list?
You need 16 cards with a word on each, such as animal names. Lay them face down in a row.
- Shuffled. Your child looks for "owl" by turning over one card at a time. Count the turns. Sometimes it's the first card, sometimes the last: up to 16 turns.
- Sorted. Now put the cards in alphabetical order, still face down. Your child turns over a card near the middle. Is "owl" before or after that word? Push away the half that can't contain it, and turn over the middle of what's left. Keep halving.
- Compare. With 16 sorted cards, your child never needs more than 5 turns.
Then ask: "What if there were more cards?"
| Number of cards | Shuffled: up to | Sorted, halving each time: up to |
|---|---|---|
| 16 | 16 turns | 5 turns |
| 32 | 32 turns | 6 turns |
| 64 | 64 turns | 7 turns |
| 1,000 | 1,000 turns | 10 turns |
Each time the pile doubles, the halving method needs only one more turn. This is why dictionaries, phone contacts and library shelves are kept in order. The same idea works as a guessing game: think of a number from 1 to 100 and only answer "higher" or "lower". Starting in the middle, your child can always find it in 7 guesses or fewer.
Tidy up two ways
Scatter 12 toys of three kinds (for example, cars, blocks and soft toys) on one side of the room, and put three boxes on the other side.
- Way A: pick up one toy, walk it to its box, come back. Count the trips to the boxes: 12.
- Way B: first sort the toys into three heaps where they are, then carry each heap in one trip: 3 trips.
Now ask the interesting question: "Is Way B always better?" Sorting takes steps too. With only two toys, sorting first isn't worth it. With a whole bedroom of toys, it saves lots of walking. The lesson programmers learn is the same: which way is best depends on how big the job is.
More pairs to compare at home
| Job | Way with more steps | Way with fewer steps |
|---|---|---|
| Laying the table for four | Carry one item at a time | Load a tray and carry it once or twice |
| Counting a jar of coins | Count one by one | Make piles of 10, then count the piles |
| Adding 1 + 2 + … + 10 | Add one number at a time | Pair 1 + 10, 2 + 9 and so on: 5 pairs of 11 make 55 |
| Instructions for a "robot" friend | "Step, step, step, step" | "Repeat 4 times: step" |
| Finding matching socks | Search a mixed basket | Fold socks in pairs when they come off the line |
For each pair, let your child count the steps both ways, then ask them to find one more everyday job that can be done in fewer steps.
Questions that help children think it through
- "Does it work?" Always first. A quick way that gives the wrong answer isn't better.
- "How many steps? Let's count." Write the numbers down instead of guessing.
- "What if there were 100 instead of 10?" The gap between two methods often grows as the job gets bigger.
- "Is there something we do many times that we could do once?" Sorting first, using a tray and repeating an instruction all come from this question.
- "Is fewer always better?" Sometimes a longer way is easier to remember, safer or more fun, and that's a fine reason to choose it.
In Dologi, the "Repeat moves" puzzles in the Space topic don't have enough slots for every single move, so children repeat one move several times to drive the car over every star: a hands-on taste of getting the same result with fewer instructions.
In short
- Two ways can give the same result with very different amounts of work; count the steps to compare them fairly.
- Searching a sorted list by halving needs far fewer turns than checking one by one, and the gap grows as the list gets longer.
- Preparing first (sorting, using a tray, making piles) costs a few steps but can save many, especially for big jobs.
- Check that a method works before asking whether it's short, and accept that the shortest way isn't always the best one.
Read more: Finding the shortest route like a map app: a hand-drawn map game for children aged 7 to 12
