Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Computer Science
  3. ›B1 Computational thinking
  4. ›B1.1 Approaches to computational thinking

IB Computer Science · B1 · Computational thinking

B1.1 Approaches to computational thinking

Describe the main steps in solving a computational problem and explain how abstraction, decomposition, pattern recognition and generalisation support them.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5Computational problems are solved in a series of steps
  1. 1Computational problems are solved in a series of steps
  2. 2Abstraction removes detail that the problem does not need
  3. 3Decomposition splits a large problem into smaller parts
  4. 4Pattern recognition finds similarities that can be reused
  5. 5Generalisation turns a pattern into a reusable solution
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: Computational problems are solved in a series of steps

Planning a school trip means deciding where to go, who pays and how everyone travels. A computational problem needs the same care before any code is written. Computational thinking is the habit of working through such problems in an organised way.

The plan itself is an algorithm, a set of exact steps that always leads to a result. Building it usually follows five stages.

  • Understand the problem: what is given and what must be produced
  • Plan a solution as an algorithm
  • Implement the plan as a program
  • Test the program with a range of inputs
  • Evaluate the result and refine it

Common mistake

Starting to write code before understanding the problem is a common error. Without a clear plan, mistakes are much harder to find.

Key terms · tap one for its definition

computational thinking

Computational thinking is the process of analysing a problem and expressing its solution so that a computer or person can carry it out.

algorithm

An algorithm is a finite sequence of unambiguous steps that solves a problem or completes a task.

Part 1 done

2

Part 2 of 5: Abstraction removes detail that the problem does not need

Once the problem is clear, you must decide what to keep in your plan. A map of the underground shows stations and lines. It leaves out streets, buildings and true distances. This is abstraction.

In a program, abstraction decides what data to store. A library system needs a book’s title and its borrower. It does not need the colour of the cover. The result is a model, a simpler version of the real system.

Common mistake

Abstraction does not mean losing important detail. It removes only the detail that is irrelevant to the purpose.

Key terms · tap one for its definition

abstraction

Abstraction is the process of removing or hiding detail that is irrelevant to a problem so that its essential features stand out.

model

A model is a simplified representation of a real system that keeps only the features relevant to the problem.

Part 2 done

Quick check

One question on the part you just read

Easy

State which stage comes first when solving a computational problem.
Show answer and explanation

Answer: B · Worked explanation

The first stage is understanding the problem, which means knowing what is given and what must be produced. Writing the program comes later, after a plan exists. Starting with code is tempting, but without a clear understanding the plan and the program are likely to solve the wrong problem.
3

Part 3 of 5: Decomposition splits a large problem into smaller parts

Even a simplified problem can be too large to solve in one go. Decomposition breaks it into smaller sub-problems. Each sub-problem can be solved and tested on its own, and then the solutions are combined.

Organising a school concert shows the idea. One group handles tickets, another handles lighting, and a third handles music. In software, an online shop splits into a catalogue, a basket, a payment step and order tracking.

Figure 1. One large problem splits into four smaller sub-problems. Each can be solved and tested on its own.

Exam tip

When asked for an example, name the whole problem first. Then list the sub-problems it splits into.

Key term

decomposition

Decomposition is the process of breaking a complex problem into smaller sub-problems that can be solved separately.

Part 3 done

4

Part 4 of 5: Pattern recognition finds similarities that can be reused

After splitting a problem, you often find that some parts look alike. Pattern recognition is noticing features or behaviour that repeat. Sorting names and sorting prices, for example, both compare items and swap them into order.

Spotting a pattern saves effort. If you have solved one part, you can reuse the same approach on the others. Patterns also help you predict what a program will do next.

Patterns can appear inside one problem as well. A loop in code is a pattern, because the same steps repeat. Finding it keeps the solution short.

Key term

pattern recognition

Pattern recognition is the process of identifying similarities, trends or repeated structures within a problem or between problems.

Part 4 done

Quick check

