You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers pattern recognition, one of the four key components of computational thinking as required by OCR J277 Section 2.1. Pattern recognition helps us solve problems more efficiently by identifying similarities between problems and reusing existing solutions.
Pattern recognition is the process of identifying similarities, trends, or recurring elements within and between problems. By recognising patterns, we can:
| Situation | Pattern Recognised |
|---|---|
| Weather forecasting | Temperature and weather follow seasonal patterns — summer is typically warmer than winter |
| Traffic | Roads are busiest at the same times each day (rush hour) |
| Music | Songs follow patterns — verse, chorus, verse, chorus, bridge, chorus |
| Language | Grammar follows patterns — most English verbs add "-ed" for past tense |
| Shopping | Sales patterns — shops have sales at predictable times (Black Friday, January sales) |
In computer science, pattern recognition is used to:
When decomposing multiple problems, you may notice that some sub-problems appear repeatedly.
Example: Building a quiz app and a flashcard app
| Quiz App Sub-Problems | Flashcard App Sub-Problems |
|---|---|
| Load questions from file | Load cards from file |
| Display question to user | Display card to user |
| Get user input | Get user input |
| Check answer | Check answer (flip card) |
| Track score | Track progress |
| Show results | Show summary |
Pattern recognised: Both apps need to load data, display items, get input, and track progress. A reusable module could handle these common tasks.
Many problems require similar algorithmic approaches:
| Pattern | Description | Where It Appears |
|---|---|---|
| Searching | Looking for a specific item in a collection | Finding a book in a library, searching a contact list |
| Sorting | Arranging items in a specific order | Alphabetical lists, leaderboards, search results |
| Counting | Tallying items that meet a condition | Counting votes, attendance tracking |
| Accumulating | Adding up a running total | Calculating total cost, averaging scores |
| Filtering | Selecting items that match criteria | Spam filters, age verification |
OCR Exam Tip: When the exam asks you to identify patterns, look for sub-problems that appear in multiple parts of the problem or that are similar to problems you have solved before. State clearly what the common element is and how recognising it helps (e.g. "the sorting algorithm used for the leaderboard can be reused for the results table").
Once a pattern is recognised, the solution can be generalised — adapted to work for a range of similar problems rather than just one specific case.
Specific problem: Calculate the average of 5 test scores. Generalised solution: Calculate the average of any number of values.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.