Following Steps — What Is an Algorithm?
KindergartenA list of steps done in order to finish a job is called an algorithm. You already know lots of algorithms! Brushing your teeth is an algorithm: wet the brush, add toothpaste, brush the top teeth, brush the bottom teeth, rinse, done.
Every algorithm needs a clear start and a clear end, with each step leading naturally to the next one.
Order matters enormously. Put your shoes on before your socks, and something goes wrong — even though "socks" and "shoes" are both still in your steps! The same steps in the wrong order can turn a good algorithm into a broken one. This is why people who write instructions for computers are so careful about the order they write things in.
Big idea. An algorithm is not just a list of things to do — it is a list of things to do in a particular order.
Activity: Sequence the Story. Draw four pictures on separate cards: "wake up," "get dressed," "eat breakfast," "brush teeth." Mix the cards up, then put them back into an order that makes sense.
Now swap two of the cards — say "get dressed" and "brush teeth" — and act out what silly thing would happen if you really did the steps in that broken order.
Q1 What is an algorithm, in your own words?
An algorithm is a list of steps, done one after another in order, that finishes a job. A recipe, a set of directions to a friend's house, and instructions for a board game are all algorithms.
Q2 Can you name an algorithm you follow every day?
Yes — getting ready for bed is a good example: put on pyjamas, brush teeth, read a story, turn off the light. Each step happens in a set order, every night.
Q3 What happens if you do the steps of an algorithm out of order?
It usually breaks! Some algorithms simply don't work if you swap steps — like trying to put your shoes on before your socks. This is exactly why computers, which follow algorithms exactly, need the steps written in the right order.
How the ideas connect
Every key idea in this chapter, branching from the core concept — use it to see the whole picture at a glance.
The process, step by step
Worked problems, step by step
Follow each solution line by line, then try to reproduce it on paper before moving on.
Example 1Write an algorithm to brush your teeth.
- 1. Pick up the toothbrush.
- 2. Put toothpaste on it.
- 3. Brush for two minutes.
- 4. Rinse and put the brush away.
Example 2These steps are out of order: pour milk, get a glass, drink. Fix the order.
- You need the glass before you can pour.
- You must pour before you can drink.
Now you try
Work each one out first, then tap to reveal the worked answer.