Math 6 · 8.F.A.1 · F.IF.A.1

Functions as input-output rules

If you know what goes in, when can you be certain what comes out?

Where you are 3 in Definition of a function

Why this exists

A great deal of mathematics is about one quantity settling another. The number of tickets you buy settles what you pay. The length of a square’s side settles its area. The number of hours a candle has burned settles how tall it still is.

“Settles” is doing real work in those sentences. It means that once you know the first number, there is nothing left to wonder about the second: no choice, no luck, no “it depends”. Plenty of pairings do not work like that. Knowing how many hours someone studied does not settle their test score, and knowing a person’s age does not settle their height. The idea of a function exists to say exactly which pairings settle the answer and which do not, so that when a pairing does, you can rely on it.

The simplest picture of a function is a machine. Two more ideas make the picture usable. The instruction the machine follows is its rule, and an instruction has to meet a standard of its own before it can be the rule of a function. And one function can be written down in four different ways, as words, a table, a graph or an equation, each showing something the others hide. This lesson covers all three: the machine, the rule of a function, and the four ways to show a function.

Definition

Picture a machine with a slot on one side and a chute on the other. You drop an input into the slot, the machine does something to it, and an output comes out of the chute. What the machine does is its rule. You are told which inputs the machine accepts; call them its allowed inputs.

The machine is a function when every allowed input produces exactly one output.

“Exactly one” has two halves, and a function needs both.

  • At least one. Every allowed input gets an output. The machine never jams on one of its own inputs.
  • At most one. No allowed input ever gets two different outputs, whether both at once or on two different runs. Feed in the same input on Monday and on Friday and the same output comes out.

Two things are not required.

  • Different inputs do not need different outputs. Two inputs may come out the same.
  • Not every number has to come out. Some outputs may never appear, whatever you feed in.

Put in one sentence: a function is a rule that assigns to each allowed input exactly one output. That sentence, with “allowed” kept in it, is the definition of a function that everything else about functions builds on.

The rule of a function

The rule of a function is the instruction that turns each allowed input into its output. It is what is written inside the machine, and it can be given in three forms.

  • In words, such as “double the input, then add 1”.
  • In symbols, as an expression in a letter that stands for the input, here 2x + 1. To run the rule, put the input in place of the letter and work the expression out.
  • As a table, listing every allowed input with its output beside it. This form works only when there are few enough allowed inputs to list them all.

An instruction is the rule of a function only when it is

  • complete: it says what to do with every allowed input, and
  • definite: it leaves no choice, so the same input always ends at the same output.

These are the “at least one” and “at most one” halves of the definition, said about the instruction instead of about its results. “Add 7” is complete and definite. “Output any number bigger than the input” is complete but not definite. For a machine that accepts every whole number, “if the input is even, halve it” is definite but not complete: it says nothing about 3.

A rule may be split into cases, such as “if the input is even, halve it; if it is odd, add 1”. The results below say when an instruction in cases is still one rule.

Four ways to show a function

When the inputs and outputs are numbers, one function can be shown in four standard ways, called its representations.

  • Words: a sentence giving the rule and saying what the input and output mean, with their units and the inputs that are allowed.
  • A table: rows of inputs, each with its output beside it.
  • A graph: each input and its output plotted as one point on the coordinate plane, input across and output up. Input 2 with output 5 is the point (2, 5).
  • An equation: the output set equal to an expression in the input, usually written with x for the input and y for the output, as in y = 2x + 1.

All four describe one and the same pairing of inputs with outputs. Moving from one to another changes how the function is shown, never which function it is.

Intuition

4 input 9 output double, then add 1
Figure 1One run of a machine. The input goes in, the rule acts on it, and one output comes out.

In Figure 1 the rule is to double the input and then add 1. Drop in 4, the machine doubles it to 8, adds 1, and 9 comes out. Drop in 4 again tomorrow and 9 comes out again. That is the whole point: the output is determined by the input.

A vending machine is the everyday version. You press a button (the input) and a snack drops out (the output). Two different buttons may both give a bottle of water, and nobody minds; the machine is working. But if pressing one button gave you water one time and an apple the next, you would say the machine was not working properly, because the button no longer tells you what you will get. A function is a machine that “works properly” in exactly that sense.

From outside you see only what goes in and what comes out, and that is all the definition asks about. What happens inside does not matter, as long as each allowed input always leads to one output.

The rule of a function

5 input 11 output a formula
3x - 4
2 input 5 output a table in out 1 5 2 5 3 8 seven input 5 output a description count the letters
Figure 2The same machine picture with three different insides. All three are functions.

Figure 2 shows the three forms a rule can take, each written inside a machine: symbols, as in 3x - 4; a table; and words, as in “count the letters”. From outside the three machines look alike, and the test for being a function is the same for each.

A good way to test an instruction is to hand it to two people who cannot talk to each other, give them both the same allowed input, and ask whether they must come back with the same output. “Double it, then add 1” passes: there is nothing for them to disagree about. “Name a factor of the input” fails, because for the input 12 one person may say 3 and the other 4, and both have followed the instruction. An instruction that passes this test for every allowed input, and never leaves them stuck, is the rule of a function.

Four ways to show a function

words A 20 cm candle burns down 2 cm every hour until it is gone, after 10 hours. a table
x\ \text{(hours)}
y\ \text{(cm)}
0 20 1 18 2 16 3 14 4 12 a graph x y 2 4 6 8 10 5 10 15 20 0 an equation
y = 20 - 2x
Figure 3One function shown four ways. Each panel makes something easy to see that the others hide.

