Construct a problem specification, describe decomposition, pattern recognition, abstraction and algorithmic design, explain how they solve real problems, and trace flowcharts with trace tables.
Each is in the Computer Science glossary, with every other term in the subject.
Focusing on the features of a problem that are essential for a given purpose and removing unnecessary detail, to produce a simpler model or overview of the problem.
A precise, finite sequence of well-defined instructions that solves a problem or performs a task.
The process of developing a step-by-step series of instructions that solves a problem, and refining it until it is correct and efficient.
The thought processes involved in formulating a problem and expressing its solution so that a computer, whether a human or a machine, can carry it out effectively.
A small circle containing a label (a letter or number) that joins two parts of a flowchart without drawing a flowline between them; the flow continues from one connector to the other connector with the same label.
A restriction that a solution must work within, such as a limit on time, budget, hardware, software, law or the skills of its users.
The diamond-shaped flowchart symbol for a condition that is either true or false, with a separate labelled flowline leaving for each answer.
Breaking a complex problem or system into smaller, more manageable sub-problems that can each be understood, solved and tested separately.
Construct a problem specification with a problem statement, constraints, objectives, input and output specifications and success criteria.
Describe the four fundamental concepts of computational thinking: decomposition, pattern recognition, abstraction and algorithmic design.
Describe the computational thinking process, from problem specification to testing and evaluation.
Explain how computational thinking is applied to problems in software development, data analysis, machine learning, database design and network security.
Explain why computational thinking does not depend on programming.
Identify the six standard flowchart symbols and state what each one represents.
Trace flowcharts that contain sequence, decisions, loops and connectors, recording every change to a variable in a trace table.
State the output of a flowchart for given input data.
Computational thinking is the set of problem-solving techniques that turns a vague real-world problem into precise steps that a person or a computer can carry out. It starts long before any code is written: someone has to decide what the problem actually is, split it into parts, spot what those parts have in common, strip away detail that does not matter and only then design the steps. Every later subtopic of the course, from programming in B2 to database design in A3 and machine learning in A4, applies these same techniques.
The cost of skipping them can be large. In 1999 NASA lost the Mars Climate Orbiter because one program produced numbers in one unit and another program read them in a different unit. Each program ran as written; the data passed between them did not follow the agreed specification, and nobody checked that it did.
206 exam-style questions on this subtopic, written in the style of the IB papers. The first has its markscheme open. Counted on
A college print room sends every print job to a single printer. Jobs wait in a queue and the printer always takes the job at the front. The queue starts empty, and then these operations happen in order:
enqueue(J1), enqueue(J2), enqueue(J3), dequeue(), enqueue(J4), dequeue(), enqueue(J5)
State the job that the printer will print next.
1 mark
J3;
State the contents of the queue after the operations, from front to rear.
2 marks
Award [1] for J3 at the front and [1] for J4, J5 following in that order.
J3 at the front;
then J4, then J5 at the rear;
Note: Accept a labelled diagram of the queue.
Outline one reason why a queue is a suitable structure for the print jobs.
2 marks
One of 55 short multiple-choice questions on B1.1. Pick an answer to see why it's right or wrong.
A restaurant booking system is being specified. Which input specification is precise enough to write validation from?
The official deck for this part of the syllabus.
Define computational thinking.
In the definition of computational thinking, what can the "computer" that carries out the solution be?
With a free account, Augment remembers where you stopped and what you have practiced.
A tree diagram that shows a problem at the top and, on each lower level, the sub-problems it is broken into.
A diagram that represents an algorithm using standard symbols for each kind of step, joined by arrows that show the order in which the steps are carried out.
An arrow in a flowchart that joins two symbols and shows which step is carried out next.
A description of the data a solution receives: what each item is, where it comes from, its data type, its format and its range of valid values.
The parallelogram-shaped flowchart symbol for data entering the algorithm (input) or results leaving it (output).
A specific outcome that a solution must achieve for the problem to count as solved.
A description of the information a solution produces: what each item is, its format and units, when it is produced and who receives it.
Identifying similarities or recurring elements within a problem, between problems, or in data, so that solutions can be reused, generalised or used to make predictions.
A structured description of a problem that sets out its scope, its limits and what a solution must achieve, so that goals can be agreed before design begins.
A short, precise description of the problem to be solved, saying who has the problem and what is wrong with the current situation.
The rectangular flowchart symbol for an operation that changes data, such as a calculation or an assignment of a value to a variable.
A measurable condition, written before the solution is built, that is used to judge whether the solution has met an objective.
The flowchart symbol, a rounded rectangle or oval, that marks where an algorithm starts or ends.
A table used when tracing an algorithm, with one column for each variable and one for output (often with extra columns for the conditions tested), in which every change of value is recorded in the order it happens.
Following an algorithm step by step by hand, with chosen input data, and recording the value of each variable and every output as the algorithm runs.
YouTubePeople often assume that computer science is the same as programming. Programming is one way of expressing a solution, but the harder work is deciding what the solution should do and how it should do it. That work is a way of thinking, and it can be done with a pencil, a whiteboard or a conversation.
The word "computer" in the definition matters. Before electronic machines existed, a "computer" was a person who carried out calculations by following written instructions. A recipe, a fire-evacuation plan and the instructions for assembling furniture are all solutions expressed so that someone else can carry them out without having to think of the method themselves. Computational thinking is the skill of producing such instructions for problems where no obvious method exists.
The term was first used by the mathematician and educator Seymour Papert in 1980. It reached a wide audience in 2006, when Jeannette Wing published an essay called "Computational Thinking" in Communications of the ACM, arguing that it is a basic skill for everyone, not only for computer scientists. Her everyday examples included a child packing a school backpack in the morning with the things needed for the day, which she called prefetching and caching (fetching data before it is needed and keeping it close at hand), and retracing one's steps to find lost mittens, which she called backtracking.
Computational thinking is usually described as a process with six stages. It begins with a clear statement of the problem and ends by checking the solution against that statement. The cycle of the process shows how the stages connect, and that the last stage feeds back into the first.

