A function machine works on a number one box at a time
A function machine works on a number one box at a time, from left to right.
Function machine
A function machine is a diagram that shows the operations applied, in order, to an input to give an output.
A machine has three kinds of part:
- Input is the number that goes in at the left.
- Box is one operation with its number, such as ×4.{\times 4\text{.}}×4.
- Output is the number that comes out at the right.
The 28 from the first box, not the input 7, goes into the second box.
Each box acts on the whole result so far. The machine +8{+ 8}+8 then ÷4{\div 4}÷4 with input 12 works out (12+8)÷4=5,{(12 + 8) \div 4 = 5\text{,}}(12+8)÷4=5, not 12+8÷4=14.{12 + 8 \div 4 = 14\text{.}}12+8÷4=14.
A negative input works the same way, using the rules in the guide Negative Numbers.
A negative input
A function machine multiplies by 2, then adds 10. Find the output when the input is −3.{-3\text{.}}−3.
- Multiply the input by 2, so −3×2=−6.{-3 \times 2 = -6\text{.}}−3×2=−6.
- Add 10 to that result, so −6+10=4.{-6 + 10 = 4\text{.}}−6+10=4. The output is 4.
Work backwards with inverse operations to find the input
When the output is given, run the machine backwards to find the input. Start at the output and undo the last box first with its inverse operation.
Inverse operation
An inverse operation is the operation that undoes another, so +a{+ a}+a and −a{- a}−a are inverses, and so are ×a{\times a}×a and ÷a{\div a}÷a when a{a}a is not 0.
Both operations are swapped for their inverses, and the order of the boxes is reversed.
Wrong. The machine ×5{\times 5}×5 then −3{- 3}−3 has output 22. Putting 22 through forwards gives 22×5=110{22 \times 5 = 110}22×5=110 and 110−3=107,{110 - 3 = 107\text{,}}110−3=107, so the input is 107.
Right. The 22 is the output, so write it at the right-hand end and work backwards. Then 22+3=25{22 + 3 = 25}22+3=25 and 25÷5=5,{25 \div 5 = 5\text{,}}25÷5=5, so the input is 5.
A think-of-a-number puzzle gives a machine's steps in words. Pick out the steps, then undo them, last step first.
A think-of-a-number puzzle
Ria thinks of a number, multiplies it by 3, then subtracts 7 to get 20. What is her number?
- Undo −7{- 7}−7 first with its inverse +7,{+ 7\text{,}}+7, so 20+7=27.{20 + 7 = 27\text{.}}20+7=27.
- Undo ×3{\times 3}×3 with ÷3,{\div 3\text{,}}÷3, so 27÷3=9.{27 \div 3 = 9\text{.}}27÷3=9.
- Check forwards. 9×3=27{9 \times 3 = 27}9×3=27 and 27−7=20,{27 - 7 = 20\text{,}}27−7=20, so her number is 9.
Wrong. The machine +9{+ 9}+9 then ×3{\times 3}×3 has output 33. Undoing the first box first gives 33−9=24{33 - 9 = 24}33−9=24 and 24÷3=8,{24 \div 3 = 8\text{,}}24÷3=8, so the input is 8.
Right. The ×3{\times 3}×3 box was used last, so it is undone first. Then 33÷3=11{33 \div 3 = 11}33÷3=11 and 11−9=2,{11 - 9 = 2\text{,}}11−9=2, so the input is 2.
Write down each box's result, and take care with negatives. For example, −8÷4=−2,{-8 \div 4 = -2\text{,}}−8÷4=−2, not 2.
Undoing the last box, or writing both inverses on the machine, earns a method mark even if a later step slips. Check the input forwards, then write it alone on the answer line.
Fill a blank box from both ends, and find an input that comes out unchanged
A blank box is filled by working in from both ends to the numbers either side of it. The operation that links them goes in the box.
A blank box can often be filled in more than one correct way.
Write the operation with its sign, such as −8,{- 8\text{,}}−8, never a bare number.
To show that an input comes out unchanged, try a number, run it through and adjust it until the output equals the input.
An input that comes out unchanged
A function machine multiplies by 5, then subtracts 12. Show that one input gives itself as the output.
- Try 2. 2×5=10{2 \times 5 = 10}2×5=10 and 10−12=−2,{10 - 12 = -2\text{,}}10−12=−2, which is less than 2.
- Try 4. 4×5=20{4 \times 5 = 20}4×5=20 and 20−12=8,{20 - 12 = 8\text{,}}20−12=8, which is more than 4.
- Try 3, between them. 3×5=15{3 \times 5 = 15}3×5=15 and 15−12=3.{15 - 12 = 3\text{.}}15−12=3.
- The input 3 gives the output 3, so 3 comes out unchanged.
In a "Show that" question about an unchanged input, show each box's result and end by stating that the output equals the input. Never change a number in the machine itself.
When trying numbers is slow, write the machine as an equation. Here 5n−12=n.{5n - 12 = n\text{.}}5n−12=n. Subtracting n{n}n from both sides and adding 12 gives 4n=12,{4n = 12\text{,}}4n=12, so n=3.{n = 3\text{.}}n=3.
- Why must you undo the last box first when you work backwards through a function machine?
- Explain why a blank box can sometimes be filled with two different operations.
What is the output of the machine −9{- 9}−9 then ×2{\times 2}×2 when the input is 5?
Solution
−8{-8}−8
The machine ×4{\times 4}×4 then +10{+ 10}+10 gives the output 2. What is the input?
Solution
−2{-2}−2
The machine ×3{\times 3}×3 then a blank box takes 5 to 11. Which subtraction fills the blank box?
Solution
−4{- 4}−4