Figure 3 shows one function in all four ways. A candle 20 cm tall burns down 2 cm every hour. The input x is the number of hours it has burned, and the output y is its height in centimeters. Each panel shows something the others hide.

  • The words carry the meaning: what x and y measure, in which units, and that the candle lasts only 10 hours, so the allowed inputs run from 0 to 10.
  • The table gives exact pairs at a glance with no working: after 3 hours the candle is 14 cm tall. But it lists only five inputs and says nothing about 3.5 hours.
  • The graph shows the shape all at once. Its points lie on a straight line, so the height falls steadily, and the line meets the bottom axis at 10 hours, when the candle is gone. A value read off a graph is only as exact as its grid.
  • The equation y = 20 - 2x gives the exact output for any input in one line of arithmetic: after 3.5 hours the height is 20 - 7 = 13 cm. But it knows nothing about candles. It will happily say that after 12 hours the height is 20 - 24 = -4 cm, which the words rule out.

None of the four is “the real function”. The function is the pairing itself, and each representation is a different window onto it.

Results

Same input, same output. If a machine is a function, then an input it has already taken will always give the output it gave before. One run tells you the answer for that input forever.

Two inputs may share an output. A function can send different inputs to the same output. A machine that squares its input sends 3 and -3 both to 9, and it is still a function.

One disagreement settles it; agreement never does. If a record of runs shows the same input giving two different outputs, the machine is not a function. If the record shows no such pair, that does not prove the machine is a function. It shows only that no clash has turned up yet.

The function is the pairing, not the working. Two machines that accept the same inputs and give the same output for every one of them are the same function, however differently they are built inside.

The rule of a function

A rule must be complete and definite. An instruction is the rule of a function exactly when it gives every allowed input an output and leaves no choice about which one.

A rule in cases is one rule. An instruction split into cases is the rule of a function when the cases between them cover every allowed input and no input lies in two cases that give it different outputs. Cases that do not overlap are the simplest way to be sure.

The order of the steps is part of the rule. The same steps in a different order can give a different function: “add 3, then double” and “double, then add 3” differ at 0 (Example 6). Swapping the order and changing a step to make up for it may give back the same function, as “double, then add 6” does in Example 6, or may not, as Exercise 19 shows. Only working out the rules decides which.

Four ways to show a function

An equation gives a table and a graph. Putting chosen inputs into the equation gives rows of a table, and plotting each row as a point gives points of the graph.

A table or a graph gives an equation only as a fit. An equation found from some rows of a table or some points of a graph fits those pairs. It is the function’s rule only when the table or graph shows every allowed input, or when the rule is known some other way.

On the graph of a function, no point sits directly above another. A graph shows y as a function of x exactly when no two of its points share an input, that is, when no up-and-down line meets it more than once. This is the vertical line test.

Why it is true

Same input, same output is the “at most one” half of the definition read as a promise about time. If the input 4 could give 9 today and something else tomorrow, then 4 would have two outputs, and the machine would not be a function.

Two inputs may share an output because the definition only ever talks about one input at a time. It asks, for each input, “how many outputs does this input get?” Whether some other input gets the same output is a question it never asks.

One disagreement settles it because a single input with two different outputs is exactly what the definition forbids, so one such pair is enough to break it. The other direction fails because a record is a list of the runs that were made. A machine that accepts infinitely many inputs cannot be tested on all of them, and even an input already tried could, for a machine that is not a function, come out differently on the next run. Only knowing the rule itself, not a list of its results, can show that a machine is a function.

The pairing, not the working. Everything the definition mentions is which inputs are allowed and which output each one gets. It never mentions how the output is found. So two machines that agree on all of that satisfy the definition in exactly the same way, and there is nothing left by which to tell them apart. Worked Example 6 shows two different-looking rules that turn out to be one function.

The rule of a function

Complete and definite. A function needs every allowed input to have at least one output and at most one. A complete instruction produces at least one output for each allowed input, and a definite one can never produce two. An instruction that fails either test breaks the matching half of the definition, and one that passes both meets the whole of it.

Cases. If every allowed input lies in some case, every input gets an output, which is “at least one”. If no input lies in two cases that disagree, no input gets two outputs, which is “at most one”. Cases that do not overlap meet the second condition automatically, since no input lies in two of them.

Order. A rule is judged only by the output it gives each input, so by “the pairing, not the working” two rules are the same function exactly when they agree on every allowed input. Swapping “add 3” and “double” changes the output for 0 from 6 to 3, so there the order matters. Whether a changed step can make up for a swap depends on the steps: doubling a sum doubles each part, so “add 3, then double” agrees with “double, then add 6” for every input, while squaring a sum does not square each part, so “add 5, then square” differs from “square, then add 25”.

Four ways to show a function

Equation to table and graph. An equation that sets y equal to an expression in x works out to exactly one y for each allowed x. That pair is a row of the table, and the point (x, y) is by definition a point of the graph.

Table or graph to equation. A table or graph that leaves out some allowed inputs says nothing about them. Example 5 already showed that a lookup table can agree with an equation on every listed row and differ anywhere else. Only a representation that covers every allowed input, or knowledge of the rule itself, closes that gap.