Stage | Question it answers | What it produces |
|---|---|---|
Problem specification | What exactly must be solved, within which limits, and how will success be judged? | A written specification with measurable success criteria |
Decomposition | Which smaller problems make up this problem? | A decomposition diagram or list of sub-problems |
Pattern recognition | What repeats, here or in problems already solved? | Reusable steps, known solution types, predictions |
Abstraction | Which details matter for this purpose, and which can be ignored? | A simplified model of the problem |
Algorithmic design | What exact steps solve each part? | An algorithm as numbered steps, a flowchart or code |
Testing and evaluation | Does the solution meet the success criteria? | Test results, a judgement, and changes to make |
In practice the stages overlap. While decomposing a problem a designer often spots a pattern; while designing an algorithm they may realise that the abstraction removed a detail that matters, and go back a step. The order in the table is the order in which each stage first becomes the main focus, not a rule that the stages happen once each.
Testing and evaluation close the loop. Testing runs the solution with chosen data (normal, boundary and erroneous data, all taught in subtopic B2.1, Programming fundamentals) and compares the results with what the specification says should happen. Evaluation weighs the whole solution against each success criterion and decides whether it is finished, needs adjusting, or shows that the original specification was wrong.
A problem described in everyday speech is almost always ambiguous. "The library needs a better way to deal with overdue books" could mean sending reminders, charging fines, blocking new loans, producing reports for the librarian, or all four. Two developers given that sentence would build two different systems, and neither might be what the librarian wanted.
A specification removes that ambiguity before design starts. It records what the solution must do, what it must not do, the limits it must work within and the test that will decide whether it worked. Errors found at this stage cost almost nothing to fix: changing a sentence is cheaper than rewriting a program that has already been built, tested and delivered.
A complete specification has six parts. Each answers a different question, and each can be checked separately.
A good problem statement is one or two sentences long and describes the problem, not a solution. "The school librarian has no quick way to find which books are overdue, so overdue books are chased late or not at all" is a problem statement. "Build an app with a red warning button" is a solution, and it closes off better options before they have been considered.
Constraints are usually fixed by the client, the organisation or the law, so the designer works within them instead of changing them. Common types are time (a deadline), cost (a budget), hardware (the computers or phones that will run the solution), software and platform (an existing operating system or database), legal and ethical rules (data protection, accessibility, copyright) and the users themselves (their age, language and technical skill). Some writers separate limitations (what the solution will deliberately not do, such as "the system will not handle payments") from constraints; both set the boundary of the problem. A constraint in a problem specification is a different idea from an integrity constraint in a database (subtopic A3.1, Database fundamentals).
Objectives say what the solution must do. They are written as actions ("The system must list every overdue book with the borrower's name and form") and are usually numbered so that each can be traced through design and testing. Broad aims such as "improve the library" are too vague to act on; they become useful only when broken into specific objectives.
An input specification is precise enough for a programmer to write validation from it. "Loan length: whole number of days, 1 to 28 inclusive, entered by the librarian" can be turned directly into a check; "the loan period" cannot. Each input should state its unit wherever a unit applies: a number without a unit can be read in more than one way.
Outputs include screens, printed reports, files, messages sent to other programs and signals sent to devices. When the output of one program is the input of another, the output specification of the first and the input specification of the second must match exactly; that shared agreement is often called an interface specification.
Success criteria are also called evaluation criteria, because they are what the final evaluation checks. Each objective should have at least one criterion, and each criterion should be testable by someone who has never met the client: they run the test, read the result and record pass or fail without needing anyone's opinion.
The six parts work together. The table applies each one to the overdue-books problem and shows a weak and a strong version side by side.
Part | Weak version | Strong version |
|---|---|---|
Problem statement | The library needs software. | The librarian cannot quickly see which books are overdue, so reminders are sent late or not at all. |
Constraint | It should be cheap. | Must run in a web browser on the school's existing laptops; no budget for new hardware; must store pupil data in line with the school's data-protection policy. |
Objective | Help with overdue books. | 1. List every overdue book with borrower name, form and days overdue. 2. Email each borrower a reminder at most once a week. |
Input specification | Book details. | Book ID: 8-digit string, scanned from barcode. Loan date: date in DD/MM/YYYY format, not in the future. |
Output specification | A report. | An on-screen table sorted by days overdue (largest first), and an email per borrower containing title, due date and return location. |
Success criterion | Easy to use. | A librarian with no training produces the overdue list in under 30 seconds; for a test set of 50 loans, the list matches a hand-checked list exactly. |
The parts of a specification are easy to blur. An input is data that enters the solution while it runs. A constraint is a condition on the whole project, fixed before any data exists. An objective is something the solution does. A useful test is to ask whether the item has a value that changes each time the solution is used: if it does, it is probably an input; if it is true for every run, it is probably a constraint.
Statement | Part | Reason |
|---|---|---|
"The user types the student's ID number." | Input specification | A value supplied each time the program runs |
"Users are teachers with little technical training." | Constraint | A fixed fact about the users that limits the design |
"Must be finished by 1 March." | Constraint | A limit on the project, not on the data |
"Produce a weekly attendance report." | Objective | Something the solution must do |
"The report lists each student's attendance as a percentage to one decimal place." | Output specification | The content and format of what is produced |
"The weekly report is correct for 100% of a 30-student test class." | Success criterion | A measurable test of the objective |
The Mars Climate Orbiter was a NASA probe launched on 11 December 1998 to study the Martian climate and to relay signals from a lander. On 23 September 1999, as it fired its engine to enter orbit, it passed behind Mars 49 seconds earlier than expected and was never heard from again. It had approached far too close to the planet and was destroyed or thrown back into space.
The cause was a mismatch at the boundary between two pieces of ground software. A program supplied by the spacecraft's builder, Lockheed Martin, calculated the impulse produced by each firing of the small thrusters and wrote the results to a file. A second program, run by NASA's navigation team, read that file to work out where the spacecraft was. The written interface specification between the two said the impulse must be given in newton-seconds (an SI unit). The first program produced it in pound-force seconds, a US customary unit, so every value was too small by a factor of about 4.45.
Item | Value |
|---|---|
Unit the interface specification required | newton-seconds (N·s) |
Unit the thruster program actually produced | pound-force seconds (lbf·s) |
Conversion | 1 lbf·s ≈ 4.45 N·s |
Planned closest approach to Mars | 226 km |
Lowest altitude the probe was thought able to survive | 80 km |
Closest approach calculated after the failure | 57 km |
Project cost, orbiter and lander (development, launch, operations) | US$327.6 million |
Source: NASA Mars Climate Orbiter Mishap Investigation Board, Phase I report, 10 November 1999; mission figures from NASA.
The small errors added up over the nine-month flight. Each thruster firing nudged the real path a little more than the navigation software believed, so the predicted position drifted away from the true one. Navigators noticed that the measured and predicted positions disagreed, but the concerns were not followed up through the formal process, and a planned final correction burn was not carried out.
The fault lay at the interface between two programs, not in the logic of either one. A correct interface specification existed and named the unit, but nothing checked that the output of one program actually met the input specification of the other. Three computational thinking lessons follow from the loss.
Outputs and inputs must state units. An output specification such as "impulse, in N·s, to two decimal places" leaves no room for a different reading.
Interfaces between sub-problems need testing. Decomposition split the navigation problem into separately built parts. Each part worked alone, and the link between them was not checked with real data before the navigators relied on it.
Success criteria must be checked against real data. A criterion such as "predicted and measured positions agree to within a set distance", checked after every firing, would have recorded the drift as a failed test that had to be resolved before the next manoeuvre.
Four concepts do most of the work between specifying a problem and testing its solution. Each is a different kind of mental move, and solving a real problem uses all four, often several times over.
Concept | What it does | Typical question | Typical product |
|---|---|---|---|
Decomposition | Breaks a problem into smaller parts | "What are the parts of this problem?" | A decomposition diagram, a list of sub-tasks, a set of subprograms |
Pattern recognition | Finds similarities within a problem or with other problems | "Where have I seen this before? What repeats?" | A loop, a reusable subprogram, a known algorithm, a prediction |
Abstraction | Removes detail that does not matter for the purpose | "What do I need to keep, and what can I ignore?" | A model: a graph, a table design, a set of variables |
Algorithmic design | Creates exact steps to solve the problem | "What steps, in what order, solve it every time?" | Numbered steps, a flowchart, code |
Large problems are hard to solve because too much has to be held in mind at once. Breaking them into parts reduces each part to something one person can understand, design and test in a reasonable time.
Decomposition is applied repeatedly. The whole problem is split into a few large parts; each part that is still too complex is split again, and so on, until every remaining sub-problem is small enough to solve directly. This approach is called top-down design, because it starts with the whole problem at the top and works down to the details.
The decomposition diagram for a school cafeteria pre-order app shows the whole system at the top, four main sub-problems on the second level, and the tasks that make up each sub-problem below them.

