Unit 21: Machines
Functions, in and out.
Unit 21 of 28 in Problem-solving maths for kids. Its 7 lessons are In, Then Out, What Goes In, What Comes Out, Finding the Rule, Drawing a Function, Moving a Graph About, Functions Made of Functions and Undoing a Machine — below is everything each one explains, and a question or two from it to try.
The answers are marked in the app by value — 1/2, 0.5 and 2/4 all count — and every one is re-derived by sympy before it ships.
This unit opens with a fortnight’s trial of everything — no card needed — or with a family plan, bought in the iPhone app. The first two units of every track are free for ever. Try it in the app.
⚙️ In, Then Out
A rule with one answer
A function is a machine. Put a number in, and exactly one number comes out.
We write f(x) = 3x + 1 to mean "triple it and add one". Then f(4) means put 4 in, and out comes 13.
The f(4) is not multiplication. It means "f applied to 4".
Running it backwards
You can also be told the output and asked for the input.
If f(x) = 3x + 1 and f(x) = 22, then 3x + 1 = 22, so x = 7.
That is just unit 3 again. A function question and an equation question are the same question wearing different clothes.
Try it yourself
If f(x) = 2x + 5, what is f(6)?
If f(x) = x^2 - 3, what is f(4)?
Answer them in the app
🚪 What Goes In, What Comes Out
Domain and range
The domain is everything the machine will accept. The range is everything it can produce.
f(x) = 1/x refuses zero, so its domain is every number except 0.
f(x) = x^2 accepts anything, but never gives a negative — so its range is 0 and up.
Two machines in a row
Feed the output of one machine straight into another. That is composition.
If f(x) = x + 2 and g(x) = 3x, then g(f(4)) first gives f(4) = 6, then g(6) = 18.
Order matters. The other way round, f(g(4)) is f(12) = 14. Not the same at all.
Try it yourself
Which number is not in the domain of f(x) = 1/(x - 3)?
- 3
- 0
- -3
- 1/3
What is the smallest value f(x) = x^2 + 4 can ever give?
Answer them in the app
🕵️ Finding the Rule
From a table to a formula
A machine takes 1, 2, 3, 4 and gives back 5, 7, 9, 11.
The outputs go up by 2 each time, so the rule multiplies by 2. But 2 × 1 is 2, not 5 — it is 3 too small every time.
So the rule is f(x) = 2x + 3. Find the step first, then the shift.
Equal steps mean a straight line
If the outputs go up by the same amount every time, the rule is mx + c — and that m is the gradient from unit 16.
If the steps themselves change, something else is going on. If they grow by a constant amount, there is an x^2 involved. If they multiply, it is a power.
So look at the steps before guessing the rule.
Try it yourself
A table gives 5, 7, 9, 11 for inputs 1, 2, 3, 4. Using f(x) = 2x + 3, what is f(10)?
A machine gives 4, 7, 10, 13 for inputs 1, 2, 3, 4. The rule is 3x + 1. What is f(20)?
Answer them in the app
📈 Drawing a Function
Every input-output pair is a point
Take f(x) = x^2. Feed in -2, -1, 0, 1, 2 and you get 4, 1, 0, 1, 4.
Plot each input against its output and you get the graph of the function — here, a parabola sitting on the origin.
So a graph is not a new idea. It is the whole table of a machine’s behaviour, drawn at once.
The vertical line test
How can you tell a graph belongs to a real function?
Slide an upright line across it. If that line ever hits the graph twice, the picture is not a function — one input would be giving two outputs.
A circle fails that test. A parabola passes. That is precisely the "exactly one answer" rule from lesson 1, drawn as a picture.
Try it yourself
For f(x) = x^2, what is f(-3)?
For f(x) = x^2, what is f(0)?
Answer them in the app
↕️ Moving a Graph About
Adding outside shifts it up
Take any function and add 3 to the outside: f(x) + 3.
Every output grows by 3, so the whole graph slides up by 3. Nothing about its shape changes.
That is the translation from unit 19, now written as algebra instead of drawn.
Adding inside shifts it the other way
Now put the 3 inside: f(x + 3).
The graph slides left by 3 — not right, which is what almost everybody expects.
The reason: to get the output that used to happen at x = 0, you now only need to reach x = -3. The machine gets there sooner, so the picture moves back.
Try it yourself
If f(x) = x^2, what is f(2) + 3?
If f(x) = x^2, what is f(3) + 5?
Answer them in the app
🪢 Functions Made of Functions
Chaining three machines
Composition does not stop at two. h(g(f(2))) runs three machines in a row, innermost first.
With f(x) = x + 1, g(x) = 2x and h(x) = x - 3:f(2) = 3, then g(3) = 6, then h(6) = 3.
Always work from the inside out. The brackets tell you the order, exactly as they do in arithmetic.
A function and its inverse cancel out
Feed a number into a machine, then into its inverse, and you get your number back.
f(x) = 3x + 1 and its inverse g(x) = (x - 1)/3. Then g(f(5)) is g(16), which is 5.
That is what "inverse" means, and it is also the fastest way to check whether you have found the right one.
Try it yourself
With f(x) = x + 1, g(x) = 2x and h(x) = x - 3, what is h(g(f(2)))?
With those same three, what is f(g(h(10)))?
Answer them in the app
↩️ Undoing a Machine
The inverse puts it back
The inverse of a function undoes it. If f adds 3, its inverse takes 3 away.
To find one, write y = f(x), then rearrange to get x on its own — that is unit 3 all over again.
y = 2x + 1 rearranges to x = (y - 1)/2. So the inverse is "take one away, then halve".
Not everything can be undone
f(x) = x^2 sends both 3 and -3 to 9. So if you are handed 9 and asked what went in, you cannot tell.
A function only has an inverse if no two inputs share an output. Squaring fails that test, which is exactly why sqrt(9) is defined to be 3 and not -3: somebody had to choose.
Try it yourself
If f(x) = x + 7, what is the inverse of 10?
If f(x) = 3x - 4, what is the inverse of 11?
Answer them in the app