Skip to content
Lesson 4

What Is A Pattern

A pattern is a thing that repeats. The repetition can be in space, like the shapes on a chaadar. It can be in time, like the call to prayer five times a day. It can be in numbers, like multiples of seven. It can be in l…

There is more than one way to understand this. If you have only been taught one, you have been taught less than you deserve.

There is more than one way to understand this. If you have only been taught one, you have been taught less than you deserve.

A pattern is a thing that repeats. The repetition can be in space, like the shapes on a chaadar. It can be in time, like the call to prayer five times a day. It can be in numbers, like multiples of seven. It can be in language, like the rhyme at the end of every couplet of a ghazal. The brain is a pattern detector by design. Long before anyone taught you mathematics, you noticed that night follows day, that hunger follows long gaps after meals, that adults are happier on Fridays. You were doing pattern recognition without a name for it. Studying patterns formally is just sharpening a tool you already had.

Patterns in nature, painted on the back of every Bedford truck on Shahrah-e-Faisal. Look at truck art carefully and you will see patterns inside patterns. The border on the bumper repeats a single floral motif twenty times. The peacock in the centre is itself a tiling of curved triangles, each triangle a smaller copy of the whole bird's curve. Mathematicians call this self-similarity. The artist who paints these trucks in Karachi or Rawalpindi has not read a paper on fractals, but she has internalised one of the deepest ideas in geometry, that beauty often comes from the same shape repeating at different scales. The same idea sits inside an ajrak from Bhit Shah, the geometry of a Multani blue tile, the latticework on the windows of Wazir Khan mosque.

Patterns in language. Open a divan of Mir or Ghalib or Faiz. Notice that every couplet ends in the same rhyme, called the radif, and the second line of each couplet ends in the same word, called the qaafiya. The pattern is so strict that the moment a poet breaks it, the listener flinches. The metre, called the bahr, gives each line the same number of syllables in the same rhythm. A trained ear hears a wrong syllable the way you hear a wrong note in a song. Urdu poetry is a system of patterns hundreds of years old. When you memorise a ghazal, you are not memorising random words, you are memorising a structure that holds the words in place. The same is true of Punjabi tappay, of Pashto landay, of Sindhi dohas.

Patterns in numbers. The most famous example, found in pine cones, sunflower heads, and the spirals of Karachi seashells, is the Fibonacci sequence. Start with 1, 1. Add the last two to get the next. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55. The rule is shorter than the sequence it produces. Three Pakistani examples close to home. The number of petals on a gulab is often a Fibonacci number. The way a dholak's beat doubles, halves, and recombines in a Punjabi wedding follows a similar mathematical structure. The way numbers in a milad invitation list grow as each new family is added, where every entry brings two more, is the same exponential pattern that lives behind compound interest at HBL. A short rule, applied again and again, produces something that looks complicated but isn't.

Why this matters. Every machine learning system, every search engine, every recommendation feed, every fraud detector at HBL or Easypaisa, is at heart a pattern recogniser. The work it does is to take a giant pile of past examples and lift out the rule. The danger is that a pattern detector also picks up patterns that are accidents of the data. If a model learns from CV photos that men get more jobs than women, it has learned a pattern that exists, but it has also learned to copy a national injustice forward. To be useful with patterns, you need two skills. The first is finding them. The second is asking, is this pattern a real rule about the world, or only a habit of the people who made the data. The next lesson takes the next step, looking at how separate patterns combine into systems.

Estimated time: 12 min