What you'll learn
- How to read input and output diagrams.
- How to calculate an output from an input.
- How to work backwards to find the starting number.
- How to use real-life rules, like temperatures and taxi fares, as function machines.
1. What is a function machine?
A function machine is a way of showing a rule. You put a number in, follow the instructions in the boxes, and get a number out.
Function machine words
-
A function machine is a set of instructions that changes a starting number into an answer.
-
The input is the number you put in.
-
The output is the number that comes out.
-
An operation is a maths action, such as add, subtract, multiply or divide.
Follow the arrows
Always do the boxes in the order shown. A different order can give a different answer.
Finding an output
A machine says: input → multiply by 4 → subtract 2 → output. Find the output when the input is 6.

-
Start with the input: 6.
-
The first box says multiply by 4:
6×4=246 \times 4 = 246×4=24 -
The second box says subtract 2:
24−2=2224 - 2 = 2224−2=22 -
The output is 22.
2. Filling in a missing box
Sometimes one box in the machine is missing. Use the boxes you do know first, then compare with the final output.
Finding the missing operation
A machine says: input → add 10 → missing box → output. When the input is 5, the output is 4. Find the missing box.

-
Start with the input: 5.
-
Use the first box, add 10:
5+10=155 + 10 = 155+10=15 -
Now ask: what changes 15 into 4?
-
Since 15 subtract 11 gives 4, the missing box is subtract 11.
Skipping the known box
Do not compare the input straight to the output until you have used the boxes already shown.
3. Working backwards to find the input
If you know the output but not the input, you need to go backwards through the machine.
Inverse operation
An inverse operation undoes another operation. Add and subtract undo each other; multiply and divide undo each other.
Reverse the order
When working backwards, undo the last box first, then undo the first box.
Finding an input
A machine says: input → multiply by 6 → add 4 → output. The output is 46. Find the input.

-
The forwards machine is multiply by 6, then add 4.
-
Start at the output, 46, and move backwards.
-
Undo add 4 by subtracting 4:
46−4=4246 - 4 = 4246−4=42 -
Undo multiply by 6 by dividing by 6:
42÷6=742 \div 6 = 742÷6=7 -
The input was 7.
Backwards checklist
Write the operations in reverse order before you calculate. This helps you avoid undoing the boxes in the wrong order.
4. Machines with division
If a machine divides when going forwards, it multiplies when going backwards.
Division in a function machine
A machine says: input → divide by 5 → add 3 → output.
Find the output when the input is 40. Then find the input when the output is 12.

-
For input 40, first divide by 5:
40÷5=840 \div 5 = 840÷5=8 -
Then add 3:
8+3=118 + 3 = 118+3=11 -
So the output is 11.
-
For output 12, start backwards by undoing add 3:
12−3=912 - 3 = 912−3=9 -
Undo divide by 5 by multiplying by 5:
9×5=459 \times 5 = 459×5=45 -
So the input is 45.
Undoing division
If the forwards box says divide by 5, the backwards step is multiply by 5, not divide again.
5. Negative inputs
A negative number is less than zero. It is written with a minus sign, such as -3.
Be careful with signs when the input is negative.
Using a negative input
A machine says: input → multiply by 4 → add 7 → output. Find the output when the input is -2.

-
Start with the input: -2.
-
Multiply by 4:
−2×4=−8-2 \times 4 = -8−2×4=−8 -
Add 7:
−8+7=−1-8 + 7 = -1−8+7=−1 -
The output is -1.
Sign check
Adding a positive number to a negative number moves you towards zero. For example, -8 add 7 gives -1.
6. When the input and output are the same
You might be asked to show that there is an input where the output has the same value. You only need to find one value that works, then check it.
Showing one value works
A machine says: input → multiply by 4 → subtract 9 → output. Show that there is an input where the output is the same as the input.

-
Try input 3.
-
First multiply by 4:
3×4=123 \times 4 = 123×4=12 -
Then subtract 9:
12−9=312 - 9 = 312−9=3 -
The output is 3, which is the same as the input, so input 3 works.
7. Real-life rules are function machines
A worded rule can be treated like a function machine. Read the rule carefully and turn it into boxes.
For example, Celsius and Fahrenheit are two temperature scales. A rule might say: multiply the Celsius temperature by 1.8, then add 32.
Temperature rule
A temperature rule is: Celsius → multiply by 1.8 → add 32 → Fahrenheit.
Find the Fahrenheit temperature for 10°C. Then find the Celsius temperature for 77°F.

-
For 10°C, multiply by 1.8:
10×1.8=1810 \times 1.8 = 1810×1.8=18 -
Add 32:
18+32=5018 + 32 = 5018+32=50 -
So 10°C is 50°F.
-
For 77°F, work backwards. Undo add 32:
77−32=4577 - 32 = 4577−32=45 -
Undo multiply by 1.8:
45÷1.8=2545 \div 1.8 = 2545÷1.8=25 -
So 77°F is 25°C.
A taxi fare rule is also a function machine. A fixed charge is the starting amount you pay before distance is added. Per mile means for each mile travelled.
Taxi fare rule
A taxi costs £3 plus £2 per mile.
Find the cost of a 7-mile journey. Then find the distance if the fare is £19.

-
For 7 miles, the mileage cost is 7 × £2 = £14.
-
Add the fixed charge: £14 + £3 = £17.
-
So the 7-mile journey costs £17.
-
For a fare of £19, work backwards by subtracting the fixed charge: £19 - £3 = £16.
-
£16 pays for the miles. At £2 per mile, 16 ÷ 2 = 8.
-
So the journey was 8 miles.
In the exam
-
For outputs, start at the input and follow the arrows from left to right.
-
For inputs, start at the output and use inverse operations in the reverse order.
-
For worded rules, write the rule as boxes before calculating.
Check yourself
-
If a machine says “multiply by 5, then subtract 7”, what happens first?
-
What operation undoes “add 12”?
-
A taxi fare is “£4 plus £3 per mile” — what are the two boxes in the machine?