Math Core

Lesson 4.1 · Introduction to Functions

Relations and functions

A vending machine is dependable: press B4 and you get the same snack every time. A machine that sometimes gave you chips and sometimes gave you a granola bar for the same button would be useless. Functions are the math version of a dependable machine, and they are the main idea of the rest of Algebra 1.

Relations: pairing inputs with outputs

Any time you pair one quantity with another, you have a relation.

Definition

Relation

A relation is any set of ordered pairs (x,y)(x, y). The first number of each pair is the input and the second is the output. The set of all inputs is the domain, and the set of all outputs is the range.

You can show the same relation in several ways. Here is one relation written three ways.

As a set of ordered pairs: {(1,4),(2,7),(3,4),(5,9)}\{(1, 4), (2, 7), (3, 4), (5, 9)\}

As a table:

input xx11223355
output yy44774499

As a mapping diagram: list the inputs in one column, the outputs in another, and draw an arrow from each input to its output. Here the arrows go 1→41 \to 4, 2→72 \to 7, 3→43 \to 4 and 5→95 \to 9.

The domain is {1,2,3,5}\{1, 2, 3, 5\} and the range is {4,7,9}\{4, 7, 9\}. Notice that 44 appears twice as an output, but you only list it once in the range.

Functions: exactly one output per input

Definition

Function

A function is a relation in which each input has exactly one output. Different inputs are allowed to share an output, but one input is never paired with two different outputs.

The relation above is a function. Every input goes to one place. It doesn't matter that both 11 and 33 go to 44; two buttons on a vending machine can hold the same snack.

Now look at {(2,5),(6,1),(2,8)}\{(2, 5), (6, 1), (2, 8)\}. The input 22 is paired with both 55 and 88, so this relation is not a function. If someone asked "what goes with 22?", there would be no single answer.

How to test a relation

Look for a repeated input. If some input appears with two different outputs, the relation is not a function. Repeated outputs are fine.

Common mistake

The most common mistake is checking the wrong column. {(1,3),(2,3),(4,3)}\{(1, 3), (2, 3), (4, 3)\} is a function: the outputs repeat, but each input has only one output. The pair (4,3)(4, 3) appearing twice would also be fine, since it's the same output both times.

Worked example: Is it a function?

Decide whether each relation is a function.

  1. {(−3,0),(0,2),(4,2),(7,−1)}\{(-3, 0), (0, 2), (4, 2), (7, -1)\}
  2. {(5,1),(5,2),(6,3)}\{(5, 1), (5, 2), (6, 3)\}
  3. The relation that pairs each person with their date of birth.
  4. The relation that pairs each date of birth with a person born on that date.

Solutions.

  1. The inputs −3,0,4,7-3, 0, 4, 7 are all different. Function. (The shared output 22 doesn't matter.)
  2. The input 55 has two outputs, 11 and 22. Not a function.
  3. Each person has exactly one birth date. Function.
  4. Many people share a birthday, so one date can be paired with several people. Not a function.

The vertical line test

On a graph, each point (x,y)(x, y) is an input xx paired with an output yy. Points directly above and below each other share the same xx but have different yy-values. That gives a quick visual test.

Vertical line test

A graph represents a function if and only if no vertical line crosses the graph more than once.

The parabola below is a function. Any vertical line you draw, like the dashed line x=2x = 2, crosses it exactly once.

The parabola y = x² − 3 passes the vertical line test. The line x = 2 meets it only at (2, 1).Open in grapher →

The sideways parabola below is not a function. The dashed line x=1x = 1 crosses it twice, at (1,2)(1, 2) and (1,−2)(1, -2), so the input 11 has two outputs.

The curve x = y² − 3 fails the vertical line test: x = 1 meets it at two points.Open in grapher →

Worked example: Using the vertical line test

Which of these graphs are functions: a line y=2x−1y = 2x - 1, a circle x2+y2=9x^2 + y^2 = 9, and a V-shape y=∣x∣y = |x|?

A line, a circle and a V-shape.Open in grapher →
  • The line is a function. Any vertical line crosses it once (a non-vertical line never doubles back).
  • The circle is not a function. The vertical line x=0x = 0 crosses it at (0,3)(0, 3) and (0,−3)(0, -3).
  • The V-shape is a function. Although the graph has two branches, they are side by side, never one above the other.

Tip

Only a vertical line counts. A horizontal line crossing a graph twice just means two inputs share an output, which is allowed. The V-shape y=∣x∣y = |x| is crossed twice by the line y=2y = 2, and it is still a function.

Functions in the real world

Many everyday rules are functions because the output is determined by the input. The cost of gas is a function of the number of gallons: pump 1010 gallons and the price is fixed. The area of a square is a function of its side length. Your grade on a test is a function of which answers you got right.

A quick way to check a real-world relation is to ask: if I know the input, do I know the output for sure? If the answer is yes, it's a function. Knowing someone's height doesn't tell you their exact age, so "height to age" is not a function. But at a given moment, each person has one height, so "person to height" is.

Practice

Practice 1

Which relation is a function?

Practice 2

The relation {(1,5),(2,8),(3,11),(a,2)}\{(1, 5), (2, 8), (3, 11), (a, 2)\} is a function. Which value cannot be aa?

Practice 3

List the range of the relation {(−1,4),(0,2),(2,4),(5,−3)}\{(-1, 4), (0, 2), (2, 4), (5, -3)\}.

Separate answers with commas, e.g. 2, -5

Practice 4

Which relation is not a function?

Practice 5

Which equation's graph fails the vertical line test?

Practice 6

The graph of x=y2x = y^2 is a sideways parabola. List all the outputs yy that are paired with the input x=9x = 9.

Separate answers with commas, e.g. 2, -5

Practice 7

How many of these relations are functions?

  • {(4,0),(5,0),(6,0)}\{(4, 0), (5, 0), (6, 0)\}
  • {(0,4),(0,5),(0,6)}\{(0, 4), (0, 5), (0, 6)\}
  • The circle x2+y2=25x^2 + y^2 = 25
  • The line y=−12x+7y = -\tfrac{1}{2}x + 7

Enter a number. Fractions like 3/4 and sqrt(2) are OK.