6.05a - Inputs and outputs

6.05a - Inputs and outputs

A function turns an allowed input into one output using a fixed rule. Read and write those rules as expressions or machines, follow their operation order and work backwards to recover a missing input.

Inputs and outputs

Does “multiply by 4, then subtract 1” give the same result as “subtract 1, then multiply by 4”? Try an input of 3: the first rule gives 11 and the second gives 8. A machine diagram records the order, so it can prevent a small wording change from becoming a calculation error.

A mathematical machine does not need moving parts. It is a way to describe a fixed rule. Feed in a value, apply the instruction and read out the result. The input can be negative, zero, a fraction or a decimal when the rule permits it.

Function

A function assigns exactly one output to each allowed input. The input is the value supplied; the output is the value produced by applying the rule. The same allowed input must always give the same output.

For example, “multiply by 4, then subtract 1” turns zero into −1-1. A rule containing division must avoid division by zero: “divide 6 by the input” permits 22 and −2-2, but not zero. An excluded input has no output under that rule.

Worked example 1: following a two-step rule

Question. A machine multiplies its input by 4 and then subtracts 1. Find the output for input 3.

Plan. Apply the two operations in the stated order.

3⟶4×3=12multiply by 412⟶12−1=11subtract 1\begin{aligned} 3&\longrightarrow4\times3=12 &&\text{multiply by 4} \\ 12&\longrightarrow12-1=11 &&\text{subtract 1} \end{aligned}

Answer. The output is 11.

Check. Undoing the final subtraction gives 11+1=1211+1=12, and 12÷4=312\div4=3, the input.

Change only the sign of the input. The rule and its operation order stay fixed.

Worked example 2: a negative input

Question. The same machine receives input −3-3. Find the output.

Plan. Multiply the negative input first, then subtract one.

−3⟶4×(−3)=−12multiply by 4−12⟶−12−1=−13subtract 1\begin{aligned} -3&\longrightarrow4\times(-3)=-12 &&\text{multiply by 4} \\ -12&\longrightarrow-12-1=-13 &&\text{subtract 1} \end{aligned}

Answer. The output is −13-13.

Check. (−13+1)÷4=−12÷4=−3(-13+1)\div4=-12\div4=-3, so reversing the operations recovers the given input.

The word “input” describes a job, not a particular letter. We often use xx for the input and yy for the output, but a question may use other letters or just numbers.

Watch out

The line 4×(−3)−1=−114\times(-3)-1=-11 is wrong. After reaching −12-12, subtracting one moves further below zero to −13-13.

Follow the same rule with a new input.

Expressions as machines

An expression records the same rule compactly, but brackets decide which operations belong together.

With input xx and output yy, the rule “multiply by 4, then subtract 1” is y=4x−1y=4x-1. The rule “subtract 1, then multiply by 4” is y=4(x−1)y=4(x-1). The brackets make the whole difference the input to the multiplication.

[DIAGRAM: asset_name: The order of two operations; asset_slug: expression-machine-order; caption: Reversing the operation order changes both the expression and the output.; description: Two horizontal machine chains begin with input x. The upper chain multiplies by four, then subtracts one, reaching output four x minus one. The lower chain subtracts one, then multiplies by four, reaching output four times the bracket x minus one. Below each chain, input three gives eleven above and eight below.]
Reversing the operation order changes both the expression and the output.

Worked example 3: an expression without brackets

Question. Describe the machine for y=4x−1y=4x-1, and find the output when x=5x=5.

Plan. Read the expression using operation order, then substitute the input.

y=4×5−1substitute x=5=20−1multiply first=19subtract 1\begin{aligned} y&=4\times5-1 &&\text{substitute }x=5 \\ &=20-1 &&\text{multiply first} \\ &=19 &&\text{subtract 1} \end{aligned}

Answer. Multiply the input by 4, then subtract 1; the output is 19.

Check. Increasing the input from 3 to 5 increases 4x4x by 8. The earlier output 11 should become 11+8=1911+8=19, as it does.

Change only the bracket placement, so that subtracting one happens before multiplication.

Continue this lesson.

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

Create free account