No point directly above another. Two points straight above each other are at the same position across, so they have the same input, and at different heights, so they have different outputs. That is one input with two outputs, which the definition forbids. In the other direction, if no two points share an input, each input on the graph has exactly one point and so exactly one output. An up-and-down line through the input a meets every point whose input is a, so “no line meets the graph twice” says the same thing.

Worked examples

Example 1

Running a machine

A machine multiplies its input by 3 and then subtracts 4. Find the output for each input: 5, 0, -2 and \displaystyle \frac{1}{2}.

Solution

Apply the rule in the order it is written, first the multiplying and then the subtracting.

For 5: 3 \times 5 = 15, and 15 - 4 = 11. The output is 11.

For 0: 3 \times 0 = 0, and 0 - 4 = -4. The output is -4.

For -2: 3 \times (-2) = -6, and -6 - 4 = -10. The output is -10.

For \displaystyle \frac{1}{2}:

3 \times \frac{1}{2} = \frac{3}{2}, \qquad \frac{3}{2} - 4 = \frac{3}{2} - \frac{8}{2} = -\frac{5}{2}.

The output is \displaystyle -\frac{5}{2}.

Each input produced one output, and the rule leaves no choice at any step, so running it again on any of these inputs gives the same answers. If we write x for the input, the rule is the expression 3x - 4, and finding an output is evaluating that expression.

Example 2

Working back to the input

The same machine, which multiplies by 3 and then subtracts 4, produces the output 17. What was the input? Could a different input also have produced 17?

Solution

The last thing the machine did was subtract 4. Just before that, the number must have been 17 + 4 = 21. The step before that was multiplying by 3, so the input was 21 \div 3 = 7.

Check. 3 \times 7 - 4 = 21 - 4 = 17.

No other input gives 17. Suppose two inputs a and b both gave 17. Then 3a - 4 = 3b - 4. Adding 4 to both sides gives 3a = 3b, and dividing by 3 gives a = b. So they were the same input all along, and 7 is the only one.

For this machine, working backwards gives one answer. That is a feature of this particular rule, not of functions in general, as the next example shows.

Example 3

Two inputs, one output

A machine squares its input: it multiplies the input by itself. It accepts every number. Which inputs give the output 9? Which give 0? Which give -4?

Solution

Output 9: 3 \times 3 = 9, and also (-3) \times (-3) = 9, because a negative times a negative is positive. No other number works: a number between -3 and 3 has a square less than 9, and a number further from 0 than 3 has a square greater than 9. So the inputs are 3 and -3.

Output 0: only 0, since 0 \times 0 = 0 and any other number squared is positive.

Output -4: no input at all. A positive number squared is positive, a negative number squared is positive, and 0 squared is 0. Nothing squares to a negative number.

The squaring machine is still a function. Each input gets exactly one output: 3 gives 9 and only 9, and -3 gives 9 and only 9. That two inputs share an output is allowed, and so is an output, like -4, that nothing ever produces.

Example 4

Reading a record of runs

Two mystery machines were each run five times. Here are the records.

Machine A inputMachine A output
25
49
25
715
48
Machine B inputMachine B output
13
68
-13
68
02

What can you say about each machine?

Solution

Look for an input that appears more than once, and compare its outputs.

In Machine A, the input 2 appears twice, both times with output 5. That is fine. The input 4 also appears twice, once with output 9 and once with output 8. One input has given two different outputs, so Machine A is not a function. One such pair is all it takes.

In Machine B, the only repeated input is 6, and both times it gave 8. The inputs 1 and -1 both gave 3, but those are two different inputs sharing an output, which a function may do. So nothing in this record rules Machine B out. But five runs cannot show what every other input does, or what 6 might do on a sixth run. The honest conclusion is that Machine B may be a function; this record cannot prove it.

Example 5

Finding a rule that fits

A machine was fed five inputs:

InputOutput
0-5
1-2
21
47
-1-8

Find a rule that fits every row, and use it to predict the output for 10.

Solution

Suppose the rule is of the kind “multiply by some number, then add or subtract some number”, and start with the input 0. Multiplying 0 by anything gives 0, so the output for 0 is just the amount added or subtracted at the end. That output is -5, which suggests the rule ends by subtracting 5.

Next, watch how the output changes as the input goes up by 1. From input 0 to 1 the output goes from -5 to -2, up 3. From 1 to 2 it goes from -2 to 1, up 3 again. Each step of 1 in the input adds 3 to the output, which is what multiplying the input by 3 does.

So try multiplying by 3 and then subtracting 5, which is the rule 3x - 5. Test it on every row, not just the ones used to find it:

\begin{aligned} 3(0) - 5 &= -5 \\ 3(1) - 5 &= -2 \\ 3(2) - 5 &= 1 \\ 3(4) - 5 &= 7 \\ 3(-1) - 5 &= -8 \end{aligned}

All five match. The prediction for 10 is 3(10) - 5 = 30 - 5 = 25.

The word “predict” matters. A machine whose inside is a lookup table could agree with {3x - 5} on these five inputs and give anything at all for 10. A rule that fits a record is a good guess; it becomes a fact only once you know the machine’s rule.

Example 6

Two recipes, one function

Machine P adds 3 to its input and then doubles. Machine Q doubles its input and then adds 6. Machine R doubles its input and then adds 3. All three accept every number. Which of them are the same function?

Solution

Try a few inputs first.

InputP outputQ outputR output
0663
5161613
-4-2-2-5

