What is an algorithm? An explanation for kids with everyday examples

An algorithm is a step-by-step recipe. How to explain it to children aged 5 to 8, with everyday examples, unplugged games, common mistakes and a Looponi lesson.

Updated:

The level “First pipes” in Looponi: lay pipes from START to END before the token sets off

“Algorithm” sounds like a big word, yet children have known algorithms since nursery. Every recipe, every set of building instructions and every “first this, then that” is an algorithm. All you need to do is show them it has a name and a few simple rules.

An algorithm in plain words

An algorithm is an exact, step-by-step recipe. It says what to do, in what order, and when to stop. A good algorithm has three features:

  1. It has a beginning and an end. You know where to start and you know when you're done.
  2. The steps come in order. Order matters. Socks first, then shoes.
  3. Every step is clear. Whoever follows it doesn't have to guess. “Spread the jam” isn't enough if nobody opened the jar.

The word “algorithm” comes from the name of the Persian mathematician al-Khwarizmi, who described methods of calculation in the 9th century. Children like this fact, because it shows that algorithms are much older than computers.

How can you tell whether a recipe is a good algorithm? Give it to someone who doesn't know it and ask them to follow it exactly as written. If the result is right, the recipe works. If they had to ask a question or guess, a step is missing. You can repeat the test with different people: a good algorithm gives the same result whoever follows it.

Computers carry out algorithms too, written in a language they understand. That written form is called a program. Our guide to coding for kids explains how to get started.

Everyday examples

It's worth showing that some algorithms contain decisions (“if it's raining, take an umbrella”) and repetition (“stir until there are no lumps”). Those are conditions and loops, but it's still an algorithm.

Unplugged games

1. Instructions for an alien

The adult plays an alien who doesn't know Earth and follows instructions literally. The child explains how to make a sandwich or put on a coat. The alien holds the coat upside down if nobody said which way up. After each mishap, the child improves the instructions.

2. The cut-up recipe

Write the steps of a familiar task, such as making tea, on separate strips of paper. Mix them up. The child puts the strips in the right order and then checks: can two steps swap places without any harm? “Get a mug” and “get a tea bag”, yes. “Pour the water” and “boil the water”, no.

3. Across the room

Put START and FINISH on the floor with a few cushion obstacles between them. The child writes the route as arrows, such as “↑ ↑ → ↑”, and someone else walks it reading only the paper. If they bump into a cushion, look for the wrong arrow together.

4. Drawing by dictation

One child draws a simple picture from circles and squares without showing it. Then they describe it to a partner, who draws it. Compare the two at the end. The more exact the description, the more alike the pictures. An algorithm is exactly that kind of description.

5. The shortest algorithm

Ask: “What's the shortest recipe that has a beginning and an end?” Answer: “Start. Stop.” It's a joke, but a useful one, because it shows the two things no algorithm can leave out.

Common mistakes

What it looks like in Looponi

In Looponi the first lesson of the First steps module is simply called “What is an algorithm?” The story starts with a pancake recipe: steps in order, from beginning to end. The board is empty. The child places START on the glowing square, END three squares lower, and then lays the pipes from one to the other, tile by tile.

Before running it, the child predicts what the token will do: ride through the pipe to END and stop, stop on the first pipe, or go back to START. Then they watch the token travel and learn that each square is one step of the program. The program doesn't calculate anything, but it has everything an algorithm needs: a beginning, a path and an end. In the Blockton story it is the first trip of Dot the little engine in years, and Byte loses his bet, because he thought Dot would go back to START.

At the end the lesson reveals a small trick: blocks can sit right next to each other, with no pipe. The third star in the task goes to a program made of just two tiles, with END placed directly under START. For the youngest children, who are only starting to read, “Track to the bakery” on the Little Ones track is a similar first lesson. The next step, drawing algorithms as diagrams, is covered in our guide to flowcharts for kids.

What age is right?

Children of 5 or 6 can grasp an algorithm as a step-by-step recipe if they work with pictures and movement. From about 6 to 8, children can build and fix simple algorithms themselves, including on a board in an app. Writing algorithms with conditions and loops usually comes later, around 9 or 10.

Frequently asked questions

What is an algorithm in simple words?

An exact recipe for doing something: a list of steps carried out in order, with a beginning and an end. A pancake recipe, the way to school and how to brush your teeth are all algorithms.

What is the difference between an algorithm and a program?

An algorithm is the idea for solving a problem, which you can describe in words or draw. A program is the same idea written so that a computer can carry it out.

Where does the word algorithm come from?

From the name of the Persian mathematician al-Khwarizmi, who lived in Baghdad in the 9th century and wrote about methods of calculation. The Latin form of his name gave us the word “algorithm”.

Read next

All guides →