Penerangan
What a function is
A function is a rule that takes an input, applies one or more operations, and produces an output. The defining feature is that every input gives exactly one output. If the same number is put into the rule twice, the same result must come out both times.
The rule 'multiply by 3 and then add 2' is a function. Putting in 4 gives 3 × 4 + 2 = 14, and no other output is possible for an input of 4. The set of possible inputs is often a list of numbers, but it can also be every number on a number line.
Two different inputs are allowed to give the same output. The rule 'square the number' sends both 3 and -3 to 9. This is still a function, because each input (3, or -3) has only one output. What would break the definition is an input with two outputs. The relationship 'a number and the numbers whose square is that number' is not a function, because an input of 9 would lead to both 3 and -3.
A useful test: for a function, one input leads to one output, but an output may be reached from more than one input.
Function machines, mappings and tables
A function can be shown in several equivalent ways.
- Function machine: a chain of boxes, one operation per box, read from left to right. The input enters on the left and the output leaves on the right.
- Mapping diagram: two columns of numbers with arrows from each input to its output. In a function, exactly one arrow leaves each input.
- Table of values: a row of inputs above a row of outputs.
- Algebraic rule: a formula that uses a letter for the input.
For the machine 'multiply by 3, then add 2', the outputs are:
| Input | 0 | 1 | 2 | 5 | -1 |
|---|---|---|---|---|---|
| Output | 2 | 5 | 8 | 17 | -1 |
The order of operations in the machine matters. 'Add 2, then multiply by 3' is a different function: an input of 4 gives (4 + 2) × 3 = 18, not 14. Generating an output always means carrying out the boxes in order, one at a time, as shown in the function machine figure.
Writing functions algebraically
When the input is represented by a letter such as x, the rule can be written as an expression, and the output is often named y. The machine 'multiply by 3, then add 2' becomes
y = 3x + 2
The same function can be written with function notation as f(x) = 3x + 2. The symbol f(x) is read as 'f of x' and means 'the output of the function f when the input is x'. It does not mean f multiplied by x. The value f(4) means the output when x = 4, so f(4) = 3 × 4 + 2 = 14.
To write a function from a machine, follow the input through each box and record what happens to the letter. A machine 'subtract 5, then divide by 2' gives y = (x - 5) ÷ 2, which is written y = (x - 5)/2. The brackets are essential, because the subtraction happens first. Without brackets, x - 5/2 would mean something different.
To write a function from a description, translate each phrase in the order stated. 'Halve the number and add 7' gives f(x) = x/2 + 7.
Finding an input from an output: inverse operations
Sometimes the output is known and the input must be found. This is done by reversing the machine. Every operation has an inverse operation that undoes it:
| Operation | Inverse |
|---|---|
| add a | subtract a |
| subtract a | add a |
| multiply by a (a ≠ 0) | divide by a |
| divide by a (a ≠ 0) | multiply by a |
To reverse a whole machine, start at the output, work from right to left, and apply the inverse of each box in reverse order. For 'multiply by 3, then add 2', the reverse is 'subtract 2, then divide by 3'.
If the output is 20, subtracting 2 gives 18 and dividing by 3 gives 6. Check by running the original function forward: 3 × 6 + 2 = 20. Checking forwards is a quick way to confirm that the input is correct.
The same method works with negative numbers and integers. If a machine is 'multiply by -2, then subtract 4' and the output is 10, the reverse is 'add 4, then divide by -2': 10 + 4 = 14, and 14 ÷ (-2) = -7. The input is -7.
The same steps solve the equation 3x + 2 = 20. Solving for the input is the same as undoing the operations on x in reverse order.
Inverse operations with fractions
Functions can include fractional operations. Dividing by a number and multiplying by its reciprocal are linked, which gives inverses for fractional boxes:
- The inverse of 'multiply by 1/4' (equivalent to dividing by 4) is 'multiply by 4'.
- The inverse of 'divide by 5' is 'multiply by 5'.
- The inverse of 'multiply by 2/3' is 'multiply by 3/2' (or 'divide by 2/3'), because 2/3 × 3/2 = 1.
Consider the function f(x) = (2/3)x - 1 with output 7. Reverse the steps in order: add 1 to get 8, then multiply by 3/2. Then 8 × 3/2 = 12, so the input is 12. Check: (2/3) × 12 - 1 = 8 - 1 = 7.
Functions can also have fractional inputs or outputs. For y = 4x + 1 with output 2, the reverse gives (2 - 1) ÷ 4 = 1/4, so the input is 1/4. Fractional answers are acceptable, because inputs are not restricted to whole numbers. Answers are normally left as fractions or converted to decimals only when the context asks for it.
Inverse operations with indices
Squaring, cubing and roots can also be boxes in a function machine, and each has an inverse operation:
| Operation | Inverse |
|---|---|
| square (x²) | square root (√) |
| cube (x³) | cube root (∛) |
| square root | square |
| cube root | cube |
For f(x) = x² + 1 with output 17, subtract 1 to get 16, then take the square root. The square root step produces 4, but also -4 is a valid input, because (-4)² = 16 as well. Both 4 and -4 are inputs that give the output 17. This does not contradict the definition of a function: each input still gives exactly one output, but one output can come from two inputs. If the question restricts inputs to positive numbers, only 4 is accepted.
Cubing behaves differently. For f(x) = x³ - 5 with output 22, add 5 to get 27, then take the cube root to get 3. A cube has only one real cube root, so there is one input. A negative output behaves the same way: x³ = -8 gives x = -2, because (-2)³ = -8.
For a function with both an index and other operations, such as f(x) = 2x² - 3 with output 15, the reverse is: add 3 (18), divide by 2 (9), square root (±3). The inputs are 3 and -3. For a square root box, such as f(x) = √x + 4 with output 9, subtract 4 to get 5, then square to get 25. The input is 25.