The diagram shows structure, not order. "Take orders" appears beside "Show the menu", but nothing in the diagram says which happens first; a flowchart is needed to show the order of steps. The bottom-level boxes are typical of a good decomposition: each has a single clear job, and each could be given to a different member of a team.
Decomposition brings several benefits.
Manageability: each sub-problem is small enough to understand completely.
Teamwork: different people can work on different parts at the same time.
Testing: each part can be tested on its own before the parts are joined, so faults are easier to locate.
Reuse: a part such as "Log in" may already exist in another system, or be reused in the next one.
Maintenance: a change to one part (for example, a new allergen rule) affects only that part.
It also has costs. Every split creates an interface, a point where one part passes data to another, and each interface must be specified and tested, as the Mars Climate Orbiter showed. Splitting too far produces dozens of tiny parts whose connections are harder to follow than the original problem. Some problems also resist clean decomposition, because their parts depend heavily on each other: the "Check balance" task, for instance, needs data from "Top up balance" in a different branch.
In code, each bottom-level task usually becomes a subprogram (a function in Python, a method in Java). A program built this way is easier to read and to change, an idea developed as modularisation in subtopic B2.3, Programming constructs.
Once a problem has been broken into parts, many of the parts turn out to resemble each other, or to resemble problems that have been solved before. Recognising those similarities saves designing the same thing twice and allows a proven method to be reused.
Patterns appear in three places.
Within one problem. The quiz app asks ten questions the same way, so one set of steps can be repeated ten times. Repetition inside a problem becomes iteration (a loop) in an algorithm, and a task that appears in several places becomes a subprogram called from each place.
Between problems. "Find a book by its ID", "find a student by name" and "find whether a password is on a list of banned passwords" are all the same problem: search a collection for a value. Once the pattern is recognised, an existing method such as linear search (subtopic B2.4, Programming algorithms) can be reused instead of designing a new one for each case.
In data. Trends, cycles and unusual values in data are also patterns. A shop that sees sales rise every Friday can predict next Friday's demand; a bank that sees a card used in two countries an hour apart can flag possible fraud.
Pattern recognition is what turns specific examples into a general method. By working through several small cases, writing down what happens and looking for what stays the same, a designer can produce a rule that works for any case, including ones too large to try by hand.
Every real situation contains far more detail than any solution can use. Abstraction is the decision about which details to keep. What counts as "essential" depends entirely on the purpose: the same city looks very different on a map for drivers, a map for cyclists and a map for the water company.
Abstraction produces a model: a simplified representation that keeps only what the solution needs. A school database does not store a student's height, favourite song or the colour of their bag, because none of those help it record attendance and grades. A computer game models a ball's position and speed but not the stitching on its surface. Choosing variables for a program is a small act of abstraction: each variable is a detail judged worth keeping.
Abstraction also works in levels. A driver uses the steering wheel, pedals and indicators without knowing how the engine works; a mechanic works one level down. Computing is built from such levels: a Python programmer writes print("Hello") without handling the machine code it becomes, and the operating system hides the details of each disk drive behind the idea of a "file". Each level hides the complexity of the one below, so that people can work on one level at a time.
Level | What a person at this level works with | What is hidden |
|---|---|---|
Application user | Buttons, menus and documents | How the program stores and processes data |
Programmer | Variables, loops and subprograms in Python or Java | The machine code the program is translated into |
Operating system | Files, folders and processes | How each disk drive and memory chip works |
Hardware designer | Logic gates and circuits | The physics of the transistors |
Generalising is a form of abstraction too. The tournament rule "matches = " ignored the names of the players, the scores and the order of the matches, and replaced the specific numbers 2, 4 and 8 with the general .
One of the most widely cited examples of abstraction is the London Underground diagram. Earlier maps of the network drew the lines on top of a street map, so stations in the centre were crammed together and those in the suburbs were spread far apart. Harry Beck, an engineering draughtsman used to drawing electrical circuit diagrams, realised that passengers below ground were not concerned with geography. They wanted to know which line to take and where to change trains.

