GCSE Computer Science · Computational thinking, algorithms and programming

Computational thinking and designing algorithms

Abstraction and decomposition, flowcharts and pseudocode, trace tables, finding errors in an algorithm and comparing two that do the same job.

151 GCSE-style practice questions

Watch the lesson

Every point below, worked through in one video, and each point links straight to its own part.

10 minutes. Plays from YouTube.

More lessons like this one on our YouTube channel

Learn

Computational thinking and designing algorithms, explained point by point

Everything the GCSE specification expects you to be able to do, and how to actually do it - the same lesson a signed-in student studies from.

  1. Explain and use abstraction, decomposition and algorithmic thinking

    Abstraction means removing the detail that does not matter so that you can concentrate on what does: a map of a rail network shows the stations and the order they come in, not the bends in the track. Decomposition means breaking a big problem into smaller ones that can each be solved on their own. Algorithmic thinking means working out the exact steps, in order, that solve a problem. An algorithm is that set of steps. In an answer, apply the idea to the problem in the question, and do not stop at the definition.

  2. Identify the inputs, processes and outputs of a problem, and use structure diagrams

    Before writing any code, list what goes in, what is done to it and what comes out. For a program that works out an average mark, the inputs are the marks, the process is adding them and dividing by how many there are, and the output is the average. OCR also asks for structure diagrams, which show decomposition as a picture: the whole problem in a box at the top, with the smaller tasks it breaks into on the levels below.

  3. Read and draw flowcharts

    A flowchart shows an algorithm as shapes joined by arrows. A box with rounded ends starts or stops the algorithm. A parallelogram is an input or an output. A rectangle is a process, such as a calculation. A diamond is a decision, with one arrow in and two out, labelled yes and no. Follow the arrows one step at a time, and remember that an arrow looping back to an earlier shape is how a flowchart shows repetition.

  4. Read and write algorithms in pseudocode and in your exam’s own notation

    Pseudocode sets out the steps of an algorithm in a form that is close to a program but is not tied to one language. Each board has its own style. OCR prints algorithms in its Exam Reference Language, AQA in AQA pseudo-code, and Eduqas in the pseudo-code set out in its specification. For Edexcel, pseudocode means structured English, and code itself is always Python. You do not have to copy your board’s style exactly when you write an algorithm, but you do have to be able to read it, so practise with past papers from your own board.

  5. Complete a trace table to follow an algorithmOCR, AQA and Edexcel only

    A trace table has a column for each variable and a new row each time a value changes. Work through the algorithm one line at a time, as the computer would, and write down every change, including the output. It is slow on purpose. Tracing shows what an algorithm really does, which is how you find out what it is for and where it goes wrong. Trace tables are examined by OCR, AQA and Edexcel.

  6. Find and correct errors in an algorithm

    A syntax error breaks the rules of the language, such as a missing bracket, and stops the program from running at all. A logic error lets the program run but gives the wrong result, such as using less than where less than or equal to was needed, so that a loop stops one step early. To find a logic error, trace the algorithm with values where you already know the right answer, and look for the line where your table and the expected result part company.

  7. Compare the efficiency of two algorithms that solve the same problemAQA and Edexcel only

    Two correct algorithms can take very different amounts of work. The usual measure is time: the one that needs fewer steps for the same input is more efficient. Count the comparisons or the number of times the loop runs, and think about what happens as the list gets longer. AQA compares time only. Edexcel also asks about the memory an algorithm uses and whether it is fit for its purpose.

Computational thinking and designing algorithms key terms

The words the specification and the mark schemes use, each defined the way an examiner wants it.

Algorithm
A set of step-by-step instructions that solves a problem or completes a task.
Abstraction
Removing unnecessary detail from a problem so that the important parts can be concentrated on.
Decomposition
Breaking a problem down into smaller parts that are easier to solve.
Algorithmic thinking
Working out the precise sequence of steps needed to solve a problem.
Flowchart
A diagram that shows the steps of an algorithm as shapes joined by arrows.
Pseudocode
A way of writing an algorithm that is structured like a program but is not tied to one programming language.
Trace table
A table used to follow an algorithm by recording the value of each variable as it changes.
Structure diagram
A diagram that shows a problem broken down into smaller and smaller sub-problems.
Syntax error
An error that breaks the rules of the programming language, so the program cannot be translated.
Logic error
An error that lets a program run but makes it produce an unexpected or incorrect result.

Common mistakes in Computational thinking and designing algorithms

The slips that cost marks year after year, and what to do instead.

  • Defining abstraction and decomposition when the question asks you to apply them

    Name what you would ignore and what you would keep in this problem, or list the smaller tasks this problem breaks into.

  • Skipping rows in a trace table by doing steps in your head

    Write a new row every time any variable changes, and carry each value down from the row above before changing it.

  • Using the wrong flowchart shape for a decision

    A decision is a diamond with two labelled arrows leaving it. Inputs and outputs go in a parallelogram.

  • Calling a logic error a syntax error

    If the program runs and gives the wrong result, it is a logic error. A syntax error stops it from running at all.

Practice

Try a Computational thinking and designing algorithms question

A GCSE-style original question from this topic. Have a go before you open the working - deciding on an answer first is what makes the working stick.

Algorithm A adds up the whole numbers from 1 to n with a loop that runs n times. Algorithm B works out n × (n + 1) ÷ 2 in a single calculation. Both give the right answer. Which statement is correct when n is 1000?

Make Computational thinking and designing algorithms stick

A free account adds worked examples from our question bank, from a warm-up to a stretch, plus ask-Wiz - a coach you can put any point from this lesson to - and a checklist that remembers which points you've studied. No card needed.

Ready to practise Computational thinking and designing algorithms?

Sign up free to practise this topic - questions that adapt to how you're doing, with instant encouraging feedback on every answer. No card needed.

Download on the App StoreGet it on Google Play

Already have an account? Log in

More Computational thinking, algorithms and programming topics