Walk into any home during a festival and look at the floor near the entrance. Chances are you will find a rangoli — a design made of coloured powder or flower petals, built from dots and lines arranged in a repeating, symmetric pattern. Now think about your school timetable. Monday to Friday, the first bell rings at the same time, the same subjects return on the same days each week, and the cycle begins again the following Monday. Think, too, about the traffic signal at a busy crossing: red, then green, then amber, then red again, in an order that never changes, so that everyone on the road — pedestrians, cyclists, drivers — can predict exactly what will happen next. A rangoli, a timetable, and a traffic signal look nothing alike, yet all three are built on the same idea: something arranged so that it repeats, grows, or changes according to a rule.

Human beings are remarkably good at noticing this kind of regularity, and we rely on it far more than we usually realise. Long before anyone wrote down the rules of mathematics, people were already using patterns to track the phases of the moon, to weave designs into cloth, to compose rhythms in music, and to lay bricks in a wall so that it would stand strong for generations. Recognising a pattern lets us do something powerful: predict what comes next without having to see it for ourselves. If you know that a wall is being built by placing one less brick in every row above the last, you do not need to count the bricks in row twenty to know how many there will be — you can work it out from the rule alone.

This ability to look at a few examples, notice what stays the same and what changes, and then predict what should logically come next, is not just a mathematical skill. It is one of the most important skills in computational thinking, and it is also the very first step that machines take when they are taught to “recognise” something — whether that is a face in a photograph, a fraudulent bank transaction, or your voice giving a command to a smart speaker. In this chapter, we begin with numbers, grids, and shapes, because they let us practise pattern recognition in its purest and most visible form, using diagrams and charts at every step, before we meet the idea again later in this book when we explore how computers use patterns to make decisions.

Think About It

Before you read further, look around your classroom for thirty seconds. Can you spot two things that are arranged in a pattern? It could be the arrangement of desks, the tiles on the floor, the pattern on a classmate's uniform, or the way books are stacked on a shelf. Sketch what you notice in your notebook.

Last modified: Thursday, 8 October 2026, 5:55 AM