BBC Pattern recognition in practice
Why do we need to look for patterns?
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.
Recognising patterns
Patterns among different problems
To find patterns among problems we look for things that are the same (or very similar) for each problem.
For example, decomposing the task of baking a cake would highlight the need for us to know the solutions to a series of smaller problems:
- what kind of cake we want to bake
- what ingredients we need and how much of each
- how many people we want to bake the cake for
- how long we need to bake the cake for
- when we need to add each ingredient
- what equipment we need
Once we know how to bake one particular type of cake, we can see that baking another type of cake is not that different – because patterns exist.
For example:
- each cake will need a precise quantity of specific ingredients
- ingredients will get added at a specific time
- each cake will bake for a specific period of time
Once we have the patterns identified, we can work on common solutions between the problems.
Patterns within problems
Patterns may also exist within the smaller problems we have decomposed to.
If we look at baking a cake, we can find patterns within the smaller problems, too. For example, for ‘each cake will need a precise quantity of specific ingredients’, each ingredient needs:
- identifying (naming)
- a specific measurement
Once we know how to identify each ingredient and its amount, we can apply that pattern to all ingredients. Again, all that changes is the specifics.
BBC Pattern recognition
Pattern recognition
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?
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
BBC Decomposition example: creating an app
Decomposing creating an app
How would you decompose the task of creating an app?
To decompose this task, you would need to know the answer to a series of smaller problems:
- what kind of app you want to create
- what your app will look like
- who the target audience for your app is
- what your graphics will look like
- what audio you will include
- what software you will use to build your app
- how the user will navigate your app
- how you will test your app
- where you will sell your app
This list has broken down the complex problem of creating an app into much simpler problems that can now be worked out. You may also be able to get other people to help you with different individual parts of the app. For example, you may have a friend who can create the graphics, while another will be your tester.