- How to recognise when a problem can be solved using a computer.
- How to simplify problems using decomposition, divide and conquer, and abstraction.
- How methods such as backtracking, heuristics, data mining and visualisation help solve harder problems.
- How performance modelling and pipelining can improve or predict efficiency.
A real-world problem is often messy: it may involve people, rules, missing details, constraints and trade-offs. A computer cannot solve “messy” directly. You need to turn the situation into a clear computational problem.
Computational method
A computational method is a systematic technique that can be carried out by a computer, or supported by a computer, to solve a problem or produce a useful result.
The usual journey is: understand the real-world task, recognise the computational part, simplify it, choose a method, then test and improve the solution.

Core idea
Computational methods work best when you can represent the problem as data, rules, constraints and a clear goal.
A problem is more suitable for computational methods when:
- Inputs can be represented as data, such as numbers, text, records, images, graph nodes or sensor readings.
- Outputs are clear, such as a route, classification, timetable, prediction or decision.
- Rules and constraints are precise enough for a computer to test.
- The solution can be described as a finite sequence of steps, an algorithm.
- There is repetition, scale or complexity that makes automation useful.
- The time, memory and hardware requirements are feasible.
Some problems are still difficult even if they are computational. For example, finding the absolute best delivery route for many locations may be too slow using a brute-force search, so you may need heuristics or approximation.
Recognising a delivery-planning problem
A company wants to “make deliveries more efficient”.
- Identify the data: delivery addresses, van capacity, driver hours, road distances and delivery deadlines.
- Identify the output: an ordered list of stops for each van.
- Identify constraints: each parcel must be delivered once, no van can exceed its capacity, and drivers must finish within their working hours.
- Recognise the computational form: this is a route optimisation and scheduling problem, so it can be tackled using graph algorithms, heuristics and performance modelling.
Problem recognition means spotting the underlying computational problem inside a real-world description.
Common problem types include:
- Searching: finding an item, path or valid solution.
- Sorting: putting data into a required order.
- Optimisation: finding the best solution according to a measure, such as shortest time or lowest cost.
- Classification: assigning data to categories, such as spam or not spam.
- Simulation: modelling a system to predict behaviour.
- Pattern discovery: finding useful relationships in data.
A useful structure is IPO: input, process, output.
Decomposition means breaking a large problem into smaller subproblems. Each subproblem should be easier to understand, solve, test and maintain.
For example, a school timetable system could be decomposed into:
- store teachers, rooms, subjects and classes
- check room availability
- check teacher availability
- assign lessons to time slots
- detect clashes
- produce printable timetables
Each subproblem can then be designed as a separate module, function or procedure.
Decomposing a cinema booking system
- Separate the user-facing task from the data tasks: customers choose films and seats, while the system stores bookings and payments.
- Split validation from storage: one subproblem checks whether seats are available; another updates the booking database.
- Split output generation from processing: once the booking is valid, a separate subproblem creates the ticket or confirmation email.
Divide and conquer is a special form of decomposition. The problem is divided into smaller versions of the same problem, those smaller problems are solved, and the results are combined.
A recursive algorithm is an algorithm that calls itself. Many divide-and-conquer algorithms are recursive. A base case is the smallest case that can be solved directly, stopping the recursion.
Examples include:
- Binary search: repeatedly halve a sorted list.
- Merge sort: split a list, sort both halves, then merge them.
- Some graph and geometry algorithms.
Here is OCR-style pseudocode for recursive binary search on a sorted array:
function binarySearch(items, target, low, high)
if low > high then
return -1
endif
mid = (low + high) DIV 2
if items[mid] == target then
return mid
elseif items[mid] < target then
return binarySearch(items, target, mid + 1, high)
else
return binarySearch(items, target, low, mid - 1)
endif
endfunction
Binary search by divide and conquer
Search for 41 in the sorted array [3, 8, 14, 21, 27, 35, 41, 60].
- Use indexes 0 to 7. Compute
mid = (0 + 7) DIV 2 = 3. items[3] is 21, so discard indexes 0 to 3 because 41 must be to the right.
- Search indexes 4 to 7. Compute
mid = (4 + 7) DIV 2 = 5. items[5] is 35, so discard indexes 4 to 5.
- Search indexes 6 to 7. Compute
mid = (6 + 7) DIV 2 = 6. items[6] is 41, so return index 6.
Decomposition versus divide and conquer
Decomposition can split a problem into different kinds of subproblem. Divide and conquer splits a problem into smaller versions of the same kind of problem.
Abstraction means removing unnecessary detail so you can focus on the important features of a problem.
A model is a simplified representation of something real. Good abstraction keeps details that affect the answer and ignores details that do not.
Choosing useful details for a route planner
- Represent junctions as nodes and roads as edges, because the route depends on how places connect.
- Store travel time or distance as edge weights, because the aim may be fastest or shortest route.
- Ignore details such as shop signs, building colours and pavement texture, because they do not affect the route calculation.
- Keep one-way streets and closures, because they change which routes are valid.
Sanity check for abstraction
Ask: “If I remove this detail, could the answer change?” If yes, it probably matters. If no, it may be safe to ignore.
Backtracking is a search technique that builds a solution one choice at a time. If a partial solution cannot lead to a valid full solution, the algorithm undoes that choice and tries another.
It is useful for constraint problems such as mazes, Sudoku, N-Queens, graph colouring and timetable construction.