Beck drew the diagram in 1931 using only straight lines at horizontal, vertical and 45° angles, with stations spaced roughly evenly. London Underground's publicity department first rejected it as too radical, but after a trial print of 500 copies in 1932 it was issued to the public in January 1933 with 700,000 copies, and a large reprint was needed within a month. Every London Underground map since has kept Beck's approach.
The diagram shows both the strength and the limit of abstraction. For planning a journey by train it is better than an accurate map, because it removes everything that does not help with that task. For walking it is misleading, because the true distances it removed are exactly what a walker needs: some stations that look far apart on the diagram are a few minutes' walk from each other at street level.
Route-finding software applies the same idea to roads. A road map contains bends, rivers, forests, buildings and road names. To find the shortest route between towns, almost all of that can go: what matters is which towns are joined directly and how long each road is. The road map and its abstraction show the towns becoming dots (nodes), the roads becoming straight lines (edges), and each road's length becoming a number on its line.

Edsger Dijkstra designed his shortest-path algorithm in 1956, by his own account in about twenty minutes while sitting at a café in Amsterdam, and published it in 1959. To demonstrate it on the ARMAC computer at the Mathematical Centre in Amsterdam, he used a simplified transport map of 64 Dutch cities, a number chosen so that each city could be stored as a 6-bit code (). Reducing the country to cities, the roads between them and their lengths made the problem small enough for the machine, and the search steps were then designed to work on that model.
Decomposition, pattern recognition and abstraction prepare a problem for the final step: designing the exact instructions that solve it.
To count as an algorithm, a set of instructions needs five properties.
Precise: every step has one meaning. "Add a bit of salt" is not precise; "add 5 g of salt" is.
Finite: it always stops after a finite number of steps, including when the input is unusual.
Defined inputs: it states what data it starts with (possibly none).
Defined outputs: it produces at least one result.
Effective: each step can actually be carried out, by hand or by machine, with the resources available.
An algorithm can be written in several forms: numbered steps in plain language, a flowchart, or code in a programming language. The method stays the same whichever form is used to write it down, so the same algorithm for finding the largest number in a list can appear as five numbered steps, as a flowchart and as a Python function.
Algorithmic design has four steps, much like the scientific method of observing, hypothesising and testing.
Explore the problem with different values. Work through small examples by hand, changing the inputs, to see how the problem behaves.
Record the steps. Write down exactly what was done for each example. This is a first, specific draft of the algorithm.
Recognise patterns and generalise. Find the steps that recur across the examples and rewrite them for any input, not just the ones tried.
Test and validate. Run the general algorithm on many inputs, including unusual ones, and refine it. Testing can show that an algorithm fails, but passing a set of tests never proves it works for every possible input; a logical argument (like the "every match eliminates one player" reason in the tournament rule) is what gives confidence in the general case.
Refinement also considers efficiency: how much time (number of steps) and space (memory) the algorithm needs. Different algorithms can solve the same problem at very different costs. Adding the whole numbers from 1 to can be done with a loop that performs additions, or with the formula , which takes the same three operations however large is.
def sum_by_loop(n):
total = 0
for k in range(1, n + 1):
total = total + k
return total
def sum_by_formula(n):
return n * (n + 1) // 2
for n in [10, 100, 1000000]:
print(n, sum_by_loop(n), sum_by_formula(n))public class SumTwoWays {
static long sumByLoop(int n) {
long total = 0;
for (int k = 1; k <= n; k++) {
total = total + k;
}
return total;
}
static long sumByFormula(int n) {
return (long) n * (n + 1) / 2;
}
public static void main(String[] args) {
int[] tests = {10, 100, 1000000};
for (int n : tests) {
System.out.println(n + " " + sumByLoop(n) + " " + sumByFormula(n));
}
}
}Both versions print the same results, but for the loop performs a million additions while the formula performs one multiplication, one addition and one division.
10 55 55
100 5050 5050
1000000 500000500000 500000500000The Java version stores the result in a long, because 500,000,500,000 is larger than the biggest value a Java int can hold (2,147,483,647); Python's integers grow as needed, so the Python version needs no such choice. Comparing algorithms by how their number of steps grows with the input is formalised as Big O notation in subtopic B2.4, Programming algorithms.
YouTubeComputational thinking is a toolkit for solving problems, and many of its uses involve no programming at all. A school building its end-of-term test timetable decomposes it into rooms, times and subjects, abstracts each student to the list of tests they sit, recognises the pattern "two tests for the same student cannot overlap", and designs a procedure for placing tests one by one. A hospital planning its emergency department does the same with patients, beds and staff. The result may be a spreadsheet, a set of rules on paper or a program, and the same four concepts produce each of them.
The value of the concepts lies in what each one does to the problem. Decomposition makes a large problem manageable. Pattern recognition saves effort and allows prediction. Abstraction makes a problem simple enough to reason about. Algorithmic design makes the solution exact and repeatable, so that it gives the same answer whoever, or whatever, carries it out.
The table applies all four concepts to five areas of computer science.
Area | Decomposition | Pattern recognition | Abstraction | Algorithmic design |
|---|---|---|---|---|
Software development | Split a system into modules and subprograms | Reuse existing solutions for recurring tasks (searching, logging in) | Model only the data the users need | Write the steps of each subprogram |
Data analysis | Split a question into collection, cleaning, analysis and presentation | Find trends, cycles and outliers in the data | Keep only the relevant columns and records; summarise with averages | Define exact steps for cleaning and calculating results |
Machine learning | Split the task into data preparation, training and evaluation | Learning patterns in data is the goal of training | Represent each example by a few measurable features | Choose and run a training algorithm |
Database design | Split data into separate entities (tables) | Spot repeated data that should be stored once | Keep only the attributes the system needs | Write the queries that extract and update data |
Network security | Split a network into zones with different trust levels | Match traffic against known attack signatures; flag unusual behaviour | Describe traffic by key fields (address, port, protocol) | Define the rules a firewall applies to each packet |
Software development is where decomposition is most visible. A large system is split into separate modules, each module into subprograms, and each subprogram is designed, written and tested on its own. Pattern recognition means a developer who needs to sort a list or check a password does not invent a new method but reuses a well-tested one, often from a library. Abstraction decides which data the program stores and hides the internal details of each module behind a simple set of operations, so other parts can use it without knowing how it works. Algorithmic design then produces the steps for each subprogram, and testing against the success criteria decides when the software is ready.
A data analyst answering a question such as "which bus routes are most often late?" decomposes the job into collecting data, cleaning it, analysing it and presenting results. Abstraction keeps only the fields that bear on the question (route number, scheduled and actual arrival times) and ignores the rest (driver name, bus colour). Pattern recognition is the analysis itself: finding that one route is late every weekday morning, or that delays rise when it rains. Algorithmic design makes the analysis repeatable: the same cleaning and calculation steps can be run every month on new data and give comparable results.
In machine learning (subtopic A4.1, Machine learning fundamentals), pattern recognition is the purpose of the whole system: a model is trained to find patterns in training data that let it make predictions about new data. Abstraction appears as the choice of features, the measurable properties that represent each example. A system that predicts house prices might use floor area, number of rooms and location, and ignore wallpaper and the owner's name. Decomposition splits the project into collecting data, preparing it, training, and evaluating the model on data it has not seen, and the training procedure itself is an algorithm.
Kept as a feature | Left out | Reason |
|---|---|---|
Floor area (m²) | Wallpaper pattern | Area affects price in a measurable way; wallpaper is easily changed |
Number of bedrooms | Owner's name | Bedrooms change what buyers pay; the owner does not |
Distance to the nearest station (km) | Colour of the front door | Location is a strong predictor of price |
Designing a relational database (subtopic A3.2, Database design) starts with decomposition: the data for a school is split into separate entities such as students, classes and teachers, each stored in its own table. Abstraction chooses the attributes worth storing for each entity. Pattern recognition finds data that is repeated, for example a teacher's email address typed into every lesson record, and the process of normalisation removes that repetition by storing each fact once. Algorithmic design produces the queries that join the tables back together to answer questions.
Security teams decompose a network into zones (the public web server, staff computers, the finance system) and set different rules for each, so that a break-in to one zone does not expose the others. A firewall (subtopic A2.4, Network security) applies an algorithm to each packet: compare its source, destination, port and protocol with an ordered list of rules and allow or block it. Those four fields are an abstraction of the packet, chosen because they are enough to make the decision. Pattern recognition detects attacks, either by matching traffic against the known "signatures" of earlier attacks or by noticing traffic that differs from the network's normal pattern, such as one computer suddenly contacting thousands of addresses.
Numbered steps are easy to write but hard to follow when an algorithm branches or repeats. A flowchart draws the algorithm as a diagram, so the paths it can take are visible at a glance.
Six standard symbols cover every flowchart. The chart of symbols shows each shape with its name, a typical label and its purpose.

