A7 - Functions as inputs and outputs

A7 - Functions as inputs and outputs

A function turns each allowed input into one output. You will read rules, calculate input-output tables and recover an input by reversing a process, checking when an input is allowed and when an output is possible.

Rules connecting inputs and outputs

A number machine multiplies an input by three and then adds two. It displays 1414. What went in? You could try numbers until one works, but understanding the rule will let you work forwards and backwards reliably.

You already know

Substitution replaces a letter with its value. In 3x+23x+2, multiplication comes before addition; 3(x+2)3(x+2) instead adds two before multiplying.

With input 44, the machine produces 3(4)+2=143(4)+2=14. We can write its rule as y=3x+2y=3x+2: xx names the input and yy names the output.

Function

A function is a rule assigning exactly one output to each allowed input. The set of allowed inputs is its domain. Different inputs may share an output; one input cannot have two different outputs under the same rule.

Read a rule in the order of its operations, then substitute into the whole expression.

Worked example 1: a positive input

Question. A rule is y=3x+2y=3x+2. Find the output when x=4x=4.

Plan. Replace xx with 44, multiply, then add.

y=3(4)+2substitute the input=12+2multiply first=14add two\begin{aligned} y&=3(4)+2 && \text{substitute the input} \\ &=12+2 && \text{multiply first} \\ &=14 && \text{add two} \end{aligned}

Why multiply first? The rule says three times the input, then two more. Adding first would calculate a different rule.

Answer. The output is 1414.

Check. 3(4+2)=183(4+2)=18 is different, confirming why the brackets and operation order matter.

The next example changes only the input's value. The rule stays exactly the same, even when the input is negative.

Worked example 2: a negative input

Question. For y=3x+2y=3x+2, find the output when x=−1x=-1.

Plan. Put the negative input in brackets and follow the original operations.

y=3(−1)+2substitute with its sign=−3+2multiply first=−1add two\begin{aligned} y&=3(-1)+2 && \text{substitute with its sign} \\ &=-3+2 && \text{multiply first} \\ &=-1 && \text{add two} \end{aligned}

Why use brackets? The input is the complete number −1-1; writing it clearly protects its sign.

Answer. The output is −1-1.

Check. Tripling a negative input gives −3-3; adding two must move it two places right, to −1-1.

The diagram shows both directions for the first input. Follow the top row now; we will use the bottom row in the final part.

[DIAGRAM: asset_name: A function rule and its reverse process; asset_slug: 1ma1_m19_reverse_machine; caption: The forward rule multiplies by three then adds two; the reverse subtracts two then divides by three.; description: Two rows show input 4 leading through multiply by 3 to 12 then add 2 to output 14, and output 14 leading through subtract 2 to 12 then divide by 3 to input 4. Blue denotes the original input, sage the original output, and clay intermediate values.]
The forward rule multiplies by three then adds two

A surprising feature of a function is that it can lose information. Squaring sends both 33 and −3-3 to 99, yet it is still a function: each individual input has only one output. The rule y=xy=\sqrt{x} gives the non-negative square root, so input 99 gives 33, rather than two outputs.

Watch out

Wrong: “A rule is not a function if two inputs have the same output.” Right: the one-output condition applies to each input. Shared outputs are allowed.

Keep the same machine and change only the input again.

Input-output tables and restrictions

A table records selected input-output pairs. Calculate each entry using the rule, rather than guessing that the last change will repeat.

For a linear rule such as y=3x+2y=3x+2, increasing the input by one always increases the output by three. A squared rule behaves differently.

Worked example 3: a table for a squared rule

Question. Find the outputs of y=x2−1y=x^2-1 for inputs −2,−1,0,1,2-2,-1,0,1,2.

Plan. Square each complete input, then subtract one.

x=−2: y=(−2)2−1=4−1=3square before subtractionx=−1: y=(−1)2−1=1−1=0keep the negative in bracketsx=0: y=02−1=−1zero inputx=1: y=12−1=0positive inputx=2: y=22−1=3last input\begin{aligned} x=-2 &: \ y=(-2)^2-1=4-1=3 && \text{square before subtraction} \\ x=-1 &: \ y=(-1)^2-1=1-1=0 && \text{keep the negative in brackets} \\ x=0 &: \ y=0^2-1=-1 && \text{zero input} \\ x=1 &: \ y=1^2-1=0 && \text{positive input} \\ x=2 &: \ y=2^2-1=3 && \text{last input} \end{aligned}

Why not continue a difference pattern? The output changes are −3,−1,1,3-3,-1,1,3, rather than one constant change.

Answer. In input order the outputs are 3,0,−1,0,33,0,-1,0,3.

Check. Opposite inputs have equal squares, so the two outer outputs match and the next pair match.

Change only the constant being subtracted, from one to four. Every output will be three lower.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account