On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

CS Thinking · Computational Thinking · Grade 3-5

Abstraction

Focusing only on the essential information needed to solve a problem while ignoring irrelevant details.

model=essential details−irrelevant details

Quick Answer

Focusing only on the essential information needed to solve a problem while ignoring irrelevant details. Use it when a problem comes with more detail than you need. A subway map drops the streets and keeps only stations and lines, because that is all a rider needs. Decide what question you must answer, keep the details that change the answer, and leave out the rest. In programming, a name like drawCircle hides the many small steps inside it.

Why This Matters

Abstraction lets you solve hard problems without drowning in detail: a bus route map fits on one page, and a game can treat every enemy as just a position and a speed. Leave out the wrong detail, though, and the answer breaks, like a map that forgets a closed bridge. Keep everything, and the problem stays as messy as it was.

Intuitive Explanation

Read this word problem: 'Maya, who has red sneakers and loves art, buys 3 packs of stickers. Each pack has 12 stickers. It is a sunny Tuesday. How many stickers does she have?' To answer, you need only 3 packs and 12 stickers in each: 3×12=36. The sneakers, the art, and the weather do not change the answer, so you set them aside. That is abstraction: keep what matters for the question and ignore the rest.

Computer scientists do this all the time. A map app treats roads as lines with lengths and speed limits and ignores trees and house colours. A video game stores a ball as just its position, size, and speed, not every stitch on it. A button labelled 'Print' hides all the steps that send a page to the printer, so you only need to know what the button does.

What counts as extra depends on the question. If the problem asked 'What colour are Maya's shoes?', red sneakers would be the one detail to keep. And abstraction is not the same as being vague. 'She bought some stickers' throws away the numbers you need; that is not a simpler model, just a wrong one. A good abstraction is exact about what it keeps.

Think of it like this. Abstraction is like packing your school bag for one day. You check the timetable and pack only what today's lessons need, leaving the rest at home. Pack too little and your maths book is missing; pack everything and the bag is too heavy to carry. A different day, like a different question, means packing differently.

Core idea. Good abstraction reveals what matters and hides what doesn't.


When to Use

Use abstraction when a problem has extra details, when you are simplifying a real thing into a model (a map, a diagram, a game character), or when you want to hide the inside of something behind a simple name or button. Ask whether each detail could change the answer. If the job is to find what several examples have in common, use Pattern Recognition; if you need to break a big job into parts, use Decomposition.

Tip. Ask: Does the problem carry details that do not change the answer, which you can leave out or hide behind a simpler model?

How to Recognize It

Before you abstract, write down the one question you have to answer, then sort every detail by whether it changes that answer.

  1. Does the problem give you details you do not need for the answer?

    Yes means abstraction will help: leave those details out. No means every detail matters and there is nothing to hide.

  2. Would the answer change if you removed this detail?

    Yes means keep it, because dropping it makes your model wrong. No means it can safely go.

  3. Are you looking at several different cases to find what repeats?

    Yes points to Pattern Recognition instead. Abstraction works even on one case, by choosing what to keep.

  4. Are you splitting a big job into smaller jobs?

    Yes points to Decomposition. Abstraction does not split anything; it makes one thing simpler by leaving out detail.

Abstraction vs Decomposition vs Pattern Recognition vs Modeling

These all make a problem easier to think about, so they are easy to mix up. Abstraction is the one that decides which details a problem needs and hides or drops the rest.

Abstraction

Meaning
Abstraction keeps exactly the details that change the answer and hides everything else behind a simpler picture or name.
Key test
Keep the details that change the answer; drop the rest.
Formula
model=essential details−irrelevant details
Example
A game character drawn as a stick figure keeps the arms and legs the game moves and leaves out the face and fingers.

Decomposition

Meaning
Decomposition splits a big problem into smaller parts that can be done one at a time.
Key test
The problem gets cut into parts, not trimmed of detail.
Example
Putting on a school play by splitting it into scenes, costumes and music.

Pattern Recognition

Meaning
Pattern recognition compares several cases to find what they share or how they change.
Key test
Needs several cases side by side.
Example
Noticing that every third day on the school timetable has art.

Modeling

Meaning
Modeling builds a working copy of a real thing, such as a formula or a program, that you can use to predict what happens.
Key test
You build something you can run or calculate with to predict.
Example
A program that predicts how tall a plant will be if it grows 2 cm every day.

Formula & Notation

model=essential details−irrelevant details
Abstraction defines a mapping from a concrete domain D to a simplified domain D′ that preserves the properties relevant to the problem while discarding implementation details.

Worked Examples

Example 1 — Keep only what the question needs

Easy

A school bus leaves at 7:40 a.m. It is yellow, has 48 seats, and its driver is Mr. Diaz. It makes 6 stops, and each stop takes 5 minutes to reach. At what time does it reach the last stop?
Show the steps and the answer
  1. Read the question first: it asks for a time.

    Knowing what is asked tells you which details matter.

  2. Keep: leaves at 7:40, 6 stops, 5 minutes each. Set aside: yellow, 48 seats, Mr. Diaz.

    The colour, the seats, and the driver's name do not change when the bus arrives.

  3. Work out the travel time: 6×5=30 minutes.

    Each stop adds the same 5 minutes.

  4. Add it to the start: 7:40 + 30 minutes = 8:10 a.m.

    20 minutes takes the clock to 8:00, and 10 more makes 8:10.

Answer: 8:10 a.m.

Takeaway: Decide what the question asks first, then keep only the details that change that answer.

Example 2 — Same story, different question

Standard

