- What inputs and outputs mean in a function machine.
- How to follow a two-step rule to find an output.
- How to work backwards using inverse operations to find an input.
- How real-life rules, such as temperatures and taxi fares, behave like function machines.
A function machine is a way of showing a rule. You put a number in, the machine performs one or more instructions, and a new number comes out.
Function machine vocabulary
- A function machine is a rule that changes a number by following operations in order.
- The input is the number that goes into the machine.
- The output is the number that comes out.
- An operation is an instruction such as add 5, subtract 3, multiply by 4, or divide by 2.
A two-step function machine might multiply by 4, then add 7. If you need to find the input from the output, you reverse the journey and undo each operation.

Follow the arrows
In a function machine, the arrows tell you the order. Work from left to right when finding an output, and from right to left when finding an input.
To find an output, start with the input and do each operation in the order shown.
Finding the output
A machine multiplies by 4, then subtracts 7. Find the output when the input is 6.
-
Start with the input, 6. Do the first operation: multiply by 4.
6×4=246 \times 4 = 246×4=24
-
Now use 24 in the second operation: subtract 7.
24−7=1724 - 7 = 1724−7=17
-
The output is 17.
Stopping too early
If a machine has two boxes, you must use both boxes. After the first operation, your answer is only the halfway value, not the final output.
Sometimes one of the boxes is blank. To fill it in, work out what number you have just before the blank box, then compare it with the final output.
Completing a number machine
A machine first adds 10. After that, a missing operation happens. When the input is 8, the output is 5. Find the missing operation.
-
Put the input through the known operation first.
8+10=188 + 10 = 188+10=18
-
The missing operation must change 18 into 5.
-
Work out the change from 18 to 5.
18−13=518 - 13 = 518−13=5
-
The missing operation is subtract 13.
Look at the number just before the blank
The missing box acts on the number that reaches it, not always on the original input.
If you are given the output and asked for the input, you need to undo the machine.
Inverse operations
An inverse operation is an operation that undoes another operation. Add is undone by subtract, subtract is undone by add, multiply is undone by divide, and divide is undone by multiply.
The important part is that you reverse the order as well as changing each operation to its inverse.
For example, if the machine says:
then working backwards means:
- subtract 2 first
- then divide by 6
Working backwards
A machine multiplies by 6, then adds 2. The output is 44. Find the input.
-
Start at the output, 44.
-
Undo the last operation first. The last operation was add 2, so subtract 2.
44−2=4244 - 2 = 4244−2=42
-
Undo the first operation. The first operation was multiply by 6, so divide by 6.
42÷6=742 \div 6 = 742÷6=7
-
The input is 7.
Undoing in the wrong order
Do not divide by 6 first in this example. When working backwards, you undo the last box first because that was the final change made to the number.
Division works in the same way as the other operations. Just be especially careful when reversing it: the inverse of divide by 4 is multiply by 4.
A machine with division
A machine divides by 3, then adds 4.
Find the output when the input is 15. Then find the input when the output is 10.
-
First find the output for input 15. Divide by 3.
15÷3=515 \div 3 = 515÷3=5
-
Then add 4.
5+4=95 + 4 = 95+4=9
-
So when the input is 15, the output is 9.
-
Now work backwards from the output 10. Undo add 4 by subtracting 4.
10−4=610 - 4 = 610−4=6
-
Undo divide by 3 by multiplying by 3.
6×3=186 \times 3 = 186×3=18
-
So when the output is 10, the input is 18.
Inputs can be negative. A negative number is a number less than zero, such as -2 or -7.
When multiplying a negative number by a positive number, the result is negative. Then you continue through the machine as usual.
Using a negative input
A machine multiplies by 5, then adds 6. Find the output when the input is -2.
-
Start with -2 and multiply by 5.
−2×5=−10-2 \times 5 = -10−2×5=−10
-
Now add 6.
−10+6=−4-10 + 6 = -4−10+6=−4
-
The output is -4.
Check the direction on a number line
Adding makes a number move to the right on a number line. Subtracting makes it move to the left. This helps when your halfway value is negative.
Sometimes you may be asked to show that there is an input where the output has the same value.
A variable is a letter that stands for a number we do not know yet. An equation says two expressions are equal.
Showing the input can equal the output
A machine multiplies the input by 4, then subtracts 9. Show that there is a value where the input and output are the same.
-
Let the input be nnn. If the output is the same as the input, the output is also nnn.
-
Write the rule as an equation.
4n−9=n4n - 9 = n4n−9=n
-
Solve the equation by collecting the nnn terms.
4n−9=n3n−9=03n=9n=3\begin{aligned}
4n - 9 &= n \\
3n - 9 &= 0 \\
3n &= 9 \\
n &= 3
\end{aligned}4n−93n−93nn=n=0=9=3
-
Check the value: input 3 gives 12 after multiplying by 4, then subtracting 9 gives 3.
-
So input 3 and output 3 are the same value.
Always check a 'show that' answer
Once you think you have found the input, put it back through the machine. If the output matches, your answer is convincing.
A real-life rule can work just like a function machine. A formula is a rule written using letters or symbols.
For example, to change Celsius to Fahrenheit, the rule is:
F=1.8C+32F = 1.8C + 32F=1.8C+32
This means multiply the Celsius temperature by 1.8, then add 32.
Changing temperatures both ways
A temperature is 15°C. Convert it to Fahrenheit. Another temperature is 68°F. Convert it to Celsius.
-
For 15°C, multiply by 1.8.
15×1.8=2715 \times 1.8 = 2715×1.8=27
-
Add 32.
27+32=5927 + 32 = 5927+32=59
-
So 15°C is 59°F.
-
To convert 68°F back to Celsius, work backwards. First subtract 32.
68−32=3668 - 32 = 3668−32=36
-
Now undo multiply by 1.8 by dividing by 1.8.
36÷1.8=2036 \div 1.8 = 2036÷1.8=20
-
So 68°F is 20°C.
Taxi fares can also be function machines. “£2.50 plus £2.20 per mile” means there is a fixed starting charge of £2.50, then £2.20 is added for each mile.
Using a taxi fare rule
A taxi company charges £2.50 plus £2.20 per mile.
Find the cost of a 6 mile journey. Then find the distance if the fare is £26.70.
-
For 6 miles, the per-mile part costs £13.20 because 6 lots of £2.20 is £13.20.
-
Add the fixed charge of £2.50, giving a total fare of £15.70.
-
Now work backwards from £26.70. First remove the fixed charge: £26.70 minus £2.50 gives £24.20.
-
The remaining £24.20 pays for the miles. Since 11 lots of £2.20 is £24.20, the journey was 11 miles.
In the exam
-
Read the machine from left to right when finding an output.
-
If finding an input, start with the output and undo the operations in reverse order.
-
For real-life rules, identify the fixed part first, then the repeated “per mile” or “per degree” part.
Check yourself
-
If a machine does “multiply by 3, then add 5”, what operations would you use to work backwards?
-
Why is the halfway value important when one box in the machine is missing?
-
How would you check an answer where the input and output are meant to be the same?