Functions, relations and notation for HSC Maths Advanced: the function machine and notation, evaluating and substituting into a function, function versus relation, the vertical line test, and classifying relations as one-to-one, many-to-one, one-to-many or many-to-many with the horizontal line test
“Define and use function notation, distinguish a function from the more general relation using the vertical line test, and classify relations as one-to-one, many-to-one, one-to-many or many-to-many using the horizontal line test”
A function is a rule in which each input has exactly one output, written (read " of ", not a product); to evaluate it, substitute the input for every , keeping brackets around any expression so . A relation is any set of ordered pairs and may have one input giving several outputs, so every function is a relation but not the reverse. The vertical line test decides which is which: a graph is a function exactly when no vertical line meets it more than once. The horizontal line test then classifies the graph into one of four types: one-to-one (passes both, like ), many-to-one (function but fails horizontal, like ), one-to-many (not a function but passes horizontal, like ) and many-to-many (fails both, like a circle). The first word counts outputs per input, the second counts inputs per output.
Jump to a section
What this dot point is asking
This dot point sets up the language used for the rest of the course. Three ideas sit together. First, function notation: the rule , read as a machine that turns an input into a single output, and how to evaluate it, including substituting whole expressions like . Second, the difference between a function and the more general relation, decided cleanly by the vertical line test. Third, the horizontal line test, which sorts every graph into one of four types: one-to-one, many-to-one, one-to-many and many-to-many. None of this is hard once the "input to output" picture is fixed, but it is examined constantly and underpins everything later: domain and range, inverse functions, logarithms as the reverse of exponentials, and reading a graph backwards. The goal is to make as automatic as the you already know, and to never mislabel a relation.
The answer
A function is a rule with one output per input
Informally, is a function of when is completely determined by through some rule. The variable is the independent variable (the input you choose) and is the dependent variable (the output the rule hands back). The single defining property is this: each input has exactly one output. A rule that could give two different outputs for the same input is not a function.
It helps to picture the rule as a machine: you feed in a value of , the machine applies its rule, and a single value comes out. The diagram below is the machine for , with a table of inputs and the one output each produces.
Function notation
Instead of writing , we can give the rule a name, usually , and write . This Euler notation, in use since 1735, sits alongside the form throughout the course. The symbol is read " of " and means "the output of the rule when the input is ". It is not multiplied by .
The power of the notation is that it lets you name a specific output. To evaluate at a number, substitute that number for every :
- , read " of zero equals one".
- .
You can name several functions at once, say , and , and a function can be described in words ("cube the number and subtract " is ) rather than by a formula.
is the output of the rule named when the input is ; it is read " of " and is not a product. To evaluate at a value, replace every in the rule with that value. So if then . The same rule can be written ; the form just lets you name a particular output such as .
Substituting expressions, not just numbers
The input to a function need not be a number: you can substitute another letter, or a whole expression. The rule is always the same, replace every with whatever is in the brackets, then simplify. This skill is the engine of differentiation from first principles later, so it is worth drilling now.
For :
- (just rename the input).
- (expand the bracket fully).
- (square the whole input, so the is squared too).
The classic slip is to forget the brackets: is , not . Substitute the input inside brackets and the algebra stays honest.
Relations: the more general idea
Not every graph is a function. A circle such as has, for the input , the two outputs and , so it breaks the "one output per input" rule. The general word for any set of ordered pairs, function or not, is a relation. Like a function, a relation has a graph, a domain and a range; unlike a function, a relation may have two or more points sharing the same -coordinate. A function is therefore a special kind of relation, just as a square is a special kind of rectangle.
A relation is any set of ordered pairs , and it has a graph, a domain and a range. A function is the special relation in which every input has exactly one output . So every function is a relation, but not every relation is a function. Functions are also called maps or mappings, and we say " is mapped to " when .
The vertical line test
Because a function forbids one input from having two outputs, you can spot a function straight off its graph: two points with the same lie on the same vertical line. So draw vertical lines and look for a double crossing.
Vertical line test: a graph represents a function exactly when no vertical line meets it more than once. If even one vertical line crosses the graph twice, that single -value has two outputs, so the graph is a relation but not a function. To prove a graph is not a function, you only need to exhibit one vertical line that hits it twice.
Here the test is applied to two graphs. The parabola passes (every vertical line meets it once), so it is a function. The circle fails (a vertical line meets it twice), so it is only a relation.
Reading a graph backwards, and the horizontal line test
The vertical line test reads a graph forwards, from to . You can also read it backwards, from to : to solve , draw the horizontal line and read off where it meets the curve. If that horizontal line meets the curve more than once, then that one output comes from several inputs.
Counting those backward crossings is exactly the horizontal line test, the companion of the vertical one with "vertical" and "horizontal" swapped. For a graph that is already a function (so it passes the vertical test), the horizontal test sorts it further:
- If it passes the horizontal test (no horizontal line meets it twice), it is one-to-one: read forwards or backwards, there is never more than one answer. It is a one-to-one correspondence between domain and range.
- If it fails the horizontal test, it is many-to-one: read forwards there is one output, but read backwards at least one has several -values mapping to it.
Below, both and are functions, but is one-to-one (each height reached once) while is many-to-one (the height comes from and , which is why has two square roots).
The four types of relations, stage by stage
Putting the two tests together classifies every graph into exactly one of four types. The vertical test decides function or not; the horizontal test then decides "to-one" or "to-many". Building the four cases up one at a time makes the pattern click: each panel below changes one test result, sweeping through all four combinations.
Stage 1, one-to-one (passes both tests). The line passes the vertical test, so it is a function, and it passes the horizontal test too. Every input has one output and every output comes from one input, so it is a one-to-one correspondence. Read it forwards or backwards and there is never more than one answer.
Stage 2, many-to-one (passes vertical, fails horizontal). The parabola still passes the vertical test, so it is a function, but the horizontal line meets it at and , so it fails the horizontal test. A function that fails horizontally is many-to-one: many inputs share one output.
Stage 3, one-to-many (fails vertical, passes horizontal). The sideways parabola fails the vertical test (the line meets it at and ), so it is not a function. But it passes the horizontal test, since each height gives a single . A non-function that passes horizontally is one-to-many.
Stage 4, many-to-many (fails both tests). The circle fails the vertical test (a vertical line meets it twice) and the horizontal test (a horizontal line meets it twice). Failing both, it is many-to-many: at least one input gives several outputs and at least one output comes from several inputs. That completes all four combinations.
The two line tests classify every graph into one of four types. Run the vertical test first, then the horizontal test:
- One-to-one: passes vertical (a function), passes horizontal. Example .
- Many-to-one: passes vertical (a function), fails horizontal. Example .
- One-to-many: fails vertical (not a function), passes horizontal. Example .
- Many-to-many: fails vertical (not a function), fails horizontal. Example .
The first word counts outputs per input (vertical test), the second counts inputs per output (horizontal test). Only the first two are functions.
Functions and relations need not act on numbers. In a database that records each employee's home postcode, the input is a person and the output is a postcode: it is a function (each person has one postcode), and with more employees than NSW postcodes it must be many-to-one, since some postcode is shared.
How exam questions ask about functions and notation
The wording is usually a direct cue to one of these moves:
- "Find " or "evaluate the function at..." wants you to substitute the value for every and simplify. Watch negatives: means substitute inside brackets.
- "Find " or "" wants you to substitute the whole expression in brackets and expand. The marks are for the correct substitution and full expansion, so keep the brackets.
- "Show that this graph is (not) a function" wants the vertical line test: either state that every vertical line meets it once, or exhibit a single vertical line crossing twice.
- "Is the function one-to-one or many-to-one?" wants the horizontal line test applied to a graph already known to be a function. One crossing for every horizontal line means one-to-one; one repeated height means many-to-one.
- "Classify the relation" wants the full four-type answer: run both tests and name the type.
- "Solve from the graph" is reading the graph backwards: draw and read off the -values where it meets the curve.
- A worded context (a fee, a fare, a height) defines a function in disguise. Substituting a value reads it forwards; solving for the input reads it backwards.
Six examples: evaluating a function at numbers, substituting expressions into a function, a real Australian cost context read both ways, building a table for a verbally defined function, applying the vertical line test, and classifying a graph with both tests.
Evaluate at several inputs
Substitute each value for every and simplify.
Find :
Find :
Find . Substitute the negative inside brackets:
State the answers. , and . The trap is the negative input: (not ) and , so .
Substitute expressions into
The input can be an expression; replace every with the bracket and expand.
Find . Just rename the input:
Find . Substitute and expand the square:
Find . Square the whole input, so the is squared too:
State and check. , and . Check at : the formula gives , and direct substitution gives , agreeing. The common slip, writing , forgets to square the .
Read a delivery cost both forwards and backwards
A courier in Melbourne charges a base fee plus a rate per parcel, so the cost in dollars to send parcels is . Find and , then find how many parcels cost $315.
Find (read forwards). Put :
This is the base fee of $90 for sending no parcels.
Find :
Sending parcels costs $390.
Solve (read backwards). Set the rule equal to the output and solve for the input:
Answer in context. A cost of $315 corresponds to parcels. Because the cost rises by the same $75 for each parcel, this function is one-to-one, so the backward question has a single answer.
Build a table for a verbally defined function
A function is defined by the rule "square the number, then subtract ". Write its rule as an equation and draw up a table of values for .
Write the rule. "Square the number" is ; "subtract " gives:
Compute each output. Substituting in turn, , , , , then by symmetry , , .
Lay out the table.
Read off a feature. The outputs are symmetric about , and the smallest is . Reading backwards, comes from two inputs, and , so is many-to-one.
Use the vertical line test on
Decide whether the circle is a function, with reasoning.
- Apply the test
- A graph is a function only if no vertical line meets it more than once.
- Find a vertical line that crosses twice
- Take . Then , so or . The vertical line meets the circle at and , two points.
- Conclude
- The single input has two outputs, so the graph fails the vertical line test and is not a function. It is a relation, with domain and range . One twice-crossing vertical line is enough to settle it.
Classify with both tests
State whether is one-to-one, many-to-one, one-to-many or many-to-many.
- Vertical line test first
- For each input there is exactly one cube , so every vertical line meets the curve once. It passes, so is a function.
- Horizontal line test next
- The cubing function is always increasing: as rises, rises, so each height is reached exactly once. For example comes only from . No horizontal line meets the curve twice, so it passes.
- Classify
- Passing both tests, is one-to-one. Reading the graph forwards or backwards always gives a single answer, which is exactly why a cube root is unambiguous.
- Final answers
- , , ; , , ; , , and $315 buys parcels; with the table above; the circle is not a function; and is one-to-one.
- Reading as multiplication
- means "the output of at ", not times . Likewise is not in general; you must substitute as a whole.
- Dropping the brackets when substituting
- for is , not . Substitute the entire input inside brackets, then expand.
- Mishandling a negative input
- for is . Both the square and the subtracted term change carefully; do not write .
- Confusing the two line tests
- The vertical test decides function or not (one output per input); the horizontal test decides one-to-one versus many-to-one (one input per output). Using the wrong one mislabels the graph.
- Calling a relation a function because it "has a graph"
- Every relation has a graph, a domain and a range. Being a function is the extra condition that no vertical line crosses twice, so a circle or a sideways parabola is a relation but not a function.
- Stopping at two types
- There are four: one-to-one, many-to-one, one-to-many and many-to-many. A graph that fails the vertical test is still classified (one-to-many or many-to-many), it is just not a function.
Markers reward correct evaluation, clean substitution, and the right test named and applied. To bank the method marks:
- Show the substitution before simplifying. Write in full, brackets and all, then evaluate. The substitution line is where the method mark sits.
- Keep brackets around any expression input. For or , write the bracket, then expand. Expanding correctly is the marked step.
- Name the test you are using. Write "vertical line test" or "horizontal line test" and state pass or fail. To show a graph is not a function, point to one vertical line that meets it twice, with the two points.
- For classification, run both tests in order. Vertical first (function or not), then horizontal (to-one or to-many), then state the four-type name. A one-line justification of each test earns the reasoning mark.
- Read worded problems both ways. Substituting a value answers "find the cost of...", while solving the rule for the input answers "how many... cost...". State which you are doing.
- Answer in context with units. A fee or fare question wants "$390" or " parcels", not a bare number.
Practice questions
Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.
foundation2 marksA function is defined by . Find , and .Show worked solution →
Substitute each input for . The rule multiplies the input by and then subtracts .
Find :
Find . Take care with the negative:
Find :
State the answers. , and . Notice is the value where the graph would cross the -axis, since the input there is .
foundation2 marksUse the vertical line test to decide whether each of these is a function: (a) the parabola , (b) the circle . Explain your reasoning in one line each.Show worked solution →
- State the test
- A graph is a function exactly when no vertical line crosses it more than once, because that would mean one input gives two different outputs .
- Test (a) the parabola
- Every vertical line meets the parabola at exactly one point, . It passes, so is a function.
- Test (b) the circle
- The vertical line meets the circle at and , two points. One input gives two outputs, so it fails, and is not a function (it is a relation).
- Conclusion
- The parabola is a function; the circle is only a relation. A single vertical line crossing twice is all the evidence you need to rule a graph out.
core3 marksA plumber charges a fixed call-out fee plus an hourly rate, so the total cost in dollars for a job of hours is . Find and , say what each means, and find the length of a job that costs $315.Show worked solution →
Find and read its meaning. Put :
This is the cost of a hour job, the call-out fee of $90 that is charged just for turning up.
Find :
A hour job costs $315.
Solve for the job length. Set the rule equal to :
State the answer. A job costing $315 lasts hours, which matches found above. Here is the input and is the output: finding reads the rule forwards, and solving reads it backwards.
core3 marksFor , find and fully simplify .Show worked solution →
Write down by replacing every with .
Expand carefully. Expand the square first, :
Write down :
Subtract and collect like terms.
State and check. The simplified result is . Check at : and , so , and agrees.
exam3 marksClassify each graph as one-to-one, many-to-one, one-to-many or many-to-many, giving the result of each line test: (a) , (b) , (c) .Show worked solution →
- Recall the rule
- The vertical line test decides function (passes) versus not a function (fails); the horizontal line test then splits "to-one" (passes) from "to-many" (fails).
- (a)
- It passes the vertical test (one output per input), so it is a function. It also passes the horizontal test, since is always increasing and each height is reached once. Passing both, it is one-to-one.
- (b)
- It passes the vertical test, so it is a function. But the horizontal line meets it at and , so it fails the horizontal test. Function but horizontal-fail means many-to-one.
- (c) (a sideways parabola)
- The vertical line meets it at and , so it fails the vertical test and is not a function. It passes the horizontal test (each height gives a single ). Not a function but horizontal-pass means one-to-many.
- State the answers
- (a) one-to-one, (b) many-to-one, (c) one-to-many. None here is many-to-many; that needs both tests to fail, as a full circle does.
exam4 marksA Sydney taxi charges a flagfall plus a per-kilometre rate, so the fare in dollars for a trip of kilometres is . (a) Find and explain what it represents. (b) Find the fare for a km trip. (c) A passenger is charged $24.20. How far did they travel? (d) Is a one-to-one or a many-to-one function? Justify briefly.Show worked solution →
(a) Find . Put :
This is the fare for a km trip, the flagfall of $4.20 charged the moment the meter starts.
(b) Fare for km. Put :
A km trip costs $34.20.
(c) Solve (read the rule backwards).
The passenger travelled km. Check: , correct.
(d) Classify . The graph of is a straight line with a non-zero gradient, so every horizontal line meets it exactly once. It passes both line tests, so is one-to-one: each fare corresponds to exactly one distance, which is why part (c) had a single answer.