Every flowchart has exactly one Start terminator, with one flowline leaving it. Most flowcharts also have a single End; where an algorithm can finish in more than one way, the paths are usually joined into one End to keep the chart tidy.
A process box holds one action or a short group of actions done in sequence, such as total = total + value or i = i + 1. The = sign in a flowchart process means "becomes": the right-hand side is worked out first, then stored in the variable on the left.
Inputs come from a user, a file or a sensor; outputs go to a screen, a printer, a file or another program. The text in the shape says which: "Input n" or "Output total". Using a rectangle for an input, or a parallelogram for a calculation, gives the wrong meaning to the step.
The question in a decision is a condition that is either true or false, such as count < n ?. One exit is labelled Yes (or True) and the other No (or False), and every decision must have both labels. Decisions are how a flowchart shows both selection (choosing between two paths) and loops.
Flowlines normally run from top to bottom and left to right, but a flowline can point in any direction; the arrowhead, not the position, decides the order. A flowline that leads back up to an earlier symbol creates a loop.
Connectors keep large charts readable. Instead of a long flowline crossing other lines, the flow leaves at a connector marked "A" and resumes at the other connector marked "A". The same idea is used to continue a chart on another page.
Every algorithm is built from three structures, each with a recognisable shape in a flowchart.
Sequence: symbols joined one after another by flowlines, carried out in order. Starting, inputting n and setting total = 0 is a sequence.
Selection: a decision whose two exits lead to different symbols and then rejoin. The flow takes one path or the other, never both, on each pass.
Iteration: a decision with one exit that leads to a set of steps and then back, by a flowline or a connector, to the decision. The steps repeat until the condition sends the flow out along the other exit.
A loop in a flowchart is therefore a decision plus a flowline that points backwards. If the steps inside the loop never change anything the decision tests, the condition never changes and the loop never ends, which breaks the "finite" property of an algorithm.
The structure of a flowchart can be seen at a glance, but its output for particular data is found only by tracing it. Tracing means acting as the computer: start at Start, follow each flowline, carry out each step exactly as written and keep a record.
The record is kept in a table with a column for every variable, and the table makes errors easy to spot because every change is visible.
The standard conventions for a trace table are:
One column for each variable, in the order the variables first appear.
Optional columns for each decision's condition (recording Yes or No, or True or False) and one column for output.
A new row each time a value changes or a decision is tested, working strictly in the order the flowchart is followed.
Blank cells mean "unchanged"; the current value of a variable is the last value written in its column.
Output is copied exactly as the flowchart would produce it, and only when an output symbol is reached.
The flowchart for adding up numbers inputs , sets two variables to 0, and then repeats an input-and-add step while the counter is less than . The loop is formed by the decision count < n ? and the flowline that returns to it from the bottom of the loop.

