What is a sequence in computing?

What are sequences?
Understanding sequences is vital in computing. Our parents' guide explains how children learn about sequences in algorithms and programs in KS1 and KS2 computing. By Billy Rebecchi

What are sequences?

Sequences are one of the key principles used in programming and they allow us to define what should happen next in an algorithm or a program.

Without sequencing everything would happen out of order and a program that we had written would not end up completing the task for which it was originally designed.

How children learn about sequences in KS1

In KS1 your child will be introduced to the idea of sequences used in writing algorithms.

A sequence is a series of events that must be performed in order to achieve a task.

A common example of a task given at KS1 might be to draw a character using an algorithm to show what body parts need to be added at what time. For example, you might decide to draw a circle first, which can be the body of your character. Then you might add eyes, a mouth, a nose and some limbs, before adding any extra detail such as colour or hair.

Although you could probably run these steps in a different sequence and still achieve your end goal of drawing a character, doing these steps out of order would be tricky; drawing eyes without knowing where to put them in relation to a body or face is much more difficult. Therefore, by running our algorithm in the correct sequence, we have made our task easier to complete.

Once your child has learned the basics of writing a sequence they may be asked to write some sequences of their own for basic tasks.

The concepts learned about sequences will then feed into your child's understanding of how to write an algorithm for an everyday task such as brushing your teeth.

Sequences also link to learning about debugging; having your sequence out of order will produce a computer bug. In order to find and fix the bug it is necessary to discover which step of the algorithm is out of order and work out what needs to be changed to make the algorithm run correctly.

How children learn about sequences in KS2

In KS2 the idea of sequences is developed further to explain more about the consequences of writing an algorithm with an incorrect sequence. This will often be tied into the concept of games programming where player input is used to control a character on screen. A sequence of events must occur in the correct order for a player to get their character to the end of a game level. If these events are performed out of sequence, the character will fail and the game will need to restart. Take the following example of a computer game level:

The aim of the game is to get the character on the left-hand side of the level past both the obstacles and to the end of the level, somewhere off screen to the right. The character will have to first jump over the lava pit, before rolling under the obstacle and finally reaching the end of the screen, thus completing the level. If the player tried to roll at the lava pit then they would end up failing the level and having to restart, and if the player tried to jump at the second obstacle then they would get stuck, which would cost them precious seconds if the game score were based on completion time.

Sequences in primary school: what your child learns year-by-year

Please note that the following guidelines for what is taught in each primary year is for guidance only and may not be representative of the way computing is taught at your child’s school.

Year 1
Basic sequences for completing tasks such as drawing a character are introduced.

Year 2
Students are asked to develop their own sequences for everyday tasks such as putting a coat on.

Year 3
The concept of sequences is linked to debugging and students learn to debug algorithms into the correct order.

Year 4
Students start to write algorithms using sequences in a visual programming language such as Scratch.

Year 5
Students learn that algorithms in different sequences can still achieve the same task (for example, adding milk before sugar when making a cup of tea).

Year 6
Sequences will be tied in to using loops and conditions to create complex algorithms.