2.1.1

Computational thinking

GCSE Computer Science 2.1.1: the three principles of computational thinking — abstraction, decomposition and algorithmic thinking — and how each is used to define and refine a problem.

About 10 minutes to read

The three principles

Computational thinking is the approach used to turn a real problem into something a computer can be programmed to solve. The specification requires an understanding of the three principles and, importantly, of how they are used to define and refine problems — so questions tend to give you a scenario and ask which principle is being applied, or how you would apply it.

Abstraction
Removing unnecessary detail from a problem so that only what matters to the solution remains.
Decomposition
Breaking a large problem down into smaller, more manageable sub-problems that can be solved one at a time.
Algorithmic thinking
Working out the sequence of steps needed to solve a problem, so that the solution can be followed and repeated.

Abstraction is the one students most often get wrong, because it sounds vague. It is not simplifying for the sake of it — it is deciding which details are relevant and discarding the rest.

A route-planning app is the clearest example. The real world contains buildings, weather, road surfaces, the colour of the tarmac and the names of the shops. A route planner keeps roads, junctions, distances and speed limits, and throws away everything else. Nothing has been lost that affects the answer, and the problem has become small enough to compute.

Decomposition then makes the remaining problem tractable. A single instruction to "write a route planner" cannot be started. Broken down — read the start and end points, look up the roads between them, calculate the length of each possible route, choose the shortest, display it — each part is small enough to write, test and, crucially, hand to a different person to write in parallel.

Algorithmic thinking is what happens inside each of those parts: setting out the precise steps, in order, that produce the result.

Applying the principles

Worked example

A supermarket wants a self-service checkout system. Explain how abstraction and decomposition would be used in designing it.

  1. For abstraction, ask what the checkout actually needs to know about each item.
  2. It needs the barcode, the price, the weight and whether the item is age-restricted. It does not need the colour of the packaging, the shape of the tin or where the item sits on the shelf.
  3. State the benefit: the model is simpler and the program has less to process.
  4. For decomposition, split the whole task into the sub-tasks the system performs.
  5. Name several genuinely separate parts, not just two.

Answer: Abstraction would keep only the details relevant to checking out — barcode, price, weight and any age restriction — and discard details such as packaging colour or shelf position, which have no effect on the transaction. Decomposition would split the system into separate sub-problems: scanning a barcode, looking up the price, keeping a running total, checking the weight on the bagging area, handling age-restricted items, and taking payment. Each can then be written and tested on its own.

Common mistake

Abstraction is not the same as decomposition. Abstraction removes detail that does not matter; decomposition breaks the problem into smaller parts. A question asking about one will not accept an answer about the other.

Before you practise

  • The three principles: abstraction, decomposition, algorithmic thinking.
  • Abstraction removes detail that is irrelevant to the solution.
  • Decomposition breaks a problem into smaller sub-problems that can be solved separately.
  • Decomposed parts can be written, tested and reused independently, and shared between people.
  • Algorithmic thinking works out the precise ordered steps that solve the problem.
  • Questions usually give a scenario and ask which principle applies, so name the principle and then apply it to that scenario.

Now practise it

Reading is the easy half. Answer questions on 2.1.1 Computational thinking and find out which parts you actually know.