One question on the part you just read

Easy

Which statement describes abstraction?
Show answer and explanation

Answer: C · Worked explanation

Abstraction removes or hides detail that is irrelevant to the purpose, leaving a simpler model. Breaking a problem into parts is decomposition, noticing repeated features is pattern recognition, and writing one solution for many cases is generalisation. Each of the other statements names a different technique.
5

Part 5 of 5: Generalisation turns a pattern into a reusable solution

Recognising a pattern is only half of the job. Generalisation writes the common steps once, in a form that works for many cases. A routine that adds any two numbers is more general than code that adds only 3 and 4.

A parameter makes this possible. The values that change become inputs, and the repeated steps stay fixed.

Pattern recognition compared with generalisation

FeaturePattern recognitionGeneralisation
Main actionNotices what repeatsWrites one solution for all cases
ResultA described similarityA reusable method
OrderComes firstFollows from the pattern
ExampleSeeing that two tasks both sortA sort routine for any list
Feature
Main action
Pattern recognition
Notices what repeats
Generalisation
Writes one solution for all cases
Feature
Result
Pattern recognition
A described similarity
Generalisation
A reusable method
Feature
Order
Pattern recognition
Comes first
Generalisation
Follows from the pattern
Feature
Example
Pattern recognition
Seeing that two tasks both sort
Generalisation
A sort routine for any list

Together they let one tested solution serve many problems.

Key terms · tap one for its definition

generalisation

Generalisation is the process of turning a recognised pattern into a solution that works for a whole class of problems.

parameter

A parameter is a named input to a routine, with its value supplied each time the routine is used.

Note read

Check your recall[15 marks]

5 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Outline[4 marks]

    Outline the main steps in solving a computational problem.

    Show mark schemeHide mark scheme

    Model answer

    First understand the problem, including what is given and what is needed. Then plan a solution as an algorithm and implement it as a program. Test the program, then evaluate and refine it.

    • 1 mark for stating that the problem must first be understood
    • 1 mark for stating that a solution or algorithm is planned
    • 1 mark for stating that the plan is implemented and tested
    • 1 mark for stating that the result is evaluated and refined
  2. 2.Explain[2 marks]

    Explain how abstraction simplifies a complex problem.

    Show mark schemeHide mark scheme

    Model answer

    Abstraction removes detail that is irrelevant to the problem. This leaves a simpler model that is easier to understand and to solve.

    • 1 mark for stating that irrelevant detail is removed or hidden
    • 1 mark for explaining that the simpler model is easier to understand or solve
  3. 3.Describe[3 marks]

    Describe how decomposition could be used to design a system that runs a school library.

    Show mark schemeHide mark scheme

    Model answer

    The whole library system is split into smaller sub-problems, such as recording books, loans, members and fines. Each sub-problem is solved and tested separately. The solutions are then combined into the full system.

    • 1 mark for stating that the system is broken into smaller sub-problems
    • 1 mark for giving suitable sub-problems such as books, loans, members or fines
    • 1 mark for stating that each part is solved separately and then combined
  4. 4.Compare[3 marks]

    Compare the roles of pattern recognition and generalisation in computational thinking.

    Show mark schemeHide mark scheme

    Model answer

    Pattern recognition identifies features or steps that repeat across problems. Generalisation uses that pattern to build one solution that works for many cases. Recognition comes first, and generalisation follows from it.

    • 1 mark for stating that pattern recognition identifies repeated features or similarities
    • 1 mark for stating that generalisation builds one solution for many cases
    • 1 mark for linking the two, with the pattern leading to the general solution
  5. 5.Explain[3 marks]

    Explain why a generalised solution is more useful than one written for a single case.

    Show mark schemeHide mark scheme

    Model answer

    A generalised solution uses parameters, so it works for many inputs. It avoids rewriting similar code for each case. One tested solution is easier to maintain and less likely to contain errors.

    • 1 mark for stating that it works for many inputs or cases
    • 1 mark for stating that similar code does not need to be rewritten
    • 1 mark for explaining that one tested solution is easier to maintain or has fewer errors

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy[1 mark]

