topic badge
Middle Years

4.02 Functions and relations

Lesson

What is a relation?

A relation is a relationship between sets of information. For example, think of the names of people in a class and their heights. If given a height (e.g. $162$162 cm), it would be possible to identify the names of all the people who are this tall in the class, and there may be more than one person. So, if someone came to the class looking for the person who was $162$162 cm tall, that description might fit four people! There's not one clear answer. This data could be expressed as a relation.

A relation can be described using a table, a rule, a graph, a set of ordered pairs or a diagram mapping elements of two different sets.

Relations can be classified by how sets of inputs and outputs are related. The following diagrams illustrate the four types of relations for two sets of $x$x and $y$y values (inputs and outputs):

The height example above would be a one-to-many relation since many students in the class have the same height (many outputs of "student" from the one input of "height").

 

What is a function?

A function is a special type of relation, where each input only has one output. This means that many-to-one and one-to-one relations are the only relations that are also functions (why?).

Functions are described as using dependent and independent variables where the dependent variable, often $y$y, varies depending on the rule that is applied to the independent variable, often $x$x.

For example, think of a vending machine selling juice. The amount of money needed (the dependent variable) depends on the number of bottles of juice being purchased (the independent variable). Let each bottle of juice cost $\$3$$3. If one bottle is bought, it would cost $\$3$$3, if two bottles were bought, it would cost $\$6$$6 and so on. The value of the independent variable (the number of bottles of juice) always produces a different, unique dependent variable (cost). This is an example of a function

Let's look at another example. Consider the expression $y=2x$y=2x. Let's construct a table of values to record the results:

$x$x $-1$1 $0$0 $1$1 $2$2
$y$y $-2$2 $0$0 $2$2 $4$4

Notice that each $x$x value gives only one $y$y value? This means this data displays a function

Remember!

While all functions are relations, not all relations are functions.

 

Distinguishing between relations and functions

The vertical line test

If a vertical line is drawn anywhere on a graph so that it crosses the graph in more than one place, then the relation is not a function. This is because, if any input has more than one output, the vertical line will cross the graph at that point twice. Remember: a function can only every have one output for any input.

 

Here is an example of a relation that is not a function. See how the blue vertical line crossed the graph in two places? 

 

 

 

To be a function, a relation has to pass the vertical line test at every point

Here is one example of a function.

Here is another function.

 

The Vertical Line Test

If a vertical line is drawn anywhere on a graph and it crosses the graph in more than one place, then the relation is not a function.

 

Distinguishing without graphing

If a relationship can be expressed between $x$x and $y$y then that represents a relation. However, if this relationship only yields one value of $y$y for each $x$x value, then it is a function.

Exploration

If we make $y$y the subject of $2y-4x=10$2y4x=10, we can tell whether it's a function or a relation.

$2y-4x=10$2y4x=10

$2y=4x+10$2y=4x+10

$y=2x+5$y=2x+5

See that each value of $x$x only yields one $y$y value, which means that it is a function.

Let's try this process for the equation $y^2=x$y2=x:

$y=\pm\sqrt{x}$y=±x

See how $y$y could be $\sqrt{x}$x or $-\sqrt{x}$x? Since there are two possible values of $y$y, we can only say it is a relation.

 

Worked examples

example 1

Do the following set of points describe a function or a relation?

A) $\left(1,5\right)$(1,5), $\left(1,1\right)$(1,1), $\left(7,-2\right)$(7,2), $\left(-5,-10\right)$(5,10)

Think: Does each $x$x value have a unique $y$y value?

Do: There are $2$2 possible $y$y values when $x=1$x=1. This describes a relation.

 

B) $\left(1,5\right)$(1,5)$\left(7,-2\right)$(7,2), $\left(-5,-10\right)$(5,10), $\left(13,-13\right)$(13,13)

Think: Does each $x$x value have a unique $y$y value?

Do: In this set of coordinates, each $x$x value has only one unique $y$y value. This describes a function.

Practice questions

Question 1

Determine whether the following graphs describe relations, and whether they describe functions.

  1. Loading Graph...
    A graph of a rectangular hyperbola on a Cartesian coordinate plane marked from -6 to 6 on both $x$x- and $y$y-axes. The x- and y-axes are the asymptotes of the curve.

    Select all answers that apply.

    Function

    A

    Relation

    B
  2. Loading Graph...
    A Cartesian coordinate plane marked from -6 to 6 on both $x$x- and $y$y-axes. A parabola is graphed whose vertex is at the origin $\left(0,0\right)$(0,0) and it opens to the right of the $y$y-axis. The coordinates of the vertex are not explicitly given.

    Select all answers that apply.

    Function

    A

    Relation

    B

Question 2

The pairs of values in the table represent a relation between $x$x and $y$y. Do they represent a function?

$x$x $-9$9 $-5$5 $-4$4 $-2$2 $0$0 $2$2 $4$4 $4$4 $9$9
$y$y $12$12 $-9$9 $-3$3 $-5$5 $9$9 $-12$12 $14$14 $11$11 $-14$14
  1. Yes

    A

    No

    B

Question 3

Determine whether the following equations describe relations, and whether they describe functions.

  1. $y=9x$y=9x

    Select all answers that apply.

    Function

    A

    Relation

    B
  2. $y=x^2+2$y=x2+2

    Select all answers that apply.

    Function

    A

    Relation

    B

 

What is Mathspace

About Mathspace