Spot the Pattern

Solve once. Reuse forever.


Year 8 Computer Science — Pattern Recognition

What's the pattern?

14, 7, 21, 35, 28 → ?

cat, bat, hat, mat → ?

login page, shopping cart, booking form → ?


Pattern recognition is a core human skill — and a core CS skill.

Spotting patterns lets us write one solution that works everywhere.

Your Scenario

Each person in the group gets ONE scenario card.

Share in Your Group

Now share all three algorithms with each other.


What's the same? What's different? What's the common structure?

Write the General Algorithm

Replace specific words with placeholders:

[ITEMS] instead of people / books / students
[DESTINATION] instead of exit / shelf / subject
[CAPACITY] instead of 600 / 80 / 30
[CRITERIA] instead of nearest / subject / preference
[OVERFLOW] instead of redirect / storage / waiting list

Write ONE algorithm. Test it on all three scenarios.

Test It

Substitute real words back into the general algorithm for each scenario.

Does it work for all three? Note any adjustments needed.


How many lines did writing ONE general solution save vs THREE specific ones?

That's the power of pattern recognition.

Real World

Sorting algorithms work on numbers, names, dates, and more — same algorithm, different data.

Form validation checks email, phone, postcode — same pattern, different fields.

Database queries filter users, products, orders — same template, different tables.

Key Takeaway

Pattern recognition lets us write one solution that works everywhere.

That's how libraries, frameworks, and standard algorithms are built — generalise once, apply everywhere.

Discussion

1 / 9