Algebra 1
Unit 4 · Lesson 4.2

What is a function

Think about a vending machine for a moment. You press a button and you get exactly one snack. Press B4 today, you get pretzels. Press B4 tomorrow, you get pretzels again. Same button, same snack, every time.

That reliable matching of each button to one snack is the whole idea behind a function. A function is a dependable pairing: each thing you put in comes back matched to exactly one thing.

One input entering a machine and a single output leaving it.

Notice what the machine does not promise. It doesn't promise that every snack has its own button. Two different buttons can both dispense pretzels, and that's a perfectly good machine. Annoying, maybe, but not broken.

What would count as broken is a button that gives pretzels sometimes and a soda other times. Press B4 and you can't tell what you'll get. That machine you'd kick.

That asymmetry is the entire lesson, so say it slowly. Two inputs landing on the same output is fine. One input giving two different outputs is the thing a function never does. Repeats are only a problem on the input side.

There's no formula anywhere in that vending machine, just a list of which button gives which snack. Hold onto that, because it's easy to assume a function has to be an equation. It doesn't. The pairing itself is the function, however it's written down.

Here's that idea as a picture you can draw. Put the inputs in a column on the left, the outputs in a column on the right, and draw an arrow from each input to the output it's matched with.

The reading rule follows the vending machine exactly: it's a function when every input on the left has exactly one arrow leaving it. Two arrows landing on the same right-hand value (two buttons, same snack) is fine. But two arrows leaving one left-hand value means that single input has two outputs, and that breaks it.

On the coordinate plane an input is its x-value: how far left or right a point sits. All the points that share one input line up in a single vertical line at that x. So slide a vertical line across the graph and count the touches: one touch at every spot means each input has just one output, so it's a function; if the line ever touches in two places at once, that input has two outputs, and it isn't. This sweep has a name: the vertical line test.

Try it yourself: pick a graph, then drag the red vertical line across the plane (or press Sweep) and watch the tally. A straight line is touched exactly once wherever you stop it, so it's a function; switch to the circle and that same line gets caught twice, so it isn't.

x y -4 -4 -2 -2 2 2 4 4
-5
hits at this x: 1
✓ a function Drag the red handle across the plane (or scrub the slider / press ← →). Two hits anywhere means it fails.
Figure 4.2.f1 — Vertical line test, hands-on: pick a graph, then grab the red handle and drag the dashed test line across the plane (scrub the slider, press the arrow keys, or tap ▶ Sweep to watch it glide on its own). The dots and the hit count update as you move. The line y = x (and the parabola) get touched exactly once at every x, so the verdict stays “✓ a function.” The circle r = 4 gets touched twice wherever the line is inside it — the instant you find a 2-hit spot the verdict locks to “✗ not a function.”

New words

  • 4.2.d1 Function: a pairing (a correspondence) that matches each input with exactly one output. The pairing can be given any way at all: a list of (input, output) pairs, a table, a graph, or a formula. What makes it a function is the one-output-per-input promise, not the form it comes in.
  • 4.2.d2 Input / output: what you feed in, and what comes back, written as a pair (input, output). The inputs form one set and the outputs form another; in 4.3 those sets get the names domain and range.
  • 4.2.d3 Vertical line test: a graph is a function exactly when every vertical line hits it in at most one point (one hit, or none). If some vertical line hits the graph twice, that one input has two outputs, so it is not a function.

Work the next examples one at a time, deciding each answer before you read the verdict.

Worked example

4.2.w1 Example 1: a set of pairs (no formula needed). Is \(\{(1,2),(2,4),(3,6),(4,8)\}\) a function?

This is just a pairing, a list matching inputs to outputs, with no rule or formula written anywhere. That's allowed, because the pairing itself is the function. The inputs are 1, 2, 3, 4. Each one is different, each appears once, so each input is matched with exactly one output.

Yes, a function.

4.2.w2 Example 2: a repeated output (still fine). Is \(\{(1,5),(2,5),(3,5)\}\) a function?

The output 5 shows up three times, which can look suspicious at first. But check the inputs: 1, 2, 3, each appearing once, each with a single output. A repeated output is allowed. This is the "two buttons, same snack" case.

Yes, a function.

4.2.w3 Example 3: a split input (broken). Is \(\{(1,2),(1,3),(2,4)\}\) a function?