What does decomposition mean?
Show answer and explanation

Answer: D · Worked explanation

Decomposition breaks a complex problem into smaller sub-problems that can be solved separately and then combined. Hiding irrelevant detail is abstraction, and reusing one method on similar tasks relies on pattern recognition and generalisation. Testing checks a finished program but does not split up the problem itself.
4.

Medium·Deduce[1 mark]

A bus app shows stops and connections but leaves out building shapes and street names. Deduce which technique this mainly shows.
Show answer and explanation

Answer: B · Worked explanation

The app keeps only the details needed to plan a journey and leaves out the rest, which is abstraction. Decomposition would split the app into separate parts, such as route search and ticket payment. Nothing in the description splits the problem or builds a solution for many cases, so those options do not fit.
5.

Medium·Deduce[1 mark]

A team builds a game. One member designs the graphics, one writes the scoring and one writes the controls. Deduce which technique the team is using.
Show answer and explanation

Answer: C · Worked explanation

The team has split one large problem into smaller parts that people can work on separately. That is decomposition. Abstraction would mean removing irrelevant detail from the game model. The team has not yet noticed repeated features or built a reusable solution, so pattern recognition and generalisation do not apply.
6.

Medium·Deduce[1 mark]

A programmer sees that finding the area of a square, a rectangle and a triangle all involve multiplying two lengths. Deduce which technique this shows.
Show answer and explanation

Answer: D · Worked explanation

The programmer has noticed a repeated feature across several problems, which is pattern recognition. Generalisation would be the next step, where one routine is written for all of them. The programmer has not yet removed detail or split a problem, so abstraction and decomposition are not the best description of what happened.
7.

Medium·Deduce[1 mark]

A programmer replaces three nearly identical blocks of code with one routine that takes the changing values as inputs. Deduce which technique has been applied.
Show answer and explanation

Answer: B · Worked explanation

One routine with parameters now works for all three cases, which is generalisation. Pattern recognition happened earlier, when the programmer saw that the blocks were alike. Decomposition would split a problem into different parts rather than merge similar ones, and abstraction would remove detail rather than combine solutions.
8.

Hard[1 mark]

A student says that abstraction means removing as much detail as possible. Which response is correct?
Show answer and explanation

Answer: D · Worked explanation

Abstraction removes only the detail that does not matter for the problem. Removing important detail would make the model useless for solving it. The idea that a simpler model is always better ignores this, and splitting a problem into parts is decomposition. Abstraction does not add detail.
9.

Hard[1 mark]

A tester finds that a program gives wrong results for negative inputs. Which action fits the stages of problem solving best?
Show answer and explanation

Answer: B · Worked explanation

Testing often sends a developer back to an earlier stage. The plan or program is refined, then tested again. Declaring it finished ignores the fault, and deleting failing tests hides it. The problem itself has not changed, so there is no need to start again with a different one.
10.

Hard[1 mark]

A timetable system ignores teachers’ hair colour, is split into rooms, classes and staff, and treats clash checking for rooms and staff alike. Which pairing is correct?
Show answer and explanation

Answer: A · Worked explanation

Hair colour is irrelevant detail, so leaving it out is abstraction. Splitting the system into rooms, classes and staff is decomposition. Seeing that rooms and staff need the same clash check is pattern recognition. The other pairings swap the techniques, for example calling the split abstraction or the clash check decomposition.

Keep going

Next topicB2.1 Programming fundamentalsPrevious topicA4.4 Ethical considerations

All IB Computer Science topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1Computational problems are solved in a series of steps
  2. 2Abstraction removes detail that the problem does not need
  3. 3Decomposition splits a large problem into smaller parts
  4. 4Pattern recognition finds similarities that can be reused
  5. 5Generalisation turns a pattern into a reusable solution
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe