1
Algorithms and order
Computing 1: Topics 1.1–1.4, pp. 9–59
GoalRemember what an algorithm is, why the order matters, and how to find an error.
New words
algorithm · a set of steps to do a joberror · a mistake in the steps
Explanation
An algorithm is a set of steps. The steps must be in the right order. That order is the sequence. Clear steps with numbers are easy to follow. A step in the wrong place, or a missing step, is an error. We find the error and fix it.
Worked examples
Bird feeder algorithm: 1 Fill the feeder with seeds. 2 Hang it on a branch. 3 Watch quietly. The steps are in a good order.
Error: 1 Hang the feeder on the branch. 2 Fill it with seeds. 3 Watch quietly. The seeds would fall out! Fix: fill first, then hang.
Clear instructions: ‘Draw a small blue square’ is clear. ‘Draw a shape’ is not. A computer cannot guess.
Class activity
Review game: a partner says a short algorithm for washing a bike (use water, a cloth and a dry cloth). Sometimes they put in an error. Clap when you hear it. Say if the error is a step in the wrong place or a missing step. Then fix it.
Practice
1
What is a sequence?
The order of the steps.
2
Steps: 1 Dry the bike. 2 Wash the bike. 3 Put the bike away. Which step is in the wrong place?
Step 1. We wash before we dry.
3
Fix this unclear instruction: ‘Colour it in.’
For example: ‘Colour the circle green.’
4
What two kinds of error can there be in an algorithm?
A step in the wrong place, and a missing step.