# Explainer: Function Rules

In this explainer, we will learn how to find a function rule from a given function table.

We will start be recapping some useful vocabulary.

### Definitions: Function, Variable, Input, and Output

• A function is a rule between an input and an output which assigns exactly one output to each input.
• Variables are quantities which can change and are usually denoted by letters.
• The input of a function is the value which you substitute in.
• The output of a function is the value that results from substituting in a value for the input.

For example, the function has the variable as its input and the variable as its output.

We often think of functions as machines. We input a number into the machine and it performs a sequence of calculations with the number, and then it outputs the final answer. For example, the following machine takes any input, multiplies it by 2, and then adds 1.

So, if we input the number 1, the machine multiplies it by 2 to get 2, and then adds 1 to result in an output of 3. We can represent the work of this machine with a function. We can use to denote the input, and to denote the output. The machine will first multiply by 2 to get , and then add 1 to get . So, we can represent the same function machine as follows.

An input-output table is a useful way of recording pairs of inputs and outputs. The following input-output table shows inputs and outputs for the above function machine.

• Rule:

 Input (𝑥) Output (𝑦) 1 2 3 4 3 5 7 9

Let us look at an example of how to create an input-output table given a function.

### Example 1: Completing Input-Output Tables given a Linear Equation

Fill in the input-output table for the function .

 Input (𝑥) Output (𝑦) 0 2 4 5

An input-output table tells us the output (or the value of the dependent variable) of the function for a given input (or value of the independent variable).

Here, the input is and the output is . To find the values of (the outputs), substitute the values of (the inputs) into the function.

When the input is , substitute this into to find the output:

When the input is , substitute this into to find the output:

When the input is , substitute this into to find the output:

When the input is , substitute this into to find the output:

Hence, the finished input-output table is

 Input (𝑥) Output (𝑦) 0 2 4 5 3 5 23 28

One reason to draw input-output tables is to help us sketch the graph of the function but we will not discuss how to do this here. Instead, we will see how to identify the rule for an input-output table.

Sometimes, we can find the rule by just performing some trial and error; guessing possible functions that work for some pairs of input and output, and then testing whether this function works for the other pairs of values.

### Example 2: Finding One-Step Rules for Input-Output Tables

Find the rule for the given function table.

 Input (𝑥) Output (…) 1 4 10 9 12 18

We can start by checking whether any simple functions work and whether the rule has only one step. This step could, for example, be addition, subtraction, multiplication, division, or raising to a power. If we find that none of these one-step rules work, then we have to look for a two-step rule.

Start by considering the first input. When , the output, which we will call , is 9. There are two possible rules for this pair of input and output:

Next, we need to see if either of these functions describes all the values in the table.

When the input is , the output is 12. This means that the rule is not , because .

However, so the rule is still a possibility.

Finally, when , which is the output in the table.

Hence, we have found a function rule which relates every input value to its output. This means that the function rule is

Using trial and error can be time consuming and should not be relied upon for every question. Instead, we can often gain useful information by looking at patterns in the input and output values.

Think about our first example again. We had the following input-output table and we are going to think about how we could figure out the rule using just the information in the table.

• Rule:
 Input (𝑥) Output (𝑦) 1 2 3 4 3 5 7 9

The input values increase by 1 each time and the output values increase by 2 each time. We can say that the common difference between the output values is 2. This tells us that the first operation performed on the input was to multiply it by 2. Hence, part of the function is .

• Rule:

Since this is clearly not the only operation the function performs, we know that the rule must have at least two steps. We can add an intermediate row into our input-output table to calculate the result of multiplying the input by 2, and then compare these values to the output to see what other calculations are performed. When we do this, we see that we just have to add 1 to get from to the output.

• Rule:

Hence, our rule is which, as a function relating and , is

It is always true that if the common difference between consecutive outputs is a constant , then the function begins by multiplying the input by . Note that by “consecutive” we mean that the inputs must be consecutive integers. To gain some understanding as to why this works consider the following.

Plot the multiples of any number on a number line. We will use the multiples of 3. So, we plot the values of on the number line. Since we know that multiplication is just repeated addition, the common difference between the multiples is 3. Now, think about adding or subtracting any number from these values of . For example, we could add 2 to all of the multiples of 3. Then, the resulting numbers all follow the rule . It is important to notice that all of the numbers move by the same amount, which means that the difference between them doesn’t change.

The common difference would also stay the same if we added 4, subtracted 7, or any other number. The common difference between consectutive outputs of the functions , , , , and all other functions which add to or subtract from a multiple of 3 will always be 3.

To see this another way, think about outputs of the function . For simplicity, we will take to be 3 but this will work for any number. Consider inputting , , and into :

Each time we increase the input by 1, we add another 3 term to the output, so the output values increase by 3 each time. Hence, they have a common difference of 3.

Now, we will look at an example where we can use this.

### Example 3: Finding Linear Equations Which Describe Input-Output Tables with Consecutive Terms

Find the function rule for this table. Then calculate the two missing numbers.

 Input (𝑥) Output (𝑦) 12 13 14 15 16 76 82 88

We could guess possible rules and check to see if they work for all pairs of input and output, but it is better to first check whether the function is of the form or for some numbers and . To do this, we can check to see if the difference between the output values is always the same constant .

In fact, the difference between outputs is always 6, and since the input values are consecutive, this means that the rule is and we need to work out the value of .

To do this, compare the values of to the output values.

Notice that, to get from to the output we need to add 4. Hence, we conclude that the function rule is

Now, we can use this rule to find the missing values by substituting the values of into the function.

When the input is , substitute this into to find the output:

When the input is , substitute this into to find the output:

Hence, the completed input-output table is as follows.

• Rule:
 Input (𝑥) Output (𝑦) 12 13 14 15 16 76 82 88 94 100

We have seen how to find rules of the form by looking for a common difference. We will summarize this method below.

### How to Check If an Input-Output Table Follows a Rule of the Form 𝑦 = 𝑎𝑥 + 𝑏

Step 1: Check that the input values are consectutive integers.

Step 2: Check whether there is a common difference between successive output values.

Step 3: If the common difference is , then the function rule is .

Step 4: To find , compare the values of to the output values.

• Rule:

Remember that this method assumes that the input values are consecutive integers. We will finish by looking at an example when the input-output table does not contain input values which are consecutive.

### Example 4: Finding Linear Equations for Input-Output Tables with Non-Consecutive Terms

Find the function rule for the following input-output table.

 Input (𝑥) Output (𝑦) 1 3 5 8 11 7 11 19 31 43

The rule is a function and we have to find the calculations performed on the input to get the output . To start with, we do not even know how many operations are performed on to get .

Let us first check whether the table has a one-step rule.

Consider the first input-output pair and look at all the possibilities to get from to with one calculation. These would be

However, neither of these rules works for the other pairs of inputs and outputs. For example, when ,

So, the table does not have a one-step rule.

Next, we will check whether the table has a two-step rule like .

If this is the correct form of the rule (it might not be), then increasing the input by 1 will increase the output by , increasing the input by 2 will increase the output by , and so on. So, we need to investigate the differences between the input terms and the output terms.

At first glance, it looks like there is no common difference between the output values. However, this is because the difference between the input terms is also not constant. In fact, there are the following relationships between the input and output:

This suggests that there is a common difference between consecutive terms, following the pattern

Hence, the rule is and we can find the value of by comparing the values of to the output values in the table.

By doing this, we see that the output value is always equal to , hence the function rule is