Introduction to function machines

This page has been put together to help you practise and revisit some of the brilliant skills you’ve learned all through primary school.
It’s a great way to boost your confidence in maths and get you ready for the exciting next step into Year 8.
Welcome to the number factory! A function machine (or 'number machine') is a way of processing numbers.
In this guide, you will learn:
- what a function machine is
- how to process a number using two different steps (eg multiply by 2, then add 5)
- the most important skill: how to work backwards from the output to find the input
- how to use inverse (opposite) operations to solve problems

What is a function machine and a two-step machine?
A function machine takes a number (the input), does something to it, and gives a new number (the output).
A two-step machine, has two rules. You must follow them in order.
Example: IN → [x3] → [- 4] → OUT
If your input is 5, you process it in order from left to right:
Step 1: 5 x 3 = 15
Step 2: 15 - 4 = 11
Your output is 11.

The challenge: working backwards (output to input)

The real challenge is when a question gives you the output and asks you to find the input.
To solve this, you must work backwards from right to left, using the inverse (or opposite) operation for each step.
Top tip: the golden rule
To work backwards, you must use the inverse operations in the reverse order.
The inverse of + is -
The inverse of - is +
The inverse of x is ÷
The inverse of ÷ is x
Example: IN → [x4] → [+5] → OUT = 25
The output is 25. We need to find the input. Let's work backwards.
Start with the output: 25
Reverse step 2: The rule was + 5. The inverse is - 5.
25 - 5 = 20
Reverse step 1: The rule was x 4. The inverse is ÷ 4.
20 ÷ 4 = 5
The original input was 5.


Solving a problem

Often, a function machine problem won't show you the machine. It will be a word problem like this:
‘Grace thinks of a number. She multiplies it by 7 and then subtracts 3. Her final answer is 53. What number did Grace first think of?’
Solution:
This is a function machine problem in disguise! IN → [x 7] → [- 3] → OUT (53)
Let's work backwards from the output (53), using inverse operations in reverse order.
Start with the answer: 53
Inverse of step 2: The rule was - 3. The inverse is + 3.
53 + 3 = 56
Inverse of step 1: The rule was x 7. The inverse is ÷ 7.
56 ÷ 7 = 8
Answer: The number Grace first thought of was 8.

Backwards building activity
Summary

Fantastic! You now know how to use a two-step function machine, both forwards (input → output) and backwards (output → input).
You have mastered the super skill of using inverse operations in the reverse order to find the original input.

Brain boost
Think about these questions to stretch your thinking and sharpen your skills!
Why is it essential to use the inverse operations in reverse order when working backwards? What wrong answer would you get in the ‘Grace’ problem if you did 53 ÷ 7 + 3?
A machine's rules are 'x 10' and '- 5'. If the input is 2, what is the output? If the output is 45, what was the input?
What is the inverse of x 7? What is the inverse of - 18? What do you think the inverse of ÷ 0.5 would be? (Hint: dividing by 0.5 is the same as… what?)
Have a chat about your answers with a parent, teacher or your class.
More on Practise and revise KS2 maths
Find out more by working through a topic
- count4 of 24

- count6 of 24

- count7 of 24