Solving a maze by backtracking
- Try the first available move from the start. If moving up reaches a dead end, undo that move and return to the previous decision point.
- Try the next available move. If moving right allows another move down, continue extending that partial path.
- Stop when the goal is reached. If every branch from a decision point fails, backtrack again.
Data mining means using computational techniques to discover patterns, relationships or unusual cases in large data sets.
It may involve:
- classification, such as predicting whether an email is spam
- clustering, such as grouping similar customers
- association, such as finding products often bought together
- anomaly detection, such as spotting suspicious transactions
Finding a product association
A supermarket analyses 1000 baskets. 200 contain pasta, and 120 contain both pasta and sauce.
- Calculate how common the combined pattern is: 120÷1000=0.12120 \div 1000 = 0.12120÷1000=0.12, so 12% of baskets contain both.
- Calculate how often sauce appears when pasta appears: 120÷200=0.60120 \div 200 = 0.60120÷200=0.60, so 60% of pasta baskets also contain sauce.
- Use the pattern carefully: the shop might place pasta and sauce near each other, but should still check whether the data is recent and representative.
A heuristic is a rule of thumb that gives a good-enough solution quickly, but does not guarantee the best possible solution.
Heuristics are useful when an exact algorithm would be too slow, especially for large optimisation or search problems.
Applying a nearest-neighbour heuristic
A van starts at A and must visit B, C and D. The nearest unvisited location is chosen each time.
- From A, the nearest unvisited location is C with distance 2, so choose A to C.
- From C, the nearest unvisited location is B with distance 1, so choose C to B.
- From B, the only unvisited location is D with distance 3, then return from D to A with distance 5.
- The route length is 2+1+3+5=112 + 1 + 3 + 5 = 112+1+3+5=11. This is quick to find, but it is not proof that 11 is optimal.
Performance modelling means predicting how a system or algorithm will behave before, or while, building it.
Models can use test measurements, equations, simulations or Big-O notation. Big-O describes how runtime or memory grows as input size increases:
- O(1)O(1)O(1) — constant
- O(logn)O(\log n)O(logn) — logarithmic
- O(n)O(n)O(n) — linear
- O(nk)O(n^k)O(nk) — polynomial
- O(2n)O(2^n)O(2n) — exponential
Estimating runtime from a model
An algorithm takes 0.20 seconds for 1000 records. Its model is quadratic, so runtime grows with n2n^2n2. Estimate the time for 5000 records.
- Compare input sizes: 5000 records is 5 times larger than 1000 records.
- Apply the quadratic model: the time scale factor is 52=255^2 = 2552=25.
- Multiply the measured time: 0.20×25=5.00.20 \times 25 = 5.00.20×25=5.0 seconds.
- Use the result to evaluate suitability: 5 seconds may be acceptable for a batch job, but poor for an interactive screen.
Models are simplifications
A performance model depends on its assumptions. Hardware, data distribution, network delays and implementation details can make real performance different.
Pipelining means splitting a process into stages so that different items can be processed by different stages at the same time.
A stage is one part of the process. Latency is the time for one item to pass through the whole pipeline. Throughput is the number of completed items per unit time. A bottleneck is the slowest stage that limits the whole pipeline.
In Component 01 you meet this with processor pipelines, such as overlapping fetch, decode and execute. The same idea applies more widely to data processing and manufacturing.

Comparing pipelined and non-pipelined processing
Four jobs each need three stages, and each stage takes one clock cycle.
- Without pipelining, each job takes three cycles, so the total is 4×3=124 \times 3 = 124×3=12 cycles.
- With pipelining, the first job finishes after three cycles, then one more job finishes each cycle. Total time is 3+3=63 + 3 = 63+3=6 cycles.
- The speed-up is 12÷6=212 \div 6 = 212÷6=2. It is faster, but not four times faster because the pipeline must fill and drain.
Visualisation means representing data or structure graphically so patterns are easier to see. Examples include graphs, charts, heat maps, network diagrams, Gantt charts and flowcharts.
Visualisation helps humans make decisions; it does not automatically prove that a solution is correct.
Using a visualisation to prioritise optimisation
A bar chart shows average response time: database 80 ms, API processing 30 ms, page rendering 10 ms.
- Compare the bars to find the bottleneck: the database stage contributes the largest delay.
- Estimate impact: halving rendering saves only 5 ms, but halving database time saves 40 ms.
- Choose the optimisation target: investigate database queries first, then re-measure to confirm the improvement.
In the exam
- For recognition questions, state the inputs, outputs, constraints and the underlying problem type.
- For method-choice questions, justify why the method fits: for example, backtracking for constraints, heuristics for quick approximate optimisation, or data mining for large data sets.
- For evaluation questions, mention trade-offs: accuracy versus speed, abstraction versus realism, and model prediction versus real measured performance.
Check yourself
- What features make a real-world task suitable for a computational solution?
- How is divide and conquer different from ordinary decomposition?
- Why might a heuristic be chosen even though it does not guarantee the optimal answer?