📁 Topic 1 · 1.1 Algorithms
1.1a What are algorithms?
Edexcel 4CP0 · iGCSE Computer Science · ~10 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

What is an Algorithm?

An algorithm is a precise, step-by-step set of instructions designed to solve a problem or complete a task. Every algorithm must have a clear start and end point, and must always produce a result when given a valid input.

The Edexcel 4CP0 specification requires you to be able to interpret given algorithms (work out what they do) and create your own algorithms to solve stated problems.

Characteristics of a Good Algorithm

A well-designed algorithm must have all of the following properties:

  • Correct — it produces the right output for all valid inputs
  • Unambiguous — every step has exactly one meaning; there is no room for interpretation
  • Finite — it terminates after a limited number of steps (it does not run forever)
  • Clear inputs and outputs — it is obvious what data goes in and what result comes out
  • Efficient — it uses as few steps, as little memory, and as little time as possible to reach the solution

Types of Algorithmic Steps

All algorithms are built from three fundamental constructs:

ConstructDescriptionExample
SequenceSteps executed one after another in orderInput name, then print greeting
SelectionA decision is made; different paths taken based on a conditionIF score ≥ 50 THEN pass ELSE fail
IterationSteps repeated while a condition is true or a set number of timesLoop through all items in a list

Interpreting Algorithms

To interpret an algorithm, read each step carefully and trace what happens to variables as the algorithm runs. Follow any conditions and loops exactly — do not skip steps.

Example: Interpret what the following algorithm does when x = 10:

  1. SET result TO 0
  2. SET count TO 1
  3. WHILE count ≤ x DO
  4.     SET result TO result + count
  5.     SET count TO count + 1
  6. ENDWHILE
  7. SEND result TO DISPLAY

This algorithm calculates the sum of integers from 1 to x (i.e. 1+2+3…+10 = 55).

Creating Algorithms

When writing your own algorithm, follow these steps:

  1. Identify the inputs — what data does the algorithm need?
  2. Identify the outputs — what result should it produce?
  3. Break the problem into logical steps — use sequence, selection, and iteration
  4. Check your algorithm by tracing it with a test value

Algorithms can be expressed as written steps, flowcharts, or pseudocode — all three are valid representations.

📝 Exam Tip: In Edexcel 4CP0 Paper 1, you may be asked to "state what the algorithm does" or "complete the algorithm". Always trace through values step by step — do not guess from the overall structure.
⚠️ Common Mistakes
  • Saying an algorithm is correct just because it works for one test value — you must check edge cases
  • Confusing "finite" with "fast" — an algorithm can be slow but still finite
  • Missing an output step at the end of your algorithm — always SEND the result TO DISPLAY
Video Coming Soon
This lesson video is being produced
Click slide or press arrow keys to navigate
✍️

Worksheet — 1.1a What are algorithms?

Answer each question then click Submit for marking against the Edexcel mark scheme.

Q1 Define the term 'algorithm'. [2 marks]
✅ Mark Scheme
Accept any 2 of:
• A set of step-by-step instructions (1) to solve a problem / complete a task (1)
• Must be finite / will eventually terminate (1)
• Steps must be unambiguous / clear (1)
• Produces an output / result (1)
Q2 State three characteristics of a well-designed algorithm. [3 marks]
✅ Mark Scheme
1 mark each, any 3 of:
• Correct / produces the right result for all valid inputs
• Unambiguous / each step has exactly one meaning
• Finite / terminates after a limited number of steps
• Has clearly defined inputs and outputs
• Efficient / uses minimal steps/resources
Q3 Name the three fundamental constructs used in algorithms and give one example of each. [6 marks]
✅ Mark Scheme
1 mark per construct + 1 mark per valid example:
• Sequence (1) — steps performed one after another in order, e.g. input then output (1)
• Selection (1) — branch based on a condition, e.g. IF … THEN … ELSE (1)
• Iteration (1) — repeating steps, e.g. WHILE loop, FOR loop (1)
Q4 The following algorithm is intended to find the largest of three numbers A, B and C. Identify the error and explain what effect it has. [3 marks]
SET largest TO A
IF B > largest THEN
  SET largest TO B
IF C > A THEN
  SET largest TO C
SEND largest TO DISPLAY
✅ Mark Scheme
Mark scheme:
• Error: Line 4 checks C > A instead of C > largest (1)
• Effect: if B is larger than A but C is not larger than A (but is larger than B), C will incorrectly be set as largest / the algorithm may produce the wrong result (1)
• Correct line should read: IF C > largest THEN (1)
Q5 Write an algorithm in pseudocode that inputs 5 numbers from the user and outputs their total. [4 marks]
✅ Mark Scheme
Award marks for:
• Initialise total to 0 (1)
• Loop that runs exactly 5 times (1)
• Input a number inside the loop (1)
• Add number to total inside the loop (1)
• Output total after the loop [not penalised if inside loop but loses logic mark] (no extra mark)

Example solution:
SET total TO 0
FOR count FROM 1 TO 5
  RECEIVE num FROM KEYBOARD
  SET total TO total + num
NEXT count
SEND total TO DISPLAY
Quick Quiz
1 / 5
out of 5
Edexcel 4CP0 · Topic 1 — Problem Solving
Card 1 of 8
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
AlgorithmA precise, finite set of step-by-step instructions used to solve a problem or complete a task
SequenceSteps executed one after another in a fixed order
SelectionA decision point in an algorithm where different paths are taken based on a condition (IF/THEN/ELSE)
IterationRepeating a set of steps a number of times or while a condition holds true (loops)
InputData supplied to an algorithm for processing
OutputThe result produced by an algorithm after processing inputs
FiniteAn algorithm that is guaranteed to terminate after a limited number of steps
UnambiguousEach step of the algorithm has exactly one clear meaning — no room for interpretation

🎯 Mini Test

Test your understanding of algorithms — Edexcel 4CP0 style questions with a time limit.

  • 5 questions (3 MCQ + 2 short answer)
  • 10 minutes
  • Edexcel mark scheme feedback
← Dashboard Topic 1 · 1.1 Algorithms Next: 1.1b Flowcharts →
🔒
Pro Content
Subscribe to access all 47 Edexcel iGCSE lessons.
£7.99/month
or £59/year