Same bus: it leaves at 7:40 a.m., is yellow, has 48 seats, is driven by Mr. Diaz, and makes 6 stops. This time 9 children get on at each stop. Will every child get a seat?
Show the steps and the answer
  1. Read the new question: it is about seats, not time.

    A new question can change which details matter.

  2. Keep: 48 seats, 6 stops, 9 children per stop. Set aside: 7:40, yellow, Mr. Diaz.

    The seat count we ignored last time is now the key detail, and the time is now the extra one.

  3. Count the riders: 6×9=54 children.

    Each stop adds 9 more children.

  4. Compare: 54−48=6, so 6 children have no seat.

    There are more children than seats.

Answer: No. 54 children ride but there are only 48 seats, so 6 children have no seat.

Takeaway: There is no single right abstraction; what you keep depends on the question being asked.

Example 3 — Find the mistake: dropping a detail that matters

Application

Ellie draws a simple map for walking from home to the library. It shows two routes, Oak Street (400 m) and Pine Street (600 m), and nothing else. She left out a sign on Oak Street that says 'Bridge closed', and she plans to walk along Oak Street. Find the mistake and fix the map.
Show the steps and the answer
  1. Look at what she dropped: the closed bridge on Oak Street.

    That detail changes the answer, because her chosen route cannot be walked.

  2. Name the error: she removed a detail that matters.

    Abstraction should leave out only details that do not change the answer, and this one does.

  3. Fix the map: mark 'bridge closed' on Oak Street.

    Now the map shows that the 400 m route is blocked.

  4. Choose again: take Pine Street, 600 m.

    It is longer, but it is the shortest route that can actually be walked.

Answer: Keep the closed bridge on the map; the route that works is Pine Street, 600 m.

Takeaway: Before you drop a detail, ask whether it could change the answer; if it could, keep it.

Where You'll See It

  • A subway map

    It hides the exact streets and distances and shows only the stops and connections you need, which is the essential information for getting from one station to another.

  • Driving a car without knowing the engine

    The steering wheel and pedals are an abstraction: you control the car using a few simple controls while all the complicated engine details stay hidden.

  • A TV remote

    Pressing 'volume up' hides all the circuits and signals; you only deal with the essential idea (louder) and the messy details are tucked away.

Common Mistakes

  1. The slip: Abstraction means leaving out as much detail as you can.

    Why it's tempting: Hiding more detail makes the model look simpler, which feels like better abstraction.

    Instead: A good abstraction hides only the irrelevant details and keeps everything essential for correctness; drop a needed detail and the model becomes wrong, not simpler.

  2. The slip: An abstraction that is vague is the same as one that is simple.

    Why it's tempting: Both leave things out, so vague and abstract feel like the same thing.

    Instead: A good abstraction is precise about exactly what it exposes and what it hides; vagueness leaves it unclear, while abstraction makes a clear, simplified model.

  3. The slip: If a model still feels complicated, just keep all the details to be safe.

    Why it's tempting: Keeping every detail feels safer because nothing important can get lost.

    Instead: Under-abstracting leaves the model as hard as the original; the point is to remove what doesn't matter so you can reason at a higher level.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Sam buys 3 red apples at 20 cents each from a shop on Main Street on Tuesday. Which details do you need to find the cost, and what is it?

    Hint: Cross out every detail that would not change the cost.

  2. A train map shows 5 stations in a line, A to E, evenly spaced, but not the real distances. How many stops is a trip from A to D? Can the map tell you how many kilometres it is?

    Hint: What did the map keep, and what did it leave out?

  3. Write the rule shared by 2+3=3+2, 7+1=1+7 and 5+4=4+5 using letters instead of numbers.

    Hint: What stays the same in all three, even though the numbers change?

  4. A game character is stored as: name Zip, speed 5, colour blue, favourite food pizza. For a racing program, which 2 details should you keep?

    Hint: Which details could change who wins a race?

  5. You show the rule y=2x as a table (1 gives 2, 2 gives 4, 3 gives 6) and as a line on a graph. Is that abstraction or representation?

    Hint: Are you finding the rule, or showing a rule you already know?

  6. A 2 m board and a 50 cm board are laid end to end. A student drops the units and writes 2+50=52. What went wrong?

    Hint: Was every detail the student dropped really unimportant?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Is a toy car an abstraction of a real car?

In a way, yes. A toy car keeps the shape and the wheels and leaves out the engine, because a child only needs something that looks right and rolls. Engineers also build small model cars, but they keep the exact shape so they can test how air flows over it in a wind tunnel. The same object gets a different abstraction depending on what you need to find out.

Why is it called abstraction?

The word comes from a Latin word meaning 'to pull away'. When you abstract, you pull the important part away from all the extra detail around it. Artists use the same word: an abstract painting may show a tree as a few lines and colours. In computing the idea is the same, but the part you keep must still be enough to get the right answer.

Do computers use abstraction too?

Computers are built from layers of it. Deep inside, everything is tiny switches turning on and off. On top of that, people built instructions, then programming languages, then apps. When you tap a send button, you do not think about switches at all, and the person who made the app barely did either. Each layer hides the messy one below it, which is how people can build huge programs.

Learning Path

← Before

No prerequisites
Abstraction

You are here

No earlier lesson is required; if you have ever used a map, you have used abstraction. Abstraction teaches you to pick out the details a question depends on and leave the rest out. Next, Data Representation shows how to store the details you kept as numbers, text, or lists a computer can use, and Interface shows how a program hides its inside work behind a few simple controls, like the buttons on a remote.

See Also