Functions and how to represent them
A function f: A → B links every element of A to exactly one element of B. Show it as pairs, a table, an arrow diagram or a graph.
When is a relation a function?
- Every element of the domain A must have an image. No element of A is left out.
- Each element of A has only one image. One input cannot give two outputs.
- Two elements of A may share the same image. That is still a function.
- Some elements of B may have no pre-image (no arrow comes to them).
- If f(x) = y, then y is the image of x and x is a pre-image of y.
Four ways to show f(x) = 2x + 1 on A = {1, 2, 3, 4}
| Form | How f looks |
|---|---|
| Set of ordered pairs | f = {(1, 3), (2, 5), (3, 7), (4, 9)} |
| Table | Top row x: 1, 2, 3, 4; bottom row f(x): 3, 5, 7, 9 |
| Arrow diagram | Oval A holds 1, 2, 3, 4; oval B holds 3, 5, 7, 9; one arrow from each x to f(x) |
| Graph | Points (1, 3), (2, 5), (3, 7), (4, 9) plotted on graph paper, not joined, because the domain has only four numbers |
How to draw the graph of a function and use the vertical line test
- 1Draw the x-axis and the y-axis on graph paper and mark the origin O.
- 2Choose a scale, for example 1 cm = 1 unit on both axes, and write it in the top corner.
- 3Plot each pair (x, f(x)) as a dot and write its coordinates beside it.
- 4Join the dots with a smooth curve only when the domain is an interval of real numbers.
- 5Vertical line test: slide a vertical line across the graph. If it ever meets the graph at more than one point, the graph is not a function.
Example 1: is the relation a function?
Let A = {1, 2, 3, 4} and B = {1, 4, 7, 10, 13}. Is f = {(1, 1), (2, 4), (3, 7), (4, 10)} a function from A to B? If so, find its range.
- Each element 1, 2, 3, 4 of A appears exactly once as a first entry.
- So every element of A has one and only one image in B.
- Therefore f is a function from A to B.
- Range = {1, 4, 7, 10}.
- 13 ∈ B has no pre-image, so the range is not equal to the co-domain.
Yes, f is a function, with range {1, 4, 7, 10}.
Example 2: a function defined in pieces
A function f: [−2, 6) → R is defined by f(x) = 2x + 1 for −2 ≤ x < 1, f(x) = x² for 1 ≤ x < 4 and f(x) = 20 − x for 4 ≤ x < 6. Find f(0), f(3), f(5) and f(3) − 2f(0). ([−2, 6) means all real numbers from −2 up to 6, including −2 but not 6.)
- Pick the rule whose interval contains the given x.
- 0 lies in −2 ≤ x < 1, so f(0) = 2(0) + 1 = 1.
- 3 lies in 1 ≤ x < 4, so f(3) = 3² = 9.
- 5 lies in 4 ≤ x < 6, so f(5) = 20 − 5 = 15.
- f(3) − 2f(0) = 9 − 2(1) = 7.
f(0) = 1, f(3) = 9, f(5) = 15 and f(3) − 2f(0) = 7.
An auto meter works like a function: each trip distance shows exactly one fare. Two different trips may cost the same, but one trip never shows two fares.
2 marks: “Let A = {1, 2, 3} and B = {4, 5, 6}. Is R = {(1, 4), (1, 5), (2, 6), (3, 6)} a function from A to B? Give a reason.” No. The element 1 has two images, 4 and 5, so R is not a function.
2 marks: “If f(x) = x² − 3x, find f(2) and f(−1).” f(2) = 4 − 6 = −2; f(−1) = 1 + 3 = 4.
5 marks: “Represent the function f = {(1, 4), (2, 4), (3, 6), (4, 8)} as (i) an arrow diagram (ii) a table (iii) a graph.” Arrow diagram: A = {1, 2, 3, 4}, B containing 4, 6, 8; arrows 1 → 4, 2 → 4, 3 → 6, 4 → 8. Table: x = 1, 2, 3, 4 with f(x) = 4, 4, 6, 8. Graph: plot (1, 4), (2, 4), (3, 6), (4, 8) as separate points, with a scale.
Every input, one output. Many inputs may share an output; one input may never have two.