R already differs from P at the input 0, so R is a different function. A single input where two machines disagree is enough.

P and Q agree on all three inputs, but as with a record of runs, agreeing on a few inputs proves nothing about the rest. So look at the rules themselves. Write x for the input. P adds 3 to get x + 3 and then doubles, giving 2(x + 3). Doubling a sum doubles each part of it, by the distributive property:

2(x + 3) = 2x + 6

and 2x + 6 is exactly Q’s rule. So for every input whatsoever, P and Q give the same output. They accept the same inputs, so they are the same function, built two different ways.

Example 7

Pinning down one output

A machine accepts 0 and every positive number. Its instruction is “output a number whose square is the input”. Is this machine a function? If not, how can the instruction be changed so that it is one? And why is -4 left off the list of allowed inputs?

Solution

Feed in 9. Both 3 and -3 square to 9, so both fit the instruction. The instruction does not say which one comes out, so the input 9 does not have exactly one output. As written, this machine is not a function. The same thing happens for every positive input.

Change the instruction to “output the number that is 0 or positive and whose square is the input”. Now 9 gives 3 and only 3, 0 gives 0, and every positive input gives exactly one output, since of its two square roots exactly one is positive. The changed machine is a function. Its output is called the principal square root of the input.

The input -4 cannot be allowed. No number squares to a negative number (Example 3), so neither instruction produces anything for -4, and a function must give every allowed input an output. Leaving -4 off the list is not a flaw in the machine. It is part of saying what the machine is.

Example 8

Writing a rule in symbols

Write each rule in symbols, using x for the input, and find its output for the input 7.

  • (a) Subtract 3 from the input, then multiply by 5.
  • (b) Multiply the input by 5, then subtract 3.
  • (c) Subtract the input from 3.

Then write the rule \displaystyle \frac{x}{2} + 4 in words and find its output for 7.

Solution

(a) The first step acts on the input and gives x - 3. The second step multiplies all of that by 5, so the whole of x - 3 goes in brackets: 5(x - 3). For 7: 5(7 - 3) = 5 \times 4 = 20.

(b) Now the multiplying comes first and gives 5x, and the subtracting acts on that: 5x - 3. No brackets are needed, because multiplying is done before subtracting anyway. For 7: 5 \times 7 - 3 = 35 - 3 = 32.

Rules (a) and (b) use the same two steps and give 20 and 32 for the same input, so they are different rules.

(c) “Subtract the input from 3” means start with 3 and take the input away: 3 - x. It is not x - 3, which subtracts 3 from the input. For 7 the two give 3 - 7 = -4 and 7 - 3 = 4. Phrases like this one, where the words name the two numbers in the opposite order to the symbols, are where translating words into expressions needs the most care.

The rule \displaystyle \frac{x}{2} + 4 divides the input by 2 first, since the fraction bar reaches only over x, and then adds 4. In words: “halve the input, then add 4”. For 7: \displaystyle \frac{7}{2} + 4 = 3.5 + 4 = 7.5. Compare \displaystyle \frac{x + 4}{2}, which says “add 4, then halve” and gives \displaystyle \frac{11}{2} = 5.5 for the same input.

Example 9

Is this instruction a rule?

A machine accepts every whole number 0, 1, 2, 3, \ldots Decide whether each instruction is the rule of a function.

  • (a) If the input is even, halve it; if it is odd, add 1.
  • (b) If the input is more than 5, subtract 5; if it is less than 10, add 5.
  • (c) If the input is more than 5, subtract 5; if it is less than 5, add 5.
Solution

(a) Every whole number is either even or odd, and none is both. So every input falls into exactly one case, and each case leaves no choice. The instruction is complete and definite: it is a rule. For example 8 gives 4, 7 gives 8, and 0, which is even, gives 0.

(b) Try an input that meets both conditions, such as 7. It is more than 5, so the first case says 7 - 5 = 2. It is also less than 10, so the second case says 7 + 5 = 12. The input 7 has two outputs, so the instruction is not definite and is not a rule. Every input from 6 to 9 has the same trouble.

(c) Now the cases do not overlap, but try 5 itself. It is not more than 5 and not less than 5, so neither case applies, and the instruction gives 5 no output. It is not complete, so it is not a rule for this machine. There are two ways to mend it: change a condition so that it covers 5, say “if the input is 5 or more, subtract 5”, which sends 5 to 0; or take 5 off the list of allowed inputs.

Example 10

One rule in words, symbols and a table

A club orders T-shirts at 8 dollars each plus a 10 dollar delivery charge, and it can order from 1 to 5 shirts. Write the rule of the cost function in symbols and as a table. Someone suggests the rule 10x + 8 instead. Is that the same function?

Solution

The input x is the number of shirts and the output is the cost in dollars. At 8 dollars each, x shirts cost 8x dollars, and the delivery adds 10, so the rule is 8x + 10.

Only five inputs are allowed, so the whole rule fits in a table.

ShirtsCost (dollars)
118
226
334
442
550

Each row is 8x + 10 worked out, for example 8 \times 3 + 10 = 34. Because this table lists every allowed input, it is not a sample of the function but the whole of it: the words, the symbols and the table are three forms of one rule.

Now test the suggested rule. For the input 1 it gives 10 \times 1 + 8 = 18, which matches. For 2 it gives 10 \times 2 + 8 = 28, not 26. One input where the two disagree is enough, so 10x + 8 is a different function. The input 1 hid the difference, because there both rules just add 8 and 10.

