# 2.8: Defining Relations and Functions

**At Grade**Created by: CK-12

**Practice**Relations and Functions

On a road trip, you stop at a vending machine during a lunch break. Each item in the vending machine has a unique code that consists of a letter followed by a number. No two items in the machine are the same. Is the vending machine an example of a function?

### Watch This

Watch this video and keep in mind that the **domain** and **range** are the **input** and **output** values.

Khan Academy: Relations and Functions

### Guidance

Functions are a very important part of Algebra II. From this point on, we are going to study several different types of functions: linear, quadratic, cubic, polynomial, rational and trigonometric.

First, every set of points is called a **relation.** A relation is a grouped set of points that relate, or have something in common with each other. Here are a few examples of relations.

\begin{align*}&\{(3, -2), (-4, -5), (7, -2), (9, 1)\} && \{(-4, 1), (0, 3), (0, 0), (6, -7)\} && y = \sqrt {x + 6}\\ & y = -2x + 3 && x^2 + y^2 = 9 && 3y - x^2 + 4x = 15\end{align*}

Whenever we talk about a set of points, the { }, or brackets are used. In the examples above, there are two sets of points. All 6 of these sets or equations are examples of relations. Relations also have an **input** and an **output.** Typically, all inputs are the \begin{align*}x-\end{align*}values (and can be called the **domain**), and all outputs are the \begin{align*}y-\end{align*}values (and can be called the **range**). The input could also be considered the **independent variable** and the output would be the **dependent variable.** Again, the \begin{align*}y-\end{align*}value depends on the value of \begin{align*}x\end{align*}. As in the equation of the line, above, if we plug in -1 for \begin{align*}x\end{align*}, then we can determine what \begin{align*}y\end{align*} is.

A more specific type of relation is a function. A **function** is a relation where there is exactly one output for every input. It cannot be a function if at least one input has more than one output. Simply stated, the \begin{align*}x-\end{align*}values of a function cannot repeat. When an equation is a function, \begin{align*}y\end{align*} is sometimes rewritten as \begin{align*}f(x)\end{align*} (pronounced "\begin{align*}f\end{align*} of \begin{align*}x\end{align*}"). \begin{align*}f(x)\end{align*} is the **function notation.** \begin{align*}f(x)\end{align*} will be used more in later chapters.

#### Example A

Compare {(3, -2), (-4, -5), (7, -2), (9, 1)} and {(-4, 1), (0, 3), (0, 0), (6, -7)} from above. One is a function and one is not. Which one is the function?

**Solution:** Look in each set to see if the \begin{align*}x-\end{align*}values repeat at all. In the second set of points, the \begin{align*}x-\end{align*}value, 0, is repeated in the second and third points. There is not exactly one output for this value. That means the second set of points is not a function. The first set is.

#### Example B

Below are input/output tables. Determine which table represents a function.

a)

b)

**Solution:** Think back to the definition of a function, “it cannot be a function if at least one input has more than one output.” a) has one input that has more than one output. Therefore, it is not a function. b) does not have an input with two different outputs. Therefore, it is a function.

Another way to approach these problems is to write out the points that are created and then determine if the \begin{align*}x-\end{align*}values repeat. For example, in part a, the points would be {(1, 5), (2, -1), (3, 6), (3, 7)}. 3 is repeated, meaning it is not a function.

We can also apply this idea to equations. Every equation is a relation, but not every equation is a function. The easiest way to determine if an equation is a function is to do the **Vertical Line Test.** The Vertical Line Test will help you determine if any \begin{align*}x-\end{align*}values repeat. First, plot or graph the equation. Then draw several vertical lines. If the graph of the equation touches any vertical line more than once, it is not a function. This works because all vertical lines are in the form \begin{align*}x = a\end{align*}, so the \begin{align*}x-\end{align*}value for any vertical line will always be the same. The Vertical Line Test tells us if any \begin{align*}x-\end{align*}values repeat within a graphed relation.

#### Example C

Determine if the equation above, \begin{align*}x^2 + y^2 = 9\end{align*} represents a function.

**Solution:** The graph of \begin{align*}x^2 + y^2 = 9\end{align*} is a circle with radius 3.

Drawing vertical lines through the circle, we see that it touches them twice.

This tells us that a circle is not a function.

However, if we solve the equation for \begin{align*}y\end{align*}, we get \begin{align*}y = \pm\sqrt{-x^2 + 9}\end{align*} or \begin{align*}y = \sqrt{-x^2 + 9}\end{align*} and \begin{align*} y = -\sqrt{-x^2 + 9}\end{align*}. These two equations separately are functions. Think of them as the top and bottom halves of the circle.

**Intro Problem Revisit**

Each input (a letter/number combination) into the vending machine results in one and only one item. Since none of the items appear more than once in the vending machine, it is an example of a function.

### Vocabulary

- Relation
- A set of points either grouped by { } or by an equation.

- Function
- A relation where there is exactly one output for every input. The notation is \begin{align*}f(x)\end{align*}, said “function of \begin{align*}x\end{align*}” or “\begin{align*}f\end{align*} of \begin{align*}x\end{align*}.”

- Input
- The values that are plugged in to a relation or function. Typically, the \begin{align*}x-\end{align*}values.

- Output
- The values that are a result of the input being plugged in to a relation or function. Typically, the \begin{align*}y-\end{align*}values.

- Independent Variable
- The input of a function.

- Dependent Variable
- The output of a function.

- Vertical Line Test
- A test to determine if a graph of an equation is a function. It involves drawing several vertical lines over the graph. If the graph touches any vertical line more than once, it is not a function.

### Guided Practice

Determine if the following relations are functions. Briefly explain your answer.

1. {(3, -5), (8, 1), (-3, -3), (5, 1)}

2. {(9, -2), (0, 0), (7, 4), (9, 3)}

3.

4.

#### Answers

1. Yes, the \begin{align*}x-\end{align*}values do not repeat.

2. No, there are two 9’s in the \begin{align*}x-\end{align*}values.

3. Yes, all the outputs have different inputs.

4. Yes, this graph passes the Vertical Line Test. Any vertical line touches this graph once.

### Practice

Determine if the following relations are functions. Briefly explain your answer.

- {(3, 4), (5, 6), (7, 8), (9, 10)}
- {(-9, -10), (4, -5), (6, -5), (4, -10)}
- {(-5, -7), (0, 4), (-5, 3), (9, 4)}
- {(3, -12), (6, -1), (-10, 5), (-2, 9)}

HINT: Recall that with open circles, the point is not included.

For problems 17-19, determine if the following lines are functions.

- \begin{align*}y = -3x - 1\end{align*}
- \begin{align*}y = \frac{2}{3}x + 6\end{align*}
- \begin{align*}y = -2\end{align*}
- Is \begin{align*}x = 4\end{align*} a function? Why or why not?
- From problems 17-20, what can you conclude about linear equations?

dependent variable

The dependent variable is the output variable in an equation or function, commonly represented by or .independent variable

The independent variable is the input variable in an equation or function, commonly represented by .input

The input of a function is the value on which the function is performed (commonly the value).Output

The output of a function is the result of the operations performed on the independent variable (commonly ). The output values are commonly the values of or .Relation

A relation is any set of ordered pairs . A relation can have more than one output for a given input.Vertical Line Test

The vertical line test says that if a vertical line drawn anywhere through the graph of a relation intersects the relation in more than one location, then the relation is*not*a function.

### Image Attributions

Here you'll learn what a relation and a function are and how they pertain to linear equations.