Once we have decomposed a complex problem, it helps to examine the small problems for similarities or ‘patterns’. These patterns can help us to solve complex problems more efficiently.
What is pattern recognition?
When we decompose a complex problem we often find patterns among the smaller problems we create. The patterns are similarities or characteristics that some of the problems share.
Pattern recognition is one of the four cornerstones of Computer Science. It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently.
What are patterns?
Imagine that we want to draw a series of cats.
All cats share common characteristics. Among other things they all have eyes, tails and fur. They also like to eat fish and make meowing sounds.
Because we know that all cats have eyes, tails and fur, we can make a good attempt at drawing a cat, simply by including these common characteristics.
In computational thinking, these characteristics are known as patterns. Once we know how to describe one cat we can describe others, simply by following this pattern. The only things that are different are the specifics:
one cat may have green eyes, a long tail and black fur
another cat may have yellow eyes, a short tail and striped fur
If we want to draw a number of cats, finding a pattern to describe cats in general, eg they all have eyes, tails and fur, makes this task quicker and easier.
We know that all cats follow this pattern, so we don’t have to stop each time we start to draw a new cat to work this out. From the patterns we know cats follow, we can quickly draw several cats.
PLAY THIS GAME ABOVE TO TEST YOUR PATTERN RECOGNITION
Why do we need to look for patterns?
Finding patterns is extremely important. Patterns make our task simpler. Problems are easier to solve when they share patterns, because we can use the same problem-solving solution wherever the pattern exists.
The more patterns we can find, the easier and quicker our overall task of problem solving will be.
What happens when we don’t look for patterns?
Suppose we hadn’t looked for patterns in cats. Each time we wanted to draw a cat, we would have to stop and work out what a cat looked like. This would slow us down.
We could still draw our cats - and they would look like cats - but each cat would take far longer to draw. This would be very inefficient, and a poor way to go about solving the cat-drawing task.
In addition, if we don’t look for patterns we might not realise that all cats have eyes, tails and fur. When drawn, our cats might not even look like cats. In this case, because we didn’t recognise the pattern, we would be solving the problem incorrectly.