Example 11

Choosing a representation

Use the candle function of Figure 3, with height y cm after x hours. Answer each question, and say which of the four representations answers it most directly.

  • (a) How tall is the candle after 2 hours?
  • (b) How tall is it after 4.5 hours?
  • (c) When is it 5 cm tall?
  • (d) Does the height fall by the same amount every hour?
  • (e) How tall is it after 15 hours?
Solution

(a) The table has a row for 2: the height is 16 cm. Nothing needs working out.

(b) The table has no row for 4.5, and the graph can be read only roughly between grid lines. The equation gives the answer exactly: y = 20 - 2(4.5) = 20 - 9 = 11, so the height is 11 cm.

(c) Here the output is known and the input is wanted. Set the equation’s output to 5 and work back: 20 - 2x = 5, so 2x = 15 and x = 7.5. The candle is 5 cm tall after 7.5 hours. Check: 20 - 2(7.5) = 20 - 15 = 5.

(d) The graph answers this at a glance: its points lie on a straight line, so every hour lowers the height by the same amount. The table agrees for the hours it lists, falling by 2 from row to row, and the words say it outright.

(e) The equation gives 20 - 2(15) = -10, but a candle cannot be -10 cm tall. Only the words settle it: the candle is gone after 10 hours, so 15 is not an allowed input, and the question has no answer within this function. The equation alone would have given a wrong answer with no warning.

Example 12

From a graph to the other three

x y 1 2 3 4 5 6 7 4 8 12 16 20 24 28 32 0 time (minutes) water (liters)
Figure 4Water in a tank during the first six minutes after the tap is turned on.

Figure 4 shows the water in a tank, in liters, during the first 6 minutes after a tap is turned on. Make a table, find an equation, describe the function in words, and find when the tank holds 40 liters if the water keeps flowing the same way.

Solution

Read the dots. At 0 minutes the tank holds 8 liters, and at 1, 2, 3, 4, 5 and 6 minutes it holds 12, 16, 20, 24, 28 and 32 liters.

Minutes xLiters y
08
112
216
320
424
528
632

Each minute adds 4 liters, and at 0 minutes there are already 8, so try y = 4x + 8. Test it on every row, not just the ones used to find it: 4(0) + 8 = 8, 4(1) + 8 = 12, and so on up to 4(6) + 8 = 32. All seven rows fit, and the drawn line, rising steadily between the dots, agrees with it too.

In words: the tank starts with 8 liters in it, and the tap adds 4 liters every minute.

For 40 liters the graph is no help, since it stops at 32. The equation is: 4x + 8 = 40, so 4x = 32 and x = 8. The tank holds 40 liters after 8 minutes. Check: 4(8) + 8 = 40. That answer leans on “if the water keeps flowing the same way”. The graph shows only the first 6 minutes, and an equation found from it is a fit to what was seen, as in Example 5.

Example 13

Spotting a non-function in each form

x y 1 2 3 4 1 2 3 4 0 A x y 1 2 3 4 1 2 3 4 0 B x y 1 2 3 4 1 2 3 4 0 C
Figure 5Three graphs of dots. Only one of them has two dots one above the other.

Decide in each case whether y is a function of x.

  • (a) The three graphs A, B and C of Figure 5.
  • (b) The equations y = x^2 and y^2 = x, for inputs x that are 0 or positive.
  • (c) The words “the input is an age in whole years, and the output is the height of a child of that age”.
Solution

(a) Look for two dots one directly above the other. In graph A every input from 0 to 4 has one dot, so A shows a function. In graph B the input 2 has two dots, at (2, 1) and (2, 3): one input with two outputs, so B does not. In graph C every dot is at the same height, 3. That is five inputs sharing one output, which is allowed, so C shows a function, one whose output is always 3.

(b) For y = x^2, each input is squared, and squaring gives one number: a function. For y^2 = x, try the input 9. Both y = 3 and y = -3 make y^2 = 9, so the input 9 has two outputs, and y^2 = x does not give y as a function of x. An equation shows a function only when it pins down one output for each input, as Example 7 did by choosing the root that is 0 or positive.

(c) Many children of the same age have different heights, so an input such as 8 years has many outputs: not a function. The words “the height of one particular child on each birthday” would describe a function, since that child had exactly one height on each birthday.

Boundaries

The inside need not be a calculation. The machine picture can make a function look like arithmetic, but two of the three machines in Figure 2 do none. The table machine has no formula at all: it accepts only the inputs 1, 2 and 3 and looks each one up, and it is a function because each of them is listed once. (The inputs 1 and 2 share the output 5, which is allowed.) The third machine counts letters and turns the word “seven” into 5.

Inputs and outputs need not be numbers. Buttons, words and people can go in, and snacks, numbers and dates can come out. Most functions in algebra use numbers, which is why the picture is usually drawn with them.

Not every function has all four representations. The “count the letters” machine takes words, so it has no graph on a number grid and no equation in x. The number of days in each month, taken by month number, has words, a table and a graph of twelve dots, but no tidy formula. The four ways belong to functions whose inputs and outputs are numbers, and even then, as with the months, an equation may be missing.

Some inputs cannot go in. The machine “divide 12 by the input” can take 4 and give 3, and can take -6 and give -2, but it cannot take 0, because dividing by 0 gives no number. A machine that counts the cost of theater tickets can take 3 tickets, but not 2.5 of a ticket. Neither machine is broken. The inputs it cannot take are simply not among its allowed inputs, and a full description of a function says which inputs are allowed. That collection, and the collection of outputs that actually come out, are the subject of domain and range.

