KeyStage

Key Stage 1 computing · Algorithms and programming

KS1 algorithms: what they are and how to explain them

An algorithm is a set of precise steps, in the right order, that gets a job done. In Key Stage 1, children learn that computers and robots do only what they are told, exactly as they are told it, so instructions must be clear enough that nothing is left to guess. Most of this starts away from the screen, with everyday routines and games in which one person acts as the robot.

What is an algorithm?, explained

The word “algorithm” sounds like something from a university, but the idea is simple and children already live with it. A recipe is an algorithm. So is the bedtime routine, the way you get dressed, or directions to a friend’s house. This part of Key Stage 1 computing is not about writing code. The aim is to understand what an algorithm is, and to see that a computer is a machine that follows one.

The two words that matter most are “precise” and “unambiguous”. Precise means exact: not “walk to the door” but “take five steps forward”. Unambiguous means there is only one way to read the instruction. “Turn” could mean left or right, a quarter turn or a full circle, so it isn’t good enough. People fill in gaps without noticing, but a computer cannot guess what you meant. It does exactly what the instruction says, even when that is silly.

Order matters too. Putting socks on after shoes is a different algorithm from putting socks on before shoes, and only one of them works. Teachers call a set of steps in a fixed order a sequence, and it is the main idea in Key Stage 1. Repeating steps and choosing between options are named in the Key Stage 2 programme of study, so you don’t need to introduce them now.

In class, this is usually taught without any technology at all. Children give each other directions across the hall, write numbered steps for making a sandwich or brushing teeth, or play a game in which the teacher acts as a robot and follows their instructions to the letter. The sandwich ends up with the jam on the outside of the bread and the whole class laughs, and they quickly see what went wrong. Children then test their algorithm by getting someone to follow it, and improve it.

Once children are comfortable with this, they learn that an algorithm written for a person can be turned into a program that a digital device runs. That step has its own page. For now the useful message at home is that an algorithm is a plan, that a good plan is exact, and that there is often more than one good plan for the same job.

Words your child will hear

Algorithm
A set of steps, in a sensible order, that completes a task, such as a recipe or a set of directions.
Instruction
One step in an algorithm, telling someone or something exactly what to do.
Sequence
Steps put in order. Doing them in a different order can change the result.
Precise
Exact and detailed, such as “take four steps forward” instead of “go over there”.
Unambiguous
Having only one possible meaning, so nobody or nothing can misunderstand it.
Program
An algorithm written in a form that a computer or robot can follow.
Run
To make a computer or robot follow its instructions. Teachers also say “execute”.

What the National Curriculum says

The programme of study for Key Stage 1 says:

  • Pupils should be taught to understand what algorithms are, how they are implemented as programs on digital devices, and that programs execute by following precise and unambiguous instructions
  • Aim: pupils can understand and apply the fundamental principles and concepts of computer science, including abstraction, logic, algorithms and data representation.

Objectives from the National Curriculum in England, © Crown copyright, used under the Open Government Licence v3.0.

Try it: writing instructions for a robot

Your child has to guide a “robot” (you) from the sofa to a bookcase four steps away, pick up a red book from the bottom shelf and bring it back to the sofa. Write an algorithm the robot can follow.

  1. Start with a first draft in ordinary language: “Go to the bookcase and get the red book.” Now act as a robot that follows only the words it is given. You will probably stand still, because “go” does not say which way, how far or how.
  2. Make each instruction one small, exact action. Stand with your back to the sofa, facing the bookcase. Instruction 1: walk forward four steps. Instruction 2: stop.
  3. Add the actions at the shelf, one at a time. Instruction 3: bend your knees. Instruction 4: pick up the red book on the bottom shelf with your right hand. Instruction 5: stand up.
  4. Work out the way back. “Turn round” is not precise enough, so say exactly how far. Instruction 6: make a quarter turn to the right. Instruction 7: make another quarter turn to the right. Two quarter turns make you face the sofa. Instruction 8: walk forward four steps. Instruction 9: stop.
  5. Test it. Follow the list exactly, with no helpful guessing. If the robot walks into a table or picks up the wrong book, the algorithm is not precise enough yet, so change the instruction that caused it and try again.

1. Walk forward four steps. 2. Stop. 3. Bend your knees. 4. Pick up the red book on the bottom shelf with your right hand. 5. Stand up. 6. Make a quarter turn to the right. 7. Make another quarter turn to the right. 8. Walk forward four steps. 9. Stop. Every step is one clear action, and the order matters.

Common mistakes and how to help

Thinking an algorithm is something only computers have

The word is linked to screens and technology, so children assume it means computer code.

What helps: Say it about ordinary things: “That’s the algorithm for getting ready for school.” Ask your child to put the steps of a routine in order, with no device in sight.

Expecting the computer or robot to work out what you meant

Friends and family fill in gaps all the time, and smart speakers can seem to understand almost anything, so children expect the same from a robot.

What helps: Play the literal robot game. If your child says “put the cup on the table”, put it on the table upside down, then ask what the instruction needs to say.

Believing the order of the steps does not matter if all the steps are there

Young children often think of a list as a collection of jobs rather than a fixed route.

What helps: Write the steps for a routine on separate scraps of paper, shuffle them and ask your child to rebuild the order. Then swap two on purpose and talk about what would happen.

Thinking there is only one right algorithm

Much of school work has one right answer, so children expect one correct list of steps.

What helps: Ask for two different ways to get from the door to the window. Both can work. Look at which has fewer steps and whether both are precise.

How to help at home

  • Be the literal robot. Ask your child to tell you how to draw a simple house on paper, and draw only what they say. “Draw a line” gets you a line anywhere. Let them laugh, then help them add the starting point, the direction and the length.
  • Put a routine in order. Write or draw the steps of a routine such as brushing teeth on separate cards. Your child puts the cards in order, then tries a deliberately wrong order and says what would go wrong.
  • Count and turn in the garden. In a garden, hall or park with you, give directions made of counted steps and turns: “four steps forward, quarter turn right, two steps forward”. Then swap, so you follow your child’s instructions exactly.
  • Spot the algorithms. Point out algorithms as you cook, build a model or follow a game’s rules. Ask, “Which step has to come first?” and “Would a robot understand that step?”
  • Ask for a better version. When an instruction goes wrong, ask what could be changed so that it works every time. Improving a plan after testing it is the habit teachers most want to see.

More on algorithms and programming

Everything in Key Stage 1 computing

Updated .