Function machines are one of the first introductions to algebraic thinking in GCSE Maths. They appear on Foundation and Higher papers and help bridge the gap between arithmetic and formal algebra.
What Are Function Machines?
A function machine is a diagram that shows a sequence of operations applied to an input to produce an output. Each box in the diagram represents one operation — such as multiply by 3, add 5, or square. You feed a number in, apply the operations in order, and get a result out.
Function machines are closely related to algebraic expressions. If the input is called x and the operations are "multiply by 2" then "add 7," the output can be written as the expression 2x + 7. This link between diagrams and algebra is a key concept.
A common exam skill is working backwards through a function machine. If you are given the output and need to find the input, you apply the inverse (opposite) operations in reverse order. For example, if the machine says "multiply by 3, then add 5" and the output is 20, you work backwards: subtract 5 to get 15, then divide by 3 to get 5.
Key Formulas
Step-by-Step Method
- Identify the input value and the operations shown in the function machine.
- To find the output, apply each operation in sequence from left to right.
- To write the expression, replace the input with x and apply the same operations.
- To work backwards (find the input from an output), list the operations in reverse and use inverse operations.
- Apply the inverse operations one at a time to the given output to find the input.
Worked Example 1 — Foundation Level
Question: A function machine takes an input, multiplies by 4, then subtracts 3. Find the output when the input is 6.
Working:
Step 1 — Start with the input: 6.
Step 2 — Multiply by 4: 6 × 4 = 24.
Step 3 — Subtract 3: 24 - 3 = 21.
Answer: 21
Worked Example 2 — Higher Level
Question: A function machine takes an input, adds 5, then squares the result. The output is 81. Find the input.
Working:
Step 1 — The operations in order are: add 5, then square.
Step 2 — Work backwards: the inverse of squaring is square-rooting, and the inverse of adding 5 is subtracting 5.
Step 3 — Start with the output 81. Square root: √81 = 9.
Step 4 — Subtract 5: 9 - 5 = 4.
Answer: Input = 4
Worked Example 3 — Exam Style
Question: A function machine has two operations: multiply by 3, then add 7. (a) Write an expression for the output when the input is x. (b) The output is 25. Find the input. (4 marks)
Working:
(a) Step 1 — Input is x. Multiply by 3: 3x. Add 7: 3x + 7.
The expression is 3x + 7.
(b) Step 1 — Set 3x + 7 = 25.
Step 2 — Subtract 7: 3x = 18.
Step 3 — Divide by 3: x = 6.
Answer: (a) 3x + 7 (b) x = 6
Common Mistakes
- Applying operations in the wrong order. Function machines go left to right. Multiplying by 2 then adding 3 gives a different result from adding 3 then multiplying by 2.
- Using the wrong inverse operation. The inverse of adding is subtracting, and the inverse of multiplying is dividing. Students sometimes confuse these, especially with squaring and square-rooting.
- Forgetting to reverse the order when working backwards. If the forward operations are multiply then add, the backward operations must be subtract then divide — in that order.
Exam Tips
- Draw the function machine diagram if one is not given — it helps you see the order of operations.
- When writing an expression, remember that "multiply by 3 then add 5" gives 3x + 5, not 3(x + 5).
- Working backwards is the same skill as solving an equation — practise both to build confidence.
Practice Questions
Q1 (Foundation): A function machine multiplies by 5, then adds 2. Find the output when the input is 7.
Q2 (Foundation): A function machine subtracts 4, then multiplies by 3. The output is 18. Find the input.
Q3 (Higher): A function machine divides by 2, then squares the result. Write an expression for the output when the input is n.
Practise function machines questions with instant feedback — completely free on GCSEMathsAI.
Related Topics
Summary
- A function machine applies operations to an input to produce an output.
- To find the output, apply operations in order from left to right.
- To work backwards, apply inverse operations in reverse order.
- Function machines can be written as algebraic expressions by using x as the input.
- Working backwards through a function machine is the same as solving an equation.
Test your understanding
5 quick MCQs to identify any misconceptions on this topic.
Further reading from leading academic institutions — free and open-access.