A trace with and the values 5, 2, 8 and 3 records each step in order. The condition column shows the comparison actually made, so the exit from the loop can be checked.
Step |
|
|
|
|
| Output |
|---|---|---|---|---|---|---|
1 | 4 | |||||
2 | 0 | 0 | ||||
3 | 0 < 4: Yes | |||||
4 | 5 | |||||
5 | 5 | 1 | ||||
6 | 1 < 4: Yes | |||||
7 | 2 | |||||
8 | 7 | 2 | ||||
9 | 2 < 4: Yes | |||||
10 | 8 | |||||
11 | 15 | 3 | ||||
12 | 3 < 4: Yes | |||||
13 | 3 | |||||
14 | 18 | 4 | ||||
15 | 4 < 4: No | |||||
16 | 18 |
The loop body ran four times, once for each value, and the decision was tested five times: four Yes answers and the final No that ends the loop. A loop that runs times always tests its condition times.
Each symbol of the flowchart maps onto a line of code. The decision and its backward flowline become a while loop, the process boxes become assignments, and the parallelograms become input and output statements.
n = int(input("How many values? "))
total = 0
count = 0
while count < n:
value = int(input("Value: "))
total = total + value
count = count + 1
print("Total:", total)import java.util.Scanner;
public class SumInputs {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("How many values? ");
int n = in.nextInt();
int total = 0;
int count = 0;
while (count < n) {
System.out.print("Value: ");
int value = in.nextInt();
total = total + value;
count = count + 1;
}
System.out.println("Total: " + total);
}
}Run with the same inputs, both programs produce the result the trace predicted.
How many values? 4
Value: 5
Value: 2
Value: 8
Value: 3
Total: 18Finding the largest value combines a loop with a decision inside it. The flowchart sets largest to the first item, then compares every other item with it, replacing largest whenever a bigger item is found. Items are numbered from 0, so items[0] is the first item and items[i] is the item at position i.
![Flowchart: Start; Input items, n; largest = items[0], i = 1; decision i < n ?; No: Output largest, End. Yes: decision items[i] > largest ?; Yes: largest = items[i], then i = i + 1; No: straight to i = i + 1; then a flowline back to the first decision.](/_next/image?url=https%3A%2F%2Fmedia.augment-education.com%2Fnotes%2F2026%2F10%2Fc2ab4064-83e5-41aa-ac87-adc66d87b8e7.webp&w=3840&q=75)
Starting largest at the first item, not at 0, is a deliberate design choice. If every item in the list were negative, such as [−3, −8, −1], a starting value of 0 would never be replaced, and the flowchart would output 0, a value that is not even in the list.
A linear search checks the items of a list one at a time until it finds the target or runs out of items. Its flowchart has two exits from the loop: one when the target is found and one when every item has been checked. Instead of a long flowline from i = i + 1 back to the loop's decision, the flowchart uses a pair of connectors labelled A.
![Flowchart: Start; Input items, n, target; i = 0; connector A feeds decision i < n ?; No leads to Output Not found; Yes leads to decision items[i] = target ?; Yes leads to Output Found at, i; No leads to i = i + 1 then connector A. Both outputs join at End.](/_next/image?url=https%3A%2F%2Fmedia.augment-education.com%2Fnotes%2F2026%2F10%2F3e0c2f09-313f-454c-afc6-50d30015e5a0.webp&w=3840&q=75)
The two decisions do different jobs. i < n ? guards the loop, making sure the search never looks past the last item; items[i] = target ? is the actual comparison. The order matters: testing items[i] when i equals n would look for an item that does not exist, which in a program causes an index error.
def linear_search(items, target):
i = 0
while i < len(items):
if items[i] == target:
return i
i = i + 1
return -1
marks = [12, 7, 31, 7, 18]
print(linear_search(marks, 31))
print(linear_search(marks, 7))
print(linear_search(marks, 5))public class LinearSearch {
static int linearSearch(int[] items, int target) {
int i = 0;
while (i < items.length) {
if (items[i] == target) {
return i;
}
i = i + 1;
}
return -1;
}
public static void main(String[] args) {
int[] marks = {12, 7, 31, 7, 18};
System.out.println(linearSearch(marks, 31));
System.out.println(linearSearch(marks, 7));
System.out.println(linearSearch(marks, 5));
}
}The function returns the position instead of printing a message, and uses −1 to mean "not found". It finds 31 at position 2 and the first 7 at position 1, and reports −1 for 5.
2
1
-1The final flowchart applies a rule to a whole number until it reaches 1: if is even it is halved, and if it is odd it becomes . It counts the steps taken. A decision inside the loop chooses between the two rules, and both paths rejoin before steps is increased.

