Skip to main content
AI Foundations

⏱ About 10 min10 XP

How Computers See Patterns

You can look at a picture and instantly know if it shows a cat or a dog, a sunny day or a stormy one. But how does a computer do it? Computers do not have eyes the way you do. They have something different — and once you understand it, you will see why numbers and patterns are so important.

Computers Only Understand Numbers

Everything inside a computer — every photo, every song, every word — is stored as numbers. Only numbers. That is the one language computers speak. A photo on your screen is made of millions of tiny colored dots called pixels. A pixel is a tiny square of one color. When you look at a photo of a sunset, you see orange and pink and purple. But the computer sees something like: 255, 100, 50, 240, 90, 45, 210, 80, 40... — thousands of numbers describing the color of each tiny pixel. To find a pattern in a photo, a computer looks for patterns in those numbers. For example: if many pixels in the center of an image have numbers that match the color orange, the computer might predict: this photo could be a sunset or a basketball!

The Big Idea

Computers turn everything into numbers. Then they look for patterns in the numbers. Patterns in pixels help them recognize pictures. Patterns in sound waves help them understand speech. Numbers all the way down!

Imagine you are teaching a younger sibling to recognize dogs. You would show them many photos: big dogs, small dogs, fluffy dogs, spotted dogs. After seeing many examples, they start to notice: dogs have four legs, two ears, fur, and a tail. They have found the pattern! That is exactly how AI learns to recognize pictures. We show it thousands of dog photos. For each photo, the computer records all the pixel numbers. Over time, it finds number patterns that most dog photos share. Next time it sees a new photo, it checks: do the numbers match the dog pattern? If yes, it says 'dog!'

Match each thing to how a computer stores it as numbers.

Terms

A photo
A song
A word
A video

Definitions

Numbers for thousands of photos shown very fast, plus sound numbers
Numbers describing the color of each tiny pixel
Numbers describing how loud each sound is at each moment
Numbers that stand for each letter in a special code

Drag terms onto their definitions, or click a term then click a definition to match.

Here is something cool: when AI compares patterns, it does not do it all at once. It breaks the big pattern into small pieces and compares piece by piece, really fast. A computer can compare millions of number patterns in the time it takes you to blink. That is why AI can look at a photo and tell you what is in it so quickly. It is not magic — it is just very fast counting and comparing.

Remember from Lesson 1

In our first lesson, we said a pattern is something that repeats or follows a rule. Computers find those repeating rules hiding inside numbers. The rule might be: these pixel numbers often appear together when there is a dog in the photo.

What does a computer use to store a photograph?

How does AI learn to recognize pictures of cats?

Pixel Color Decoder

  1. Draw a tiny 3-by-3 grid on paper — 9 squares total.
  2. Choose 3 colors (like red, blue, and yellow).
  3. Color each square any color you like.
  4. Write a number for each color: red = 1, blue = 2, yellow = 3.
  5. Now write the numbers in order from top-left to bottom-right.
  6. You have just made a simple 'pixel code' for your tiny image!
  7. Swap your number code with a family member and see if they can re-draw your picture from the numbers alone.