One-sentence summary
A pattern is a relationship or order that repeats inside data, and noticing it is the first step to making predictions, both in everyday life and in machine learning.
Why does it matter?
The world can look random, but many things actually repeat. People wear coats when it gets cold, more games get played on the weekend, and street lamps turn on in the evening. These repetitions are called patterns.
Noticing patterns matters because:
- It helps us predict what might happen next.
- It is the foundation of artificial intelligence, the topic of the next lesson.
- It turns data into meaning; numbers on their own say little, but the relationship between them says a lot.
In the previous lesson we learned to read tables and charts. Now we will learn to look for the repeating relationships inside those tables, which are patterns. What we call machine learning is, to a large degree, exactly this: a computer finding patterns in data.
Short definition: A pattern is a relationship that repeats regularly in data and that we can notice.
What is a pattern and where do we meet it?
Repeating sequences
The simplest pattern is a repeating sequence. If you can predict the next item, there is a pattern.
Red, Blue, Red, Blue, Red, ...
You noticed the pattern here: the colours take turns. So the next item should be Blue. The same happens with numbers:
2, 4, 6, 8, 10, ...
Each number is 2 more than the one before it. Once you see this pattern, you can say the next number is 12. What matters is not the individual numbers but the relationship between them.
Repeating relationships in data
Patterns do not always have to be a straight sequence. Often a pattern is a relationship between two things: when one thing changes, another changes too.
- When it gets cold, people wear coats. As the temperature drops, the number of coats goes up. There is a relationship between temperature and clothing.
- More games get played on the weekend. When the day is "Saturday" or "Sunday," game time increases. There is a pattern between the day and play time.
In both examples, if we know one thing we can predict the other. That is the power of a pattern.
A pattern is not the same as a coincidence
Not every repetition is a pattern. If it rained on Tuesday for one week, we cannot say "it always rains on Tuesdays." A real pattern usually needs many examples. A conclusion drawn from too little data can be misleading. We will talk about this more in later lessons.
How do we find a pattern in data?
Example table: Weather and coats
Suppose that for one week we wrote down each day's temperature and whether we wore a coat that day.
| Day | Temperature (°C) | Coat worn? |
|---|---|---|
| Monday | 8 | Yes |
| Tuesday | 20 | No |
| Wednesday | 6 | Yes |
| Thursday | 22 | No |
| Friday | 10 | Yes |
| Saturday | 24 | No |
| Sunday | 7 | Yes |
Looking carefully at the table, we notice a pattern: when the temperature is low (around 10 degrees or below) a coat was worn, and when it is high it was not. We can turn this relationship into a rule:
If the temperature is below 12 degrees
prediction: a coat is worn
Otherwise
prediction: a coat is not worn
This simple rule is called rule-based classification. We found the rule ourselves by looking at the data. In machine learning, the computer tries to find rules like this on its own, but the idea is the same: capture the repeating relationship in the data.
Finding the pattern with code
Let's write the same idea in Python: a small program that looks at the temperatures and makes a prediction with a simple rule.
# Day: (temperature, actual result)
data = [8, 20, 6, 22, 10, 24, 7]
actual = ["Yes", "No", "Yes", "No", "Yes", "No", "Yes"]
threshold = 12 # the boundary we drew from the pattern
correct = 0
for i in range(len(data)):
guess = "Yes" if data[i] < threshold else "No"
if guess == actual[i]:
correct += 1
print("Correct guesses:", correct, "/", len(data))
This program is not an "artificial intelligence." It only applies the simple rule we found and counts how many days it predicted correctly. If we run it, it gets all 7 of the 7 days right. The result is high because the rule fits this data well, but on different data the same rule could be wrong.
Hands-on mini task
The table below shows how long a child played each day for one week.
| Day | Weekend? | Play time (minutes) |
|---|---|---|
| Monday | No | 20 |
| Tuesday | No | 15 |
| Wednesday | No | 25 |
| Thursday | No | 20 |
| Friday | No | 30 |
| Saturday | Yes | 90 |
| Sunday | Yes | 80 |
Task
- Look at the table and write the repeating relationship in your own words. In which case does play time go up?
- Turn the pattern you found into a rule like this: "If ..., then play time is long."
- What is your prediction for next Saturday: short or long?
Note: There is no single "correct sentence" here; what matters is that you can state the relationship clearly by looking at the data.
Common mistakes
Drawing a conclusion from too little data
A single day or two examples does not prove there is a pattern. A repetition you see once could be a coincidence. A reliable pattern needs many examples.
Reading the relationship backwards
Saying "the weather got cold because coats were worn" is wrong. Coats are worn because the weather is cold. A pattern shows that two things change together, but it does not always tell us which one is the cause.
Treating a pattern as an unbreakable rule
"There is always lots of play on the weekend" is a tendency, not a fixed law. On a weekend when someone is ill, the pattern can break. Patterns help us predict, but they do not guarantee.
Safety note
To find patterns we need data. We must be careful when we collect and use that data:
- Do not share your personal information. Do not enter your name, address, school, phone number, or photos into online AI tools or datasets. Use made-up or general examples for practice.
- Adult guidance. Use AI tools together with an adult and follow the platform's age rules.
- Question the results. A pattern, or a result an AI gives, is not always correct. If the data is incomplete or biased, the result will be biased too. Do not make an important decision based on a pattern alone; verify it.
Remember: AI is not magic; it is a tool that finds patterns in data. We are responsible for how we use it.
Lesson summary
- A pattern is a relationship that repeats regularly in data and that we can notice.
- Patterns are everywhere in daily life: coats when it gets cold, more games on the weekend.
- When we notice a pattern, we can predict the next situation.
- A simple pattern can be turned into an "if ..., then ..." rule; this is called rule-based classification.
- The core idea of machine learning is a computer finding patterns in data, but reliable patterns need plenty of data and careful interpretation.
Check questions
- What is a pattern? Define it in your own words.
- What should the next item in this sequence be: 3, 6, 9, 12, ...?
- In the sentence "when it gets cold, people wear coats," what are the two things that are related?
- Why is a single example usually not enough to prove a pattern?
- Why is it not a good idea to enter your name and address into an AI tool?
Answers
- A pattern is a relationship or order that repeats regularly in data and that we can notice. When we see it, we can predict the next situation.
- 15. Each number is 3 more than the one before; the pattern is increasing by 3.
- The temperature and whether a coat is worn. As the temperature drops, the chance of wearing a coat goes up.
- Because a single example could be a coincidence. A reliable pattern needs many examples that show the same relationship.
- Because personal information is private; once entered into online tools it can end up in other people's hands. Protecting this information keeps us safe.
Source and verification note
For “What Is a Pattern?”, verification focuses on whether the relationship between What is a pattern and where do we meet it? and Repeating relationships in data remains consistent across examples. Datasets in this module are small and educational; real personal data should not be used. An AI result should be evaluated not only for accuracy but also for data balance, error distribution and explainability.
Next lesson
What Is Artificial Intelligence? Starting from the idea of finding patterns, we honestly examine what AI is, what it is not, and how it works.