An equation can run past its function. As with the candle at 12 hours, an equation happily gives outputs for inputs the situation does not allow. The allowed inputs travel with the words, or with a note beside the equation such as “for 0 \le x \le 10”, never with the formula itself.

Not every equation in x and y is a function. The equation y^2 = x pairs the input 9 with both 3 and -3 (Example 13). Whether an equation gives y as a function of x has to be checked, like any other instruction.

A function has no memory and no mood. The picture of a machine suggests something that runs in time and might wear out or change. A function does not. A ticket dispenser that gives out 1, then 2, then 3 each time its one button is pressed is a real machine, but its output is not a function of the button pressed, since the same input gives a different output every time.

Where this goes next

The machine is a picture; the next lessons turn it into tools. Writing a sentence as a rule in symbols, as in Example 8, is translating words into expressions, and building a whole function from a description of a situation, as in Example 10 and Exercise 28, is modeling from a verbal description. A rule split into cases, as in Example 9, grows into piecewise functions. Drawing an arrow from each input to its output gives a mapping diagram, and reading a list of pairs for a repeated input with two outputs, as in Example 4, becomes the skill of deciding whether a table is a function.

Giving the machine a name, say f, lets you write the output of f for the input 4 in a few symbols, and that is function notation. Plotting each input against its output, as Figure 3 does for the candle, draws the machine as a picture on a grid, the graph of the function. Plotting a function from a table and finding a linear function from its graph, as in Example 12, are the two directions of that move, and the vertical line test turns the check of Example 13 into a habit.

Further on, the machine picture keeps paying. Feeding one machine’s output straight into a second machine is composition. Running a machine backwards, as in Example 2, is the idea behind inverse functions, and Example 3 already shows when that cannot work: if two inputs share an output, the output alone cannot tell you which one went in.

Exercises

Running a machine

  1. A machine adds 7 to its input. Find the outputs for the inputs 3, -10 and 2.5.
  2. A machine multiplies its input by 4 and then adds 1. Find the outputs for the inputs 0, 6 and -3.
  3. A machine subtracts 1 from its input and then divides by 2. Find the outputs for the inputs 9, 0 and 4.
  4. A machine squares its input and then subtracts 2. Find the outputs for the inputs 3, -3 and 0.
  5. A machine’s rule is the formula 10 - 2x, where x stands for the input. Find the outputs for the inputs 3, 5 and -1.

Working back to the input

  1. A machine multiplies its input by 5 and then subtracts 2. It produced the output 38. What was the input?
  2. A machine adds 4 to its input and then multiplies by 3. It produced the output 0. What was the input?
  3. A machine squares its input. Which inputs give the output 49? Which give 0? Which give -1?

Is it a function?

  1. A machine was run five times: input 1 gave 4, input 2 gave 6, input 3 gave 8, input 1 gave 4, and input 5 gave 12. What can you conclude?
  2. A machine was run four times: input 3 gave 10, input 0 gave 1, input 5 gave 16, and input 3 gave -8. What can you conclude?
  3. A machine was run five times: input -2 gave 4, input 2 gave 4, input 0 gave 0, input 3 gave 9, and input -2 gave 4. Does the fact that -2 and 2 both gave 4 stop it from being a function?
  4. At a vending machine, button A1 gives water and button B2 also gives water. Pressing button C3 gave juice one time and an apple the next time. Is the snack a function of the button pressed?
  5. A machine takes a whole number of theater tickets and outputs the total cost in dollars, at 6 dollars a ticket. Is it a function? What is the output for 4 tickets, and which input gives the output 42?
  6. A machine’s instruction is “output any number bigger than the input”. Is it a function?
  7. One machine takes a person and outputs that person’s date of birth. Another takes a date and outputs a person born on that date. Which of them is a function?

Finding a rule that fits

  1. A machine gave these outputs: 0 gave 3, 1 gave 5, 2 gave 7, 3 gave 9. Find a rule that fits every run, and use it to predict the output for 10.
  2. A machine gave these outputs: 2 gave 0, 5 gave 3, -1 gave -3, 0 gave -2. Find a rule that fits every run, and use it to predict the output for -10.

Same function or not?

  1. One machine multiplies its input by 4 and then subtracts 8. Another subtracts 2 from its input and then multiplies by 4. Both accept every number. Are they the same function?
  2. One machine adds 5 to its input and then squares. Another squares its input and then adds 25. Both accept every number. Are they the same function?

Inputs a machine cannot take

  1. A machine divides 30 by its input. Find the outputs for 6 and -10, and name the one number it cannot take as an input.
  2. A machine outputs the number that is 0 or positive and whose square is the input. Find the outputs for 16, 0 and 2.25. Can -9 be one of its allowed inputs?

