What Is a Pattern?

Learn to spot repeating patterns in data and how this relates to AI.

LESSON COMPASS

What will you use this page for?

Core idea

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.

Evidence to produce

Complete the page task with your own input, test conditions and reasoning.

Control trap

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…

Next connection

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.

Module sources: Python Tutorial · Arduino Learn

LevelBeginner
Age10–16
Duration30–45 min
PrerequisiteReading Tables and Charts
ContentStandard lesson · 1,457 words
Last updated

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:

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.

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.

Example table: Weather and coats table
DayTemperature (°C)Coat worn?
Monday8Yes
Tuesday20No
Wednesday6Yes
Thursday22No
Friday10Yes
Saturday24No
Sunday7Yes

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.

Hands-on mini task table
DayWeekend?Play time (minutes)
MondayNo20
TuesdayNo15
WednesdayNo25
ThursdayNo20
FridayNo30
SaturdayYes90
SundayYes80

Task

  1. Look at the table and write the repeating relationship in your own words. In which case does play time go up?
  2. Turn the pattern you found into a rule like this: "If ..., then play time is long."
  3. 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:

Remember: AI is not magic; it is a tool that finds patterns in data. We are responsible for how we use it.

Lesson summary

Check questions

  1. What is a pattern? Define it in your own words.
  2. What should the next item in this sequence be: 3, 6, 9, 12, ...?
  3. In the sentence "when it gets cold, people wear coats," what are the two things that are related?
  4. Why is a single example usually not enough to prove a pattern?
  5. Why is it not a good idea to enter your name and address into an AI tool?

Answers

  1. 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.
  2. 15. Each number is 3 more than the one before; the pattern is increasing by 3.
  3. The temperature and whether a coat is worn. As the temperature drops, the chance of wearing a coat goes up.
  4. Because a single example could be a coincidence. A reliable pattern needs many examples that show the same relationship.
  5. 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.

Start QuizBack to Introduction to Data and AI
QUESTION POOL

Reinforce this lesson with 10 questions

This lesson has a pool of 20 questions. Each attempt selects 10 and reshuffles the choices.