Follow inputs through a chain of operations, work backwards from an output, and write the machine's rule as algebra. It is a Foundation topic, aimed at grade 2. Free questions with answers are on this page. Worked examples show each line before you try the questions.
A function machine is a one-way conveyor: the input goes through each operation in order. If the machine divides by 3 then adds 8, an input of 9 becomes 3 then 11. Write the output as an expression by wrapping the first operation in a bracket: input x becomes 3x+8, or 5(x+1) if it adds 1 then multiplies by 5.
To go backwards, undo the last operation first. If the machine subtracts 6 then multiplies by 2 and the output is 20, divide by 2 to get 10, then add 6 to get 16. Inverse of + is −, inverse of × is ÷, and you reverse the order.
Two-step machines are the seed of solving equations. The same undoing, written with an equals sign, is one-step and two-step algebra in the next topics.
Objectives
The input is the number you start with.
Do the steps from left to right, as drawn.
Input 5, × 2, + 3 gives 13.
Key points
Find the output of a function machine for a given input.
Find the input by working backwards using inverse operations.
Write the output as an algebraic expression when the input is x.
Use the expression to find an input for a given output.
Worked examples
Example 1
A function machine does × 3 then + 4. The input is 2. What is the output?
2 marks
× 3 first: 2 × 3 = 6.
Then + 4: 6 + 4 = 10.
The output is 10.
Answer: 10
Common slips
Slip: × 5 first: 2 × 3 = 6. That changes a number from the question, so it answers a different question.
Slip: Then + 7: 6 + 4 = 10. That changes a number in the working, so the step no longer follows from the one before.
Slip: The output is 14. That does not match the working above it.
Example 2
A function machine does × 2 then − 5. The input is 3. What is the output?
2 marks
× 2 first: 3 × 2 = 6.
Then − 5: 6 − 5 = 1.
The output is 1.
Answer: 1
Common slips
Slip: × 4 first: 3 × 2 = 6. That changes a number from the question, so it answers a different question.
Slip: Then − 8: 6 − 5 = 1. That changes a number in the working, so the step no longer follows from the one before.
Slip: The output is 5. That does not match the working above it.
Example 3
A function machine does × 3 then + 4. The output is 16. What is the input?
2 marks
Undo the last step first: 16 − 4 = 12.
Then undo the multiplication: 12 ÷ 3 = 4.
The input is 4.
Answer: 4
Common slips
Slip: Undo the last step first: 18 − 4 = 12. That changes a number from the question, so it answers a different question.
Slip: Then undo the multiplication: 15 ÷ 3 = 4. That changes a number in the working, so the step no longer follows from the one before.
Slip: The input is 8. That does not match the working above it.
Questions and answers
GCSE Maths function machines questions and answers. Try each one, then open the answer. Easy questions come first.
Question 1 Easy2 marks
A function machine does × 3 then + 4. The input is 5. What is the output?
Show answer
Answer: 19
× 3 first: 5 × 3 = 15.
Then + 4: 15 + 4 = 19.
M1 — × 3 first: 5 × 3 = 15.
A1 — Answer 19
Question 2 Easy2 marks
A function machine does × 2 then − 5. The input is 6. What is the output?
Show answer
Answer: 7
× 2 first: 6 × 2 = 12.
Then − 5: 12 − 5 = 7.
M1 — × 2 first: 6 × 2 = 12.
A1 — Answer 7
Question 3 Medium2 marks
A function machine does × 2 then − 5. The input is 9. What is the output?
Show answer
Answer: 13
× 2 first: 9 × 2 = 18.
Then − 5: 18 − 5 = 13.
M1 — × 2 first: 9 × 2 = 18.
A1 — Answer 13
Question 4 Medium2 marks
A function machine does × 3 then + 4. The output is 34. What is the input?
Show answer
Answer: 10
Undo the last step first: 34 − 4 = 30.
Then undo the multiplication: 30 ÷ 3 = 10.
M1 — Undo the last step first: 34 − 4 = 30.
A1 — Answer 10
Question 5 Hard2 marks
A function machine does × 2 then − 5. The output is 21. What is the input?
Show answer
Answer: 13
Undo the last step first: 21 + 5 = 26.
Then undo the multiplication: 26 ÷ 2 = 13.
M1 — Undo the last step first: 21 + 5 = 26.
A1 — Answer 13
Question 6 Hard2 marks
A function machine does × 3 then + 4. The input is 14. What is the output?
Show answer
Answer: 46
× 3 first: 14 × 3 = 42.
Then + 4: 42 + 4 = 46.
M1 — × 3 first: 14 × 3 = 42.
A1 — Answer 46
Question 7 Exam-style2 marks
A function machine does × 2 then − 5. The output is 29. What is the input?
Show answer
Answer: 17
Undo the last step first: 29 + 5 = 34.
Then undo the multiplication: 34 ÷ 2 = 17.
The input is 17.
M1 — Undo the last step first: 29 + 5 = 34.
A1 — Answer 17
Common mistakes
Most lost marks on this topic are one slip.
Doing the second step first.
Follow the machine from left to right.
Undoing the steps in the same order.
The inverse reverses the order and the operations.
Adding when the machine says multiply.
Read the operation on each arrow.
Spot the slip
Input 4 goes through × 2. What is the output?
8
6
2
Show the slip
8 Four times two is 8.
Exam tips
Be ready to do this without a calculator. Paper 1 is the non-calculator paper.
If the question says “show that”, the result is given. The marks are for the steps that reach it.
The method is the same on AQA-style and Edexcel-style papers.
Draw the machine with arrows and write the inverse operations underneath the arrows before working backwards.
For the algebra part, write the expression after each box (x, then 2x, then 2x+7) — those intermediate steps show your method.
Printable worksheet
The same questions are in a PDF you can print. Answers start on a later page.