The rule of a function

  1. Write each rule in symbols, using x for the input: “multiply the input by 6, then subtract 5” and “subtract 5 from the input, then multiply by 6”. Find the output of each for the input 2.
  2. Write each rule in symbols, using x for the input: “subtract the input from 10” and “subtract 10 from the input”. Find the output of each for the input 4.
  3. Write each rule in words: \displaystyle \frac{x + 4}{3} and \displaystyle \frac{x}{3} + 4. Find the output of each for the input 5.
  4. A machine accepts only the inputs 1, 2, 3 and 4, and its whole rule is a table: 1 gives 3, 2 gives 5, 3 gives 9 and 4 gives 17. What is the output for 3? What is the output for 5?
  5. A machine accepts every whole number 0, 1, 2, \ldots Decide whether each instruction is the rule of a function: (a) “if the input is even, add 2; if it is odd, subtract 1”; (b) “if the input is less than 10, double it; if it is more than 10, halve it”; (c) “if the input is a multiple of 3, output 0; if it is a multiple of 2, output 1; otherwise output 2”. For the one that is a rule, find the outputs for 7 and 8.
  6. A machine accepts only the inputs 1, 2 and 3, and its rule is 12x + 5. Write its rule as a complete table. Is the rule 5x + 12 the same function?

Four ways to show a function

x y 1 2 3 4 5 2 4 6 8 0 P x y 1 2 3 4 5 2 4 6 8 0 Q
Figure 6Graphs P and Q, for the exercises on four ways to show a function.
  1. A tank holds 500 liters of water and drains at 25 liters a minute until it is empty. Write an equation for the liters y left after x minutes, and make a table for the inputs 0, 4, 8, 12, 16 and 20. When is the tank empty, and how much is left after 6 minutes?
  2. A function’s table is: 0 gives 4, 1 gives 7, 2 gives 10, 3 gives 13. Write an equation that fits, describe how the points of its graph lie, and use the equation to predict the output for 2.5.
  3. Graph P in Figure 6 is a straight line. Make a table from its four dots, write an equation for it, and find which input would give the output -5 if the line were carried on.
  4. Does graph Q in Figure 6 show y as a function of x? Explain using its points.
  5. For each equation, say whether it gives y as a function of x, and find every output for the input 4: y = 3 - x, y = x^2 + 1 and y^2 = x.
  6. A phone battery starts full at 100 percent and loses 8 percent each hour until it is flat. Write an equation for the charge y after x hours. What does the equation give for x = 15, and why is that not an answer? For which inputs does the equation describe the battery?
  7. For the candle of Figure 3, which representation answers each question most directly, and what is the answer? (a) The height after 1 hour. (b) The height after 6.5 hours. (c) Whether the candle ever gets taller.

Reasoning

  1. A machine gives the output 5 for every input, whatever it is. Explain why it is a function.
  2. Someone ran a machine 100 times, and every time an input was repeated, it gave the same output as before. Does that prove the machine is a function? Explain.
  3. One machine adds 3 to its input, multiplies by 2, and then subtracts 6. Another doubles its input. Both accept every number. Show that they are the same function.
  4. Explain the difference between two inputs giving one output and one input giving two outputs. Which one stops a machine from being a function, and why does the other not?
  5. Explain how one table with the inputs 1, 2 and 3 can be the whole rule of one function but only part of the record of another.
  6. Explain why a graph with two points one directly above the other cannot show y as a function of x, while a graph with two points side by side at the same height can.
