Sequence

Sequence

When we sequence things, we arrange them in a particular order. Sequence-based algorithms are made from a precise set of instructions. For example:

A diagram showing the stages of making jam-on-toast.

A sequence of instructions - an algorithm - for how to make toast.

Similarly, computer programs are built up of precise sequences of unambiguous instructions. When pupils start working with floor turtles, they build their programs as simple sequences of button presses. Each press stores a specific command: when the program is run, each command in turn triggers specific signals to the motors driving the wheels and the turtle moves accordingly. Pupils’ first Scratch programs are also likely to be simple sequences of instructions. Again, these need to be precise and unambiguous, and of course the order of the instructions matters. In developing their algorithms, pupils will have had to work out exactly what order to put the steps in to complete a task.

A block of Scratch code.

A program which children might create in Scratch.

Why is sequence important?

In sequence-based algorithms, such as a recipe to bake a cake, the order of many (though not all) of the steps is crucial. Similarly, most programming languages are based on a series of statements to sequentially process. The outcome of a program will depend not only on the constituent commands but their order. The importance of sequence in the output of a Scratch program is illustrated below. In this table, the program in the second row has had just two commands swapped in its sequence; however, as a result, the output is quite different:

Screenshots showing how changing the sequence of instructions can change the output of a program.

Two programs in Scratch, constructed from commands which are identical but which are sequenced differently. The second has two commands swapped in its sequence, producing a different output as a result.

This has been a fundamental principle of computer science since one of the first mechanical computers was designed by Charles Babbage approximately 300 years ago. Modern-day digital computers use sequence in a range of ways. The order of our keystrokes on the keyboard is a sequence. The press of a key is itself translated into a representative sequence of code within the computer.

A photograph of Charles Babbage.

A photograph of Charles Babbage.

What does sequence look like in the Primary curriculum?

The first programs which pupils code are likely to be a sequence of commands using a simple programming language or a floor turtle such as the Bee-Bot. However, prior to this, they also become aware of sequences across other subjects and in the world around them. The computational-thinking concepts of algorithms and decomposition are closely related to sequence and, indeed, an example of a simple algorithm is a sequence of steps. To determine a correctly sequenced algorithm for a task or program, we first need to decompose that task or program into parts of the overall process. If we want to reveal a greater level of detail in the sequence, we can further decompose any of the steps. As pupils progress through the Primary phase, the sequences of code they create may grow in complexity. These sequences may also employ selection and repetition commands and the use of variables to control the ‘flow’ of the program.

3 - 5 years

Pupils develop an awareness of the order of the days in the week and the months in the year. They learn the sequence of digits in the number system as they learn to count to ten. They may then use their knowledge of this sequence to count on, add two numbers, etc. Sequences crop up in roleplay: in acting out various scenarios, pupils learn to correctly sequence their actions and to synchronise them with those of their classmates. They can also take part in specific ordering activities such as lining up in height order. We can create sequencing activities to support learning across the curriculum – for example, cards representing different life stages to be placed in their correct order within a butterfly’s lifecycle. There are several characteristics and descriptors within the EYFS Profile which can be related to sequence: in creating, in communication and language, and in thinking critically (for example, about cause and effect).