KS Maths
Year 7 · Unit 3 Patterns, expressions and equations · Lesson 5 of 6

Function machines

What goes in, and what comes out?

A function machine takes a number, does one or two steps to it and gives a number back. Run it forwards, then run it backwards to find what must have gone in.

Number and AlgebraNo calculator

Words you need (10 key words in this lesson)

The maths words this lesson uses, in plain English. Open this before you start if English is not your first language.

function
A rule that gives exactly one output for each input.f(x) = x plus 2 is a function.
input
The number you put into a function or machine.If the input is 3, the output is 5.
add
Put numbers together to find the total.Add 3 and 4 to get 7.
multiply
Add the same number many times. Find a product.3 multiplied by 4 is 12.
output
The number that comes out of a function or machine.The function adds 2 to the input to give the output.
factor
A whole number that divides another number exactly.The factors of 6 are 1, 2, 3 and 6.
highest common factor
The biggest number that divides two or more numbers exactly.The highest common factor of 12 and 18 is 6.
like terms
Terms with exactly the same letters and powers.3x and 5x are like terms.
expression
Numbers and letters joined by operations, with no equals sign.3x plus 2 is an expression.
common factor
A factor that two or more numbers share.2 is a common factor of 6 and 8.

Preview You are reading the start of this lesson. The rest opens with a plan. See plans Already paid? Sign in

Warm-up

Three quick ones from earlier work. Try each in your head or on paper before you open the answer.

  1. From Unit 3, lesson 2, letters and expressions. Work out 3n + 5 when n = 9.
    Answer32. 3 × 9 = 27, then 27 + 5.
  2. From Unit 3, lesson 4, collecting like terms. Simplify 4a + 3 + 2a.
    Answer6a + 3. 4a and 2a are like terms; the 3 is on its own.
  3. From Unit 1, factors and multiples. What is the greatest common factor (GCF) of 12 and 18?
    Answer6. The factors of 12 are 1, 2, 3, 4, 6, 12 and the factors of 18 are 1, 2, 3, 6, 9, 18.
Words used in this lesson
function machine
a rule that turns each input into one output. For example: multiply by 4, then add 3.
input
the number that goes in. For example: 2 in the machine multiply by 4 then add 3.
output
the number that comes out. For example: 11, when 2 goes in.
rule
what the machine does, written as an expression. For example: 4x + 3.
inverse
the step that undoes another. For example: subtract 3 undoes add 3.
order
which step comes first. For example: multiply then add is not add then multiply.

A rule with an input and an output

A kiosk in Dhaka sells mobile data: 40 taka for every gigabyte, plus a fixed 20 taka fee. Whatever number of gigabytes you ask for, the kiosk follows the same steps. A function machine is the maths picture of this. A number goes in, the machine does its steps in order, and one number comes out. The rule is the expression for what the machine does to the input.

Predict first: the machine multiplies by 4 and then adds 3. What comes out when 5 goes in? Write your answer. The figure opens on input 2; set the input to 5 to check, then try swapping the order of the steps.

output = 4x + 3input2× 4after step 18+ 3output112 × 4 = 8, then 8 + 3 = 11
8after the first step
11output

Input 2: × 4 gives 8, then + 3 gives 11.

Show me the steps
  1. Input 5 with × 4 then + 3: 5 × 4 = 20, then 20 + 3 = 23. The rule is 4x + 3.
  2. The same machine, input 0: 0 × 4 = 0, then 0 + 3 = 3. The output is just the second step.
  3. Input 12: 12 × 4 = 48, then 48 + 3 = 51.
  4. Swap the steps, + 3 then × 4, with input 5: 5 + 3 = 8, then 8 × 4 = 32. A different machine with a different rule, 4(x + 3).
  5. × 6 then + 9 with input 12: 12 × 6 = 72, then 72 + 9 = 81.

The order of the steps is part of the machine. Multiply by 4 then add 3 has the rule 4x + 3. Add 3 then multiply by 4 has the rule 4(x + 3). Same two steps, different machine.

To run a machine backwards, undo each step with its inverse (add and subtract undo each other, and so do multiply and divide), and undo them in the reverse order. The last step done is the first step undone.

A position rule is a machine too: n goes in, × 4, then + 1, and 4n + 1 comes out. “Which term is 41?” runs that machine backwards.

Read what Keith says

The order of the steps is part of the machine. Multiply by four then add three gives four x plus three. Add three then multiply by four gives four times the bracket x plus three. Same two steps, different machine. To run a machine backwards, undo each step with its inverse, in the reverse order. The last step done is the first step undone. Try it with a number machine of your own, then run it backwards.

The rest of this lesson is in the full course

Still to come in this lesson:

  • Finding the input
  • Worked example: forwards and backwards
  • Check before you go on
  • Your turn

In the full lesson every figure moves as you drag it, and every answer you type is checked, with a note on what each wrong answer means.

Years 7 to 11 plan$59Every lesson from Year 7 to Year 11, so the refresher links always open, and every Year 7 to 11 revision pack, for the whole family. $59 for 12 months or $99 for 2 years.
IB Diploma plan$99Every lesson from Year 7 to the IB Diploma, AA and AI, SL and HL, for the whole family. $99 for 12 months or $149 for 2 years.

One plan opens every Diploma lesson, AA and AI, SL and HL, for the whole family.

One payment. Nothing renews. Full refund within 30 days. Prices are in US$; Gumroad shows your local currency at checkout. Pay by card on Gumroad, then come back here and type the email you paid with: we email you a sign-in link. For a refund, reply to your Gumroad receipt or email hello@ksmaths.com.

Try a free sample lesson in every unit, and the whole Skill Tree. See this unit.

Already have a revision pack or the Years 7 to 11 plan? Move up and the unused part of what you paid comes off.

Teaching students who need extra support? Student codes for 5, 10 or 30 students.

Year 7 revision pack, $19BuyPlan $59