Look at the input 1: it's paired with 2 and also with 3. One input, two outputs, the broken-button case.

No, not a function.

4.2.w4 Example 4: a table. Is this table a function?

input x 0 1 2 0
output 4 5 6 9

A table is read the same way; just scan the input row for a repeat. Input 0 appears twice, giving 4 once and 9 once. That's two outputs for one input.

No, not a function.

4.2.w5 Example 5: a graph (vertical line test). Is the graph a function? Try three graphs.

A straight line such as y=2x+1: the test line hits once wherever you put it. Function. 4.2.f2

x y (1, 3)
Figure 4.2.f2

A circle centered at the origin: a vertical line through the middle hits it in two places at once. Not a function. 4.2.f3

x y (0, 5) (0, -5)
Figure 4.2.f3

The vertical line x=3: the test line lands right on top of it and hits at every height, so that one input has infinitely many outputs. Not a function. 4.2.f4

x y (3, 1)
Figure 4.2.f4

One caution about direction: the test line is vertical, not horizontal. An input is an x, so the line that gathers all the points sharing one x stands straight up and down.

Check yourself

  1. 4.2.c1 Make a set of three pairs that is not a function, and say which input breaks it. (One answer: \(\{(2,1),(2,5),(3,9)\}\). The input 2 is paired with both 1 and 5, so that's the one that breaks it.)
  2. 4.2.c2 Here's a table where the output 7 shows up three times. Can it still be a function, and what would you have to check? (Yes, it can: a repeated output is fine. Check the inputs: as long as no input appears twice with different outputs, it's a function.)
  3. 4.2.c3 Why does the vertical line test, and not a horizontal one, decide it? (A vertical line gathers all the points that share one input; two hits means one input with two outputs, which is broken. A horizontal line would gather points that share one output, but two inputs sharing an output is allowed, so a horizontal line tests nothing about being a function.)

Mixing the kinds of problem feels harder than repeating one kind, and that's the point: switching between them is what makes the idea stick to next week. Every problem below has its answer at the end of the lesson, and if one stalls you, look back at the worked example it matches.

Practice

A. Sets of pairs — function or not? (give the reason)

  1. 4.2.1 \(\{(0,1),(1,2),(2,3)\}\)
  2. 4.2.2 \(\{(2,4),(3,4),(5,4)\}\)
  3. 4.2.3 \(\{(1,1),(1,2),(3,4)\}\)
  4. 4.2.4 \(\{(-1,0),(0,1),(1,0)\}\)
  5. 4.2.5 \(\{(5,5),(5,6)\}\)

B. Tables — function or not?

  1. 4.2.6 inputs 1,2,3,4 → outputs 2,2,2,2
  2. 4.2.7 inputs 3,4,3 → outputs 1,2,8
  3. 4.2.8 inputs -2,-1,0,1 → outputs 4,1,0,1

C. Descriptions / graphs — function or not?

  1. 4.2.9 "Each person is matched to their birth year." (input = person)
  2. 4.2.10 "Each birth year is matched to a person born then." (input = year)
  3. 4.2.11 The graph of a single non-vertical straight line.
  4. 4.2.12 The graph of a circle.
  5. 4.2.13 The graph of the vertical line x=3.
  6. 4.2.14 "Each student is paired with the one chair they sit in." (input = student)
AnswersTry each one yourself first, then open to check.
  1. Function — inputs 0,1,2 all distinct.
  2. Function — output 4 repeats, but inputs 2,3,5 are distinct (two buttons, same snack).
  3. Not a function — input 1 gives both 1 and 2.
  4. Function — output 0 repeats, but inputs -1,0,1 are distinct.
  5. Not a function — input 5 gives both 5 and 6.
  6. Function — inputs all distinct; identical outputs are allowed.
  7. Not a function — input 3 appears twice with outputs 1 and 8.
  8. Function — inputs -2,-1,0,1 distinct; repeated output 1 is fine.
  9. Function — each person has exactly one birth year.
  10. Not a function — a year can match many people (one input → many outputs).
  11. Function — a non-vertical line passes the vertical line test (each x has exactly one y).
  12. Not a function — a vertical line through it hits twice.
  13. Not a function — every point shares the input x=3, so that one input has infinitely many outputs; it fails the vertical line test.
  14. Function — each input (a student) is paired with exactly one output (a chair). It's a plain pairing, no formula needed.