Computational thinking is examined on Paper 2, most often in the compulsory question on algorithmic thinking that needs no code to be read or written. That question typically gives a real-world problem and asks you to specify it, apply the concepts of computational thinking to it, and follow or describe an algorithm, often presented as a flowchart.
The command terms set the depth.
Construct (AO3) a problem specification: each heading must be filled with detail specific to the scenario; typically 4–6 marks.
Describe (AO2) a concept of computational thinking: a precise meaning plus an example; typically 2 marks.
Explain (AO3) how a concept helps solve a given problem: the concept, how it is applied in the scenario, and its effect; typically 2–4 marks.
Identify (AO2) a flowchart symbol or a part of an algorithm: a single correct choice; 1 mark.
Trace (AO2) a flowchart: a trace table or written record of every variable and output, in order; typically 3–6 marks.

In the trace, the boundary value 14.0 is the step most likely to go wrong. The condition is "less than", so a time equal to the limit does not qualify; read the comparison sign in every decision before tracing, and record the comparison itself (14.0 < 14.0: No) so the reasoning is visible.
When a question asks you to describe a concept, give its meaning and an example; when it asks you to explain how a concept helps, add the effect on the problem, linked by "so" or "because". A definition alone answers neither fully.
State the name and shape of the flowchart symbol used to test a condition. [2]
Distinguish between decomposition and abstraction. [2]
Outline what is meant by pattern recognition, with an example from data analysis. [2]
A specification contains the success criterion "The app should be fast and easy to use." Identify why it is a weak criterion and rewrite it as two measurable criteria. [3]
A school wants an online system for booking parent–teacher meetings. Construct a problem specification for the system, with at least one point under each of the six headings. [6]
Trace the flowchart for the largest value with items = [−3, −8, −1, −5] and n = 4, and state the output. Then explain why setting largest to 0 at the start, instead of items[0], would give the wrong output for this list. [5]
Trace the flowchart that halves when it is even and replaces it with when it is odd, for the input , and state the output. [3]
A knockout chess tournament has 64 players. State the number of matches needed and explain your answer using pattern recognition. [3]
Explain how computational thinking could be applied to protecting a school network from attack. [4]
Explain why computational thinking does not necessarily involve programming, with an example. [2]
Decision [1]; a diamond with two labelled exits (Yes/No) [1].
Decomposition breaks a problem into smaller sub-problems and keeps all of its detail [1], whereas abstraction removes detail that does not matter for the purpose and keeps only what is essential [1].
Identifying similarities or recurring elements within a problem, between problems or in data [1]; for example, finding that sales rise every Friday, or that one bus route is late every weekday morning, and using it to predict [1].
It cannot be measured or tested: "fast" and "easy" have no quantity or condition [1]. Examples: "Search results appear within 2 seconds for 10,000 records" [1]; "A first-time user completes a booking in under 60 seconds without help" [1].
One mark per heading with scenario-specific detail, for example: problem statement (parents phone the office to book, causing clashes and long queues); constraint (must run in a web browser; teachers' availability is set by the school timetable; parents' contact details are personal data); objective (parents choose a free 5-minute slot with each of their child's teachers); input (parent login email; teacher selected from a list; slot time from those available); output (a confirmation email and an on-screen schedule for each teacher, ordered by time); success criterion (no two bookings for the same teacher and slot in a test with 300 bookings; a parent completes three bookings in under 3 minutes).
Trace: largest = −3, i = 1; −8 > −3 No; i = 2: −1 > −3 Yes, largest = −1; i = 3: −5 > −1 No; i = 4: 4 < 4 No; output −1 [3]. With largest = 0, no item is greater than 0, so largest is never replaced [1] and the output is 0, which is not in the list [1].
: 5, 16, 8, 4, 2, 1 with steps 0, 1, 2, 3, 4, 5 [2]; output 5 [1].
63 [1]. Working through small cases (2 players need 1 match, 4 need 3, 8 need 7) shows that matches = players − 1 [1]; this always holds because each match eliminates exactly one player and 63 players must be eliminated to leave one winner [1].
Any two concepts applied, [2] each (concept and effect): decomposition, splitting the network into zones (student devices, staff, servers) with different rules, so an attack on one zone does not reach the others; pattern recognition, matching traffic against signatures of known attacks or flagging unusual behaviour, so attacks are detected early; abstraction, describing each packet by its address, port and protocol only, so firewall rules stay simple; algorithmic design, an ordered list of firewall rules applied to every packet, so decisions are consistent.
Computational thinking is a set of problem-solving techniques (decomposition, pattern recognition, abstraction, algorithmic design) that can be carried out by people [1]; for example, a school decomposes its test timetable into rooms, times and subjects and designs rules for placing tests, with no code written [1].
Computational thinking is a toolkit for formulating problems and expressing solutions so that a human or a machine can carry them out; it does not require programming.
The process runs from problem specification, through decomposition, pattern recognition, abstraction and algorithmic design, to testing and evaluation, and repeats until the goals are met.
A problem specification has a problem statement, constraints, objectives, input and output specifications and success criteria; criteria must be measurable, and inputs and outputs need types, formats, ranges and units.
Decomposition breaks a problem into smaller parts (shown in a decomposition diagram); pattern recognition finds what repeats within or between problems or in data; abstraction removes detail that does not matter for the purpose; algorithmic design creates exact, finite steps.
An algorithm is precise, finite, has defined inputs and outputs, and is effective; different algorithms for the same problem can differ greatly in efficiency.
In software development, data analysis, machine learning, database design and network security, each concept is useful because of its effect: smaller problems, reused solutions, simpler models and exact, repeatable steps.
Flowcharts use six symbols: terminator, process, input/output, decision, flowline and connector; a loop is a decision plus a flowline (or connector pair) leading back to it.
Tracing records every variable change, every decision and every output in a trace table, in the order the flowchart is followed.
I can write a one- or two-sentence problem statement that describes a problem, not a solution.
I can sort statements into inputs, constraints, objectives, outputs and success criteria, and justify each choice.
I can turn a vague requirement into a measurable success criterion.
I can explain how the Mars Climate Orbiter was lost through a mismatch between an output and an input specification.
I can draw a decomposition diagram with at least three levels for a familiar system.
I can describe decomposition, pattern recognition, abstraction and algorithmic design, each with an example.
I can explain the difference between abstraction and decomposition, and between abstraction in computational thinking, OOP and ADTs.
I can find a general rule from small cases and explain why it always holds.
I can state the five properties of an algorithm and write an algorithm as precise numbered steps.
I can explain how each concept of computational thinking is applied in software development, data analysis, machine learning, database design and network security.
I can name and draw the six standard flowchart symbols and say what each represents.
I can find the loops and selections in a flowchart, including loops joined by connectors.
I can trace a flowchart with nested decisions in a trace table and state its output.
I can predict how changing a condition (such as < to ≤) changes a flowchart's output.
Award [1] for the reason and [1] for the expansion.
a queue is first in, first out / FIFO;
so jobs are printed in the order they were sent / no job is overtaken;
new jobs are added only at the rear;
so it is fair to the people who sent their jobs earlier;
the printer only ever needs the job at the front;
so dequeue gives it the next job directly without searching;
A drawing app records each action a user takes on a stack so that it can be undone. Pressing Undo pops the most recent action from the stack and reverses it. The stack starts empty.
A user carries out these actions in order:
draws a circle
fills it blue
adds a text box
presses Undo
draws a line
presses Undo
presses Undo
State the action at the top of the stack after step 3.
1 mark
State the contents of the stack after step 7, and which actions are still shown in the drawing.
2 marks
Explain why a stack, rather than a queue, is used to store the actions for undo.
3 marks
A railway depot keeps the carriages of a train in a queue on the main track. A short dead-end siding behaves like a stack: a carriage can only enter or leave the siding at one end. The depot can dequeue a carriage from the front of the main track, push it into the siding, pop the carriage nearest the siding entrance, and enqueue a carriage at the rear of the main track.
The main track currently holds five carriages:
Front | Rear | |||
|---|---|---|---|---|
C1 | C2 | C3 | C4 | C5 |
State the operation that removes C1 from the main track.
1 mark
Describe, in steps, how the depot can use the siding to reverse the order of all the carriages on the main track. Your steps must work for any number of carriages.
4 marks
State the contents of the siding when all five carriages are in it, and the order of the main track at the end of your steps in part (b).
2 marks
The depot now needs to reverse only the first three carriages and leave the rest in their original order behind them. Starting again from the queue C1, C2, C3, C4, C5, the required result is C3, C2, C1, C4, C5 (front to rear).
Describe, in steps, how this can be done using only the queue and stack operations. Your steps should work for any number of carriages n and any number k to be reversed, where k ≤ n.
5 marks
Outline how the number of operations needed in part (d) grows as the number of carriages increases.
2 marks
8 |
Each row shows the values at the moment the outer decision is tested. For example, on the second row is odd, so the next value is .
Output: 8.
(b) With the first test n ≠ 1 ? is No, so the loop body never runs and the output is 0.
(c) For every whole number of 1 or more, n ≠ 1 and n > 1 give the same answer: both are false only when . Halving an even number of 2 or more, or applying , never produces 0 or a negative number, so the two conditions agree on every pass and the output does not change. (They would differ for an input of 0, which loops for ever with n ≠ 1 because 0 halves to 0.)