GCSE Maths Foundation

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 12[4][×5]12 \rightarrow [-4] \rightarrow [\times 5], a student flattens it to 124×512 - 4 \times 5, does the multiply first, and writes 8-8. 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 8-8 for 12[4][×5]12 \rightarrow [-4] \rightarrow [\times 5] by reading it as 124×512 - 4 \times 5 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. 21×43=8121 \times 4 - 3 = 81) 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.

12[4][×5]output12 \rightarrow [\,-\,4\,] \rightarrow [\,\times\,5\,] \rightarrow \text{output}

Work out the output.

The misconception answer is 8-8, found by reading the chain as 124×512 - 4 \times 5 and doing the multiplication first. But a machine is not one expression — it is a sequence of boxes.

The correct answer is 4040. The first box acts first: 124=812 - 4 = 8. Only then does the second box act: 8×5=408 \times 5 = 40.

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 12[4][×5]12 \rightarrow [-4] \rightarrow [\times 5] as 124×512 - 4 \times 5, multiply before they subtract, and reach 8-8. 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 [×4][3][\times 4] \rightarrow [-3] when the output is 2121, a student runs the operations forwards again — 21×43=8121 \times 4 - 3 = 81 — 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 12[4][×5]12 \rightarrow [-4] \rightarrow [\times 5] gives 124=812 - 4 = 8, then 8×5=408 \times 5 = 40.

To reverse a machine, invert each box and reverse the order. Invert: ++\leftrightarrow- and ×÷\times\leftrightarrow\div. Reverse: undo the last box first. So [×4][3][\times 4] \rightarrow [-3] reverses to [+3][÷4][+3] \rightarrow [\div 4], and an output of 21 gives 21+3=2421 + 3 = 24, then 24÷4=624 \div 4 = 6.

Worked example

A number machine is input[×4][3]21\text{input} \rightarrow [\times 4] \rightarrow [-3] \rightarrow 21. Find the input.

  1. Invert each operation. ×4\times 4 becomes ÷4\div 4, and 3-3 becomes +3+3.
  2. Reverse the order — undo the last box first. The last box forwards was 3-3, so its inverse acts first: 21+3=2421 + 3 = 24.
  3. Then undo the first box. 24÷4=624 \div 4 = 6.
  4. Answer and check.
    input=(21+3)÷4=24÷4=6\text{input} = (21 + 3) \div 4 = 24 \div 4 = 6
    Check forwards: 6×4=246 \times 4 = 24, 243=2124 - 3 = 21 ✓.

The trap answer 21×43=8121 \times 4 - 3 = 81 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 7[×3][2]7 \rightarrow [\times 3] \rightarrow [-2]: 7×3=217 \times 3 = 21, then 212=1921 - 2 = 19. Never flatten the chain into one BIDMAS sum.

Why isn't 12[4][×5]12 \rightarrow [-4] \rightarrow [\times 5] equal to 8-8?

Because 8-8 reads the machine as the single expression 124×512 - 4 \times 5 and applies BIDMAS. A machine is a sequence of boxes: the subtract-4 box acts first, 124=812 - 4 = 8, then the times-5 box acts, 8×5=408 \times 5 = 40. The output is 4040.

How do I reverse a function machine to find the input?

Invert each operation and reverse the order, undoing the last box first. [×4][3][\times 4] \rightarrow [-3] with output 21 reverses to [+3][÷4][+3] \rightarrow [\div 4]: 21+3=2421 + 3 = 24, then 24÷4=624 \div 4 = 6. Running the operations forwards again (21×43=8121 \times 4 - 3 = 81) is the classic mistake.

How do I build a function machine for an equation like y = 3x − 24?

Read the operations on xx left-to-right: multiply by 3, then subtract 24, so the machine is [×3][24][\times 3] \rightarrow [-24]. Check at x=10x = 10: 10×3=3010 \times 3 = 30, 3024=630 - 24 = 6, and 3×1024=63 \times 10 - 24 = 6.

Related misconceptions

← All GCSE Maths Higher misconceptions

Function machines: why 12 → [−4] → [×5] is 40, not −8 | GCSE Maths Foundation