GCSE Maths Foundation · AQA · Solving equations & function machines
Function machines: why 12 → [−4] → [×5] is 40, not −8
Function-machine questions trip students who read the chain of boxes as a single BIDMAS expression instead of running it left-to-right. Faced with , a student flattens it to , does the multiply first, and writes . The same root cause has a second face: to reverse a machine, students run the same operations again rather than inverting each one in reverse order.
The thirty-second fix: a function machine is a left-to-right sequence, not one expression. Work the boxes one at a time, feeding each result into the next. And to reverse a machine, invert each box and reverse the order — undo the last box first, doing the opposite operation.
Already know this is your gap? Skip the diagnostic and jump straight into the targeted lesson.
How to spot it in your own work
- You answered for by reading it as with BIDMAS.
- You multiplied or grouped across boxes instead of working strictly left-to-right.
- To find an input, you ran the machine's operations forwards again (e.g. ) instead of inverting them.
- When you reversed a machine you kept the same order, instead of undoing the last box first.
An exam question that triggers it
Here is the canonical AQA Foundation trigger, the shape of JUN24 Paper 3 Q7a:
Here is a number machine.
Work out the output.
The misconception answer is , found by reading the chain as and doing the multiplication first. But a machine is not one expression — it is a sequence of boxes.
The correct answer is . The first box acts first: . Only then does the second box act: .
Why students fall for this
A function machine puts operations and numbers next to each other, and that visual pattern fires the most over-practised rule a student owns: BIDMAS. They silently rewrite as , multiply before they subtract, and reach . The arithmetic is correct; the reading is wrong. A machine is a sequence: each box can only act on the number that arrives at its opening, so the subtract-4 box must finish before the times-5 box has anything to multiply.
The same flat reading wrecks reversing. Asked for the input of when the output is , a student runs the operations forwards again — — which is bigger, not back to the start. To undo a machine you must do two things at once: invert each operation and reverse the order, undoing the last box first.
The fix: Left-to-right forwards; invert-in-reverse backwards
A function machine is a left-to-right sequence, not one expression. The input enters the first box; each box acts on whatever arrives and passes its result to the next box. So gives , then .
To reverse a machine, invert each box and reverse the order. Invert: and . Reverse: undo the last box first. So reverses to , and an output of 21 gives , then .
Worked example
A number machine is . Find the input.
- Invert each operation. becomes , and becomes .
- Reverse the order — undo the last box first. The last box forwards was , so its inverse acts first: .
- Then undo the first box. .
- Answer and check. Check forwards: , ✓.
The trap answer comes from running the operations forwards again. Inverting in reverse returns you to the input; repeating the operations carries you further away.
Find out if this is costing you marks
The 10-minute diagnostic checks for this pattern (and four others) using AQA-style GCSE Higher items. Free, no signup, anonymous.
Common questions
- How do I work out the output of a function machine?
Run it left-to-right, one box at a time. Put the input into the first box, take its result into the second box, and so on. For : , then . Never flatten the chain into one BIDMAS sum.
- Why isn't equal to ?
Because reads the machine as the single expression and applies BIDMAS. A machine is a sequence of boxes: the subtract-4 box acts first, , then the times-5 box acts, . The output is .
- How do I reverse a function machine to find the input?
Invert each operation and reverse the order, undoing the last box first. with output 21 reverses to : , then . Running the operations forwards again () is the classic mistake.
- How do I build a function machine for an equation like y = 3x − 24?
Read the operations on left-to-right: multiply by 3, then subtract 24, so the machine is . Check at : , , and .
Related misconceptions
- Solving equations: use the inverse, not the same operationThe same inversion idea inside an equation: undo with the opposite operation, not by repeating it.
- Inequalities: strict vs inclusiveAnother spot in this topic where reading the symbol precisely, not by habit, decides the answer.
- Fraction of an amount: why 2/5 of 1020 is 408, not 40A related reading error: treating an instruction as a label to copy, instead of an operation to run.