Answers
  1. 10, -3 and 9.5. Add 7 to each: 3 + 7, -10 + 7, 2.5 + 7.
  2. 1, 25 and -11. For example 4 \times 6 + 1 = 25 and 4 \times (-3) + 1 = -12 + 1 = -11.
  3. 4, \displaystyle -\frac{1}{2} and \displaystyle \frac{3}{2}. For example (9 - 1) \div 2 = 4 and \displaystyle (0 - 1) \div 2 = -\frac{1}{2}.
  4. 7, 7 and -2. 3^2 - 2 = 7, (-3)^2 - 2 = 9 - 2 = 7, and 0^2 - 2 = -2. Two inputs sharing an output is allowed.
  5. 4, 0 and 12. 10 - 2(3) = 4, 10 - 2(5) = 0, and 10 - 2(-1) = 10 + 2 = 12.
  6. 8. Undo the last step first: 38 + 2 = 40, then 40 \div 5 = 8. Check: 5 \times 8 - 2 = 38.
  7. -4. Undo the multiplying: 0 \div 3 = 0, then undo the adding: 0 - 4 = -4. Check: (-4 + 4) \times 3 = 0.
  8. 7 and -7 give 49; only 0 gives 0; no input gives -1, because no number squares to a negative number.
  9. It may be a function, but the record cannot prove it. The only repeated input, 1, gave 4 both times. Doubling and then adding 2 fits all five runs, but other machines could too.
  10. It is not a function. The input 3 gave 10 once and -8 once, so one input has two outputs.
  11. No. Different inputs may share an output. The only repeated input, -2, gave 4 both times, so nothing in the record rules the machine out (though the record alone cannot prove it is a function).
  12. No. Button C3, one input, gave two different snacks. A1 and B2 sharing water is allowed.
  13. Yes: each whole number of tickets has one total cost. 4 tickets cost 6 \times 4 = 24 dollars, and the output 42 comes from 42 \div 6 = 7 tickets.
  14. No. The input 1 could give 2, or 5, or 100; the instruction does not pick one output.
  15. The first is a function: each person has exactly one date of birth. The second is not: many people share a birthday, so one date can lead to several people.
  16. Double the input and then add 3, which is the rule 2x + 3; the prediction for 10 is 23. Input 0 gives 3, and each step of 1 in the input adds 2. Check: 2(3) + 3 = 9.
  17. Subtract 2, which is the rule x - 2; the prediction for -10 is -12. Every output is 2 less than its input: 2 - 2 = 0, 5 - 2 = 3, -1 - 2 = -3, 0 - 2 = -2.
  18. Yes. With input x, the second rule gives 4(x - 2), and by the distributive property 4(x - 2) = 4x - 8, which is the first rule, for every input.
  19. No. The input 1 gives (1 + 5)^2 = 36 from the first rule but 1^2 + 25 = 26 from the second. One input where they disagree is enough.
  20. 30 \div 6 = 5 and 30 \div (-10) = -3. It cannot take 0, because dividing by 0 gives no number.
  21. 4, 0 and 1.5, since 4^2 = 16, 0^2 = 0 and 1.5^2 = 2.25, and each of these is 0 or positive. The number -4 also squares to 16, but it is negative. No: no number squares to -9, so the machine would have no output for it, and every allowed input must get one.
  22. 6x - 5 and 6(x - 5). For 2 they give 6 \times 2 - 5 = 12 - 5 = 7 and 6(2 - 5) = 6 \times (-3) = -18. The brackets record that the subtracting comes first.
  23. 10 - x and x - 10. For 4 they give 10 - 4 = 6 and 4 - 10 = -6. The first rule starts with 10 and takes the input away; the second starts with the input and takes 10 away.
  24. “Add 4 to the input, then divide by 3” and “divide the input by 3, then add 4”. For 5 they give \displaystyle \frac{5 + 4}{3} = \frac{9}{3} = 3 and \displaystyle \frac{5}{3} + 4 = \frac{17}{3}.
  25. The output for 3 is 9, read straight from the table. There is no output for 5: it is not an allowed input, and the table, being the whole rule, says nothing about it. A pattern that fits the table, such as doubling and subtracting 1 from one output to the next, would only be a guess about a different machine.
  26. Only (a) is a rule. Every whole number is even or odd and not both, so 7 gives 7 - 1 = 6 and 8 gives 8 + 2 = 10. (b) is not complete: 10 is neither less than 10 nor more than 10, so it gets no output. (c) is not definite: 6 is a multiple of 3 and of 2, so it is sent to both 0 and 1.
  27. 1 gives 17, 2 gives 29 and 3 gives 41, for example 12 \times 2 + 5 = 29. Not the same function: 5x + 12 also gives 17 for 1, but for 2 it gives 5 \times 2 + 12 = 22, not 29.
  28. y = 500 - 25x. The table’s outputs are 500, 400, 300, 200, 100 and 0 liters. The tank is empty after 20 minutes, since 500 - 25x = 0 gives x = 20. After 6 minutes, 500 - 25 \times 6 = 500 - 150 = 350 liters are left.
  29. y = 3x + 4: the output for 0 is 4, and each step of 1 in the input adds 3. The points lie on a straight line that rises 3 for each 1 across. The prediction for 2.5 is 3(2.5) + 4 = 7.5 + 4 = 11.5, only a prediction, since the table shows four inputs.
  30. 0 gives 7, 1 gives 5, 2 gives 3 and 3 gives 1. The output starts at 7 and falls 2 for each 1 across, so y = 7 - 2x. For the output -5: 7 - 2x = -5 gives 2x = 12 and x = 6, an input beyond the drawn part of the graph.
  31. No. The dots (3, 1) and (3, 5) sit one above the other, so the input 3 has two outputs. The other inputs having one dot each does not rescue it.
  32. y = 3 - x is a function, and 4 gives 3 - 4 = -1. y = x^2 + 1 is a function, and 4 gives 4^2 + 1 = 17. y^2 = x is not: the input 4 gives both 2 and -2, since 2^2 = 4 and (-2)^2 = 4.
  33. y = 100 - 8x. For x = 15 it gives 100 - 120 = -20, but a battery cannot hold -20 percent. It went flat when 100 - 8x = 0, at x = 12.5 hours, so the equation describes the battery only for 0 \le x \le 12.5.
  34. (a) The table: 18 cm. (b) The equation: 20 - 2(6.5) = 20 - 13 = 7 cm. (c) The graph: its line falls the whole way, so the candle never gets taller. The words say so too.
  35. Every allowed input gets an output, 5, and never any other, so each input has exactly one output. Many inputs sharing the output 5 is allowed.
  36. No. The record shows only the inputs that were tried. An input never tried, or a 101st run, could still give a second output for some input. Only the rule itself can prove the machine is a function.
  37. With input x the rule gives 2(x + 3) - 6 = 2x + 6 - 6 = 2x, which is double the input, for every x. Both accept every number, so they are the same function.
  38. Two inputs with one output means different inputs land on the same result, like 3 and -3 both squaring to 9; each input still has exactly one output, so the definition is met. One input with two outputs means knowing the input does not tell you the output, which breaks the “at most one” half of the definition. Only the second stops a machine from being a function.
  39. If the function’s only allowed inputs are 1, 2 and 3, the table lists every one of them with its output, so nothing is left to say: it is the whole rule, as with the shirts in Example 10. If another function accepts more inputs, say every number, the same three rows are only a record of three runs, and they say nothing about the inputs not listed (Example 5).
  40. Two points one directly above the other are at the same position across and different heights: one input with two outputs, which the definition forbids. Two points side by side at the same height have different inputs and the same output: two inputs sharing an output, which is allowed, as in graph C of Figure 5.
kg1128 · updated 2026-10-02 · CC-BY-SA-4.0