Computational Thinking · Cambridge syllabus 7.1, 7.2, 7.3 · Lesson 2 of 4
Abstraction
Abstraction keeps information needed for a purpose while omitting irrelevant detail. A model must preserve the relationships required to solve the problem; simplification should not remove essential constraints.
By the end, you can
- Understand abstraction.
- Identify relevant information in a problem.
- Ignore unnecessary detail.
- Create simplified representations of problems.
Simplifying problems
Abstraction is removing the detail that does not matter for the problem in hand, and keeping only what does. It is what makes a problem manageable after decomposition has made it small.
A map is the standard illustration. An underground map shows the order of the stations and where the lines meet, and is deliberately wrong about distance, direction and the shape of the tunnels — because a passenger needs to know where to change trains and nothing else. A walking map of the same city keeps exactly what the underground map threw away. Neither is incomplete; each keeps what its purpose needs.
In a program it means deciding what to store and what to ignore. A school register needs a pupil name, an identifier and attendance; it does not need their eye colour or their favourite food, even though those are equally true. A flight simulator models lift, drag and thrust and ignores the colour of the seats.
Judging it is the skill: keeping too much makes the program complicated and slow, and throwing away something that mattered makes it wrong. The question to ask of every detail is whether the answer would change without it.
It is also what lets you use something without understanding its insides. A programmer calling a square-root function needs to know what goes in and what comes out, not the method inside — the function is an abstraction of it.
Worth remembering
- Keep what the problem needs and discard the rest.
- A map keeps what its purpose needs and is deliberately wrong about the rest.
- Too much detail is complicated; too little is wrong.
Worked example
A route map can retain stations and connections while omitting exact building shapes.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
Distance and the applicable fare rules are relevant; the bus’s paint colour is normally irrelevant.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.