New offer! Get 30% off your first 2 months of Unlimited Monthly. Start your subscription for just £29.99 £19.99. New subscribers only. T&Cs apply

# Repeating Patterns

Repeating patterns can be found everywhere in the world all around you. In this step, you will look at some real-world examples of repetition and then think about how the concept of repetition can be used when designing a program.
2.7
Repetition and patterns can be found everywhere in the world, all around you. Patterns can range from the simple repeating patterns like the black and white stripes on a pedestrian crossing, the annual cycle of seasons, the pattern of black and white keys on a piano, or the repetitive structure of your favourite song. These coloured flags form a pattern from left to right– red, yellow, blue, green, red, yellow, blue. So you’d probably predict that the next flag is green, the fourth colour in the repeating pattern. By recognising that every fourth flag is green, you could predict colours of each flag even further in the sequence. What colour do you think the 16th and 40th flags would be?
53.6
Helping your pupils to understand the nature of repetition and patterns in the real world will help them transition to using these concepts in programming. A fun example can be the physical actions in a dance routine. Step right, step right, step left, step left, clap, turn around. You probably noticed the right and left steps were repeated, so you could simplify these instructions and get the same result. Step right times two, step left times two, clap, turn around. As with patterns, you should look for different examples of repeated actions that you can use with your class. Repetition is an important concept in developing programming skills and is commonly used in algorithms to help simplify processes.
111.5
Using repetition allows you to create programs quicker, there are fewer opportunities to make mistakes, and it’s easier to check for errors in your code. What patterns could you use to help your pupils identify repetition in the world around them? Share your thoughts in the comments below.

Repeating patterns can be found everywhere in the world all around you. In this step, you will look at some real-world examples of repetition and then think about how the concept of repetition can be used when designing a program.

## Repeating Patterns Everywhere

Patterns can range from simple repeating patterns, like road markings of a pedestrian crossing with black and white stripes, to patterns in nature, such as the seasons. You might notice the repeating pattern of black and white keys on a piano or the repetitive structure of your favourite song.

If you take a look at the flags above from left to right, you might notice the start of a repeating pattern. The pattern is red, yellow, blue, green, red, yellow, blue, so you’d probably predict that the next flag would be green, the fourth colour in the repeating pattern. By recognising this, you could predict flag colours even further along in the sequence. Every fourth flag will be green, so what would you predict the 16th and 40th flags would be?

It can be useful to represent patterns using numbers. For the flags, the pattern would look like this: 1234 123?, and you’d expect it to continue:

1234, 1234, 1234, 1234, and so on.

Each of these numbers then represents the colour of a flag – but these numbers could actually represent any sequence of items which repeats every four items.

You will need to help your learners understand the nature of repetition and patterns before they can use those concepts in programming. I would suggest that you first start exploring repetition and patterns around them in the real world. By looking at patterns together, your learners will start to understand the concept of repetition.

## Repetition in Actions

Repeating patterns can also be identified in some physical actions. For example, if you were learning the steps of a dance routine, you might have to follow these instructions:

1. Step right
2. Step right
3. Step left
4. Step left
5. Clap
6. Turn around

Can you identify which steps are repeated? You may have noticed that you step right twice and step left twice. These instructions can be simplified to:

1. Step right twice
2. Step left twice
3. Clap
4. Turn around

These instructions will achieve the same outcome as those before. As with patterns, you should look for different examples of repeated actions that you can use with your learners.

## Why are Repeating Patterns Important in Programming?

Being able to identify patterns in everyday life can help learners to identify patterns in programming. Repetition is an important concept in developing programming skills and is commonly used in algorithms to help simplify processes. Using repetition in your programs has its advantages. Firstly, you use fewer commands which makes it quicker to create a working program. As well as this, using fewer commands makes it easier to check for errors in your code.