Algorithms for children
When it comes to algorithms for children, I like to start with a question that leads further than it seems. If I say, “move a little to the right,” how much is a little? In a classroom, I’ll probably hear three different answers. And that is where our Algorithms for Children Project begins.
What is an algorithm?
An algorithm is a finite set of clear, ordered instructions for completing a task or solving a problem. A cake recipe, the steps for frying an egg, and even the routine of getting up before school are good starting examples. It tells us what to do, in which order and, when it matters, how much to use or how long to wait.
As an educator, it is useful to notice when a child moves from “I know how to do it” to “I can explain how to do it.” When a classmate tests the instructions, it becomes easier to see what was clear and what still needed to be said. Writing, testing and adjusting these steps is one way to develop computational thinking in the classroom.
A sample to try right now
Ask the class to draw a picture by following three commands. Draw a square. Put a triangle on top of the square. Draw a rectangle inside the square, touching the bottom edge.
Then compare the drawings. Some will look like houses with narrow doors, others with very wide doors. Ask what would need to be added to the instructions if the door had to be in the center. This conversation is already a useful introduction to the activity.
If you would like to prepare the lesson in advance, I have shared a presentation in Portuguese that is free and uses LEGO bricks as an example to introduce the topic in robotics or coding lessons. Find the Computational Thinking resource on the STEAM 4 KIDS™ downloads page.
Algorithm activity — The robot that follows the arrows
Suggested grades · Suggested grades 2–5
Time · 20 to 25 minutes
Grouping · Pairs
Materials · Paper, pencil and an eraser to represent the robot
- Ask each pair to draw a grid of 4 by 4. Mark the start in the bottom-left corner, the finish in the top-right corner and an obstacle in the square immediately above the start.
- Agree that each arrow moves the robot one square in the direction shown on the paper. The robot cannot step on the obstacle or leave the grid.
- One child writes the complete sequence of arrows. The other places the robot at the start and carries out the commands in order, without filling in the route on their own.
- If a command leads into the obstacle or outside the grid, the pair marks where the test stopped, adjusts the sequence and starts again from the beginning. Then the children swap roles and try to find another path.
One possible path for the teacher to check · → ↑ ↑ ↑ → →
In the closing discussion, ask “At what point did you change an instruction? What happened when you tested it again?” If two pairs found different paths, ask them to show why both work.
Continue with the book Algorithms for Children
I suggest bringing in the book after the class has tried the first challenge. Then, when the word algorithm appears in the reading, it comes with a very concrete memory: that sequence of arrows someone wrote, someone else tested and the two adjusted together.
One question to bring into this reading moment is “What other task in our classroom could we teach the robot?” The class chooses one, writes the steps and exchanges instructions with another pair. The best part is seeing what happens when a classmate follows, literally, what seemed so obvious in our heads.

