Quarry School

Vertical and horizontal lines answer different questions

Explain it like I am five

Picture scanning shelves with a straight ruler. Holding the ruler upright keeps one left-to-right position fixed. Laying it flat keeps one height fixed. A graph uses left-to-right position for input and height for output. The vertical line test uses the upright ruler to ask whether one input could have two outputs. The horizontal line test uses the flat ruler to ask whether one output could have two inputs. First make sure the graph is a function. Then decide whether that function is one-to-one. The two tests inspect different kinds of sharing, so a curve can pass the first and fail the second.

In this passing diagram, an upright test line meets the curve once. Vertical lines check one output for each input.
Reminder
  • Graph points. (x, f(x)) places input x horizontally and output f(x) vertically, by the graphing convention taught above.
  • Domain and range. No contact at an input means outside the domain. No contact at an output height means outside the range.
Why it works. A vertical line goes straight up and down through one input position. The line through input 2 contains (2, −1), (2, 0), and (2, 5): every point has input 2. Two graph contacts on it would give that input two different outputs. A horizontal line runs level through one output height. The line at height 4 contains (−2, 4) and (2, 4): every point has output 4. Two contacts on it give one output two inputs. A line with no graph contact creates no conflicting pair.
RuleVertical line test: a graph represents a function exactly when every vertical line meets it at most once. Horizontal line test: a function is one-to-one exactly when every horizontal line meets its graph at most once.
The same idea, five ways
Say it

A vertical line is one input. A horizontal line is one output.

Write it

The vertical line test checks whether each input has one output. The horizontal line test checks whether outputs are shared by distinct inputs.

In math
  • x = 2: all points with input 2
  • y = 4: all points with output 4
  • Vertical: at most one contact means a function.
  • Horizontal, after the function check: at most one contact means one-to-one.
Like

An upright ruler holds one aisle position. A level ruler holds one shelf height.

See it
−22246810(−2, 4)(2, 4)
The dashed level at output 4 contacts two inputs, so this function is not one-to-one.
The same idea, other ways
As rulers

An upright ruler locks the input position. A level ruler locks the output height. Two contacts reveal ambiguity in the locked value.

An upright test line holds one horizontal input position.
As a definition

One input, two outputs breaks a function. One output, two inputs breaks one-to-one. The direction of the test line fixes whichever value you are investigating.

124not a function
One input with two outputs breaks the function definition.
With points

Points (2, 1) and (2, 3) fail the vertical test because the input 2 has two outputs. Points (−2, 4) and (2, 4) fail the horizontal test because output 4 has two inputs.

−22246810(−2, 4)(2, 4)
The dashed level at output 4 contacts two inputs, so this function is not one-to-one.
As a memory cue

Check function status first with vertical lines, which hold one input. Then check one-to-one with horizontal lines, which hold one output. At most one means zero contacts or one contact.

Vertical: one input, one output?
Horizontal: one output, one input?
At most once includes zero contacts
Say which quantity the test line holds before counting contacts.
.1Vertical line test

Imagine choosing one aisle in a warehouse and asking which shelf holds your item. The aisle number should locate one height if the rule is a function. On a graph, a vertical line goes straight up and down through one input position. If it touches two different graph points, that one input has two different output heights. The graph fails the vertical line test. If every vertical line touches at most one point, the graph passes. A line can miss the graph entirely. That means its input is outside the domain, rather than that the graph has failed.

  • Vertical means straight up and down. Every point on the vertical line through 2 has input 2, including (2, −1), (2, 0), and (2, 5).
  • The test applies to separate dots as well as curves. Count distinct included graph points, not an imagined line joining data dots.
  • One failing line is enough to disprove function status. Passing requires every vertical line to meet at most once.
  • Reason: A graph point stores (input, output). Vertical lines collect exactly the points with the same input coordinate. A collection of two distinct points therefore records two outputs for one input. This is precisely the conflict excluded by the function definition. Counting zero intersections is acceptable because a function only needs an output for its allowed domain, not for every number on the axis.
In this passing diagram, the upright line meets the drawn curve once. It is a general example of the one-input check.
Reminder
  • Coordinates. In (0, 1) and (0, −1), the first coordinate is 0 in both. That is the shared input.
The same idea, five ways
Say it

The vertical line through two holds input two.

Write it

Every point on one upright line has the same first coordinate.

In math
  • x = 2
  • (2, −1), (2, 0), (2, 5)
  • At most one graph contact: zero or one.
Like

Choose one aisle and scan straight up and down for its shelves.

See it
In this passing diagram, the upright line meets the drawn curve once. It is a general example of the one-input check.
Worked exampleOne line passes; a circle fails

Apply the vertical line test to y = x and to x2 + y2 = 1. The question asks whether each fixed input x gives at most one output y.

−22−2−112
The diagonal line y = x gives one height at every input position.
(0, 1)
Top of the circle: input 0, output 1.
(0, −1)
Bottom of the same circle: input 0, output −1.
What it asks. Does input x determine at most one y on the line and on the circle?
Plan. For the line, use y = x. For the circle, test input 0 and keep both signs that square to 1.
  1. For y = x, input 1 gives only output 1, and any other input x gives only the output x.The equation explicitly sets one output for each input.
  2. For x2 + y2 = 1, choose input x = 0. Then y2 = 1 gives outputs 1 and −1.Both 12 and (−1)2 equal 1.
  3. The line passes the vertical test. The circle fails it at x = 0.The line always gives one height, but the circle has two heights at the chosen input.
Answer
  • y = x represents a function of x.
  • x2 + y2 = 1 does not represent y as a function of x.
Check The two circle points (0, 1) and (0, −1) both satisfy x2 + y2 = 1. They lie on one vertical line, proving the conflict directly.
Counterexamples: what it is not, and the tempting wrong moves
✗ Not this: A vertical line missing the graph proves it is not a function.
There are zero outputs there, so that input may be outside the domain. The prohibited case is two distinct outputs for one input.
✓ Instead: A passing graph allows zero or one intersection with each vertical line.
Tips and tricks
  • Memory cue: a vertical line is one input.
  • Write the witness on the exam: the circle is not a function of x because input 0 has outputs 1 and −1.
  • As one aisle: Choose one horizontal address and scan its possible heights. Finding two heights would give two outputs for that one input.
  • As pairs: (0, 1) and (0, −1) have the same first coordinate and different second coordinates. A vertical line through 0 catches both.
.2Horizontal line test

Now imagine asking which aisle contains an item at a particular shelf height. A horizontal line runs level across the graph, keeping the output fixed. If it touches two points, that output came from two inputs. The function fails the horizontal line test and is not one-to-one. If every level line meets at most one point, each output the function actually produces identifies one input. Use this test after the vertical test has established that the graph is a function. The square curve passes the function test, but its left and right sides reach the same heights.

  • Horizontal means level from left to right. Every point on the line at height 4 has output 4, including (−2, 4) and (2, 4).
  • The horizontal line test checks one-to-one for a graph already known to represent a function.
  • A nonhorizontal diagonal line passes. The square curve on all real inputs fails because positive heights have two matching inputs.
  • Reason: All points on a horizontal line have the same output coordinate y. Two distinct intersections on a function graph must have different input coordinates, because the function already gives one output per input. Those intersections exhibit the repeated output forbidden by one-to-one. A level with no intersection is outside the range and causes no conflict. A level with one intersection identifies exactly one original input.
−22246810(−2, 4)(2, 4)
The dashed horizontal level 4 demonstrates a failure of one-to-one.
Reminder
  • One-to-one. A function may give f(−1) = f(1) = 1. One-to-one forbids that shared output from distinct inputs.
The same idea, five ways
Say it

The horizontal line at four holds output four.

Write it

Every point on one level line has the same second coordinate.

In math
  • y = 4
  • (−2, 4) and (2, 4)
  • Every horizontal line meets a one-to-one function at most once.
Like

Choose one shelf height and search across all its aisle positions.

See it
−22246810(−2, 4)(2, 4)
The dashed horizontal level 4 demonstrates a failure of one-to-one.
Worked exampleCompare a diagonal line with the square curve

For the functions y = x and y = x2, find the input or inputs at output 1. Then decide whether each graph passes the horizontal line test for all output heights, meaning whether each output the function actually produces has one input.

−2224(−1, 1)(1, 1)
Output height 1 is shared by two allowed square inputs.
What it asks. Find the inputs at output 1, then decide whether outputs are ever shared by different inputs.
Plan. Read the identity rule backward. On the square curve, follow height 1 to both contacts.
  1. For y = x, output 1 gives input x = 1. More generally, output y always gives input x = y.The identity rule copies its input, so every backward lookup has one answer.
  2. For y = x2, output 1 gives x = −1 or x = 1.Both inputs square to 1.
  3. The line passes the horizontal test; the square curve fails it.The line has one input for any given output, while height 1 already supplies two square inputs.
Answer
  • For y = x, output 1 gives x = 1. The function is one-to-one.
  • For y = x2, output 1 gives:
  • x = −1.
  • x = 1.
  • The square function is not one-to-one on all real inputs.
Check Substitute each input: 1 = 1 for the line, and (−1)2 = 12 = 1 for the square rule. The repeated square output is the same conflict the horizontal line detects.
Counterexamples: what it is not, and the tempting wrong moves
✗ Not this: The square curve fails the horizontal test, so it is not a function.
The horizontal test checks whether different inputs share an output. Shared outputs are allowed in a function.
✓ Instead: The square curve is a function that is not one-to-one on all real inputs.
Tips and tricks
  • Memory cue: a horizontal line is one output.
  • On the exam, show the shared output: f(−1) = f(1) = 1, so the square function is not one-to-one.
  • As one shelf height: Fix the output height and count the input positions that reach it. Two positions make backward recovery ambiguous.
  • With square numbers: (−2)2 = 22 = 4. The horizontal level 4 catches both curve points, so output 4 does not identify one input.
.3A sideways U is another failing graph

A hoop is not the only graph that can give two heights over one input. Picture a U turned onto its side. Its upper and lower pieces sit above and below the same horizontal address. The equation y2 = x + 3 describes the sideways U in this diagram. At input 1, both heights 2 and −2 satisfy the equation, so the upright ruler contacts two points.

  • At x = 1, y2 = 4 gives y = 2 or y = −2.
  • The graph fails the vertical line test because one input has two outputs.
  • This diagram shows a sideways U, not the circle. The circle fails for the same one-input reason at x = 0.
A sideways U, y2 = x + 3. The vertical line x = 1 meets it at (1, 2) and (1, −2), so input 1 has two outputs.
Reminder
  • Squared equation. y2 = 4 has y = 2 and y = −2. The expression 4 alone means 2.
The same idea, five ways
Say it

Input one gives output two and output negative two.

Write it

Two different heights over one input fail the function definition.

In math
  • y2 = x + 3
  • x = 1 gives y2 = 4
  • (1, 2) and (1, −2)
Like

One aisle contains two possible answer shelves.

See it
A sideways U, y2 = x + 3. The vertical line x = 1 meets it at (1, 2) and (1, −2), so input 1 has two outputs.
Worked exampleA sideways U fails the vertical line test

Does y2 = x + 3 define y as a function of x? Use input x = 1.

A sideways U, y2 = x + 3. The vertical line x = 1 meets it at (1, 2) and (1, −2), so input 1 has two outputs.
What it asks. Can one input x give two different y outputs?
Plan. Test input 1, solve the squared equation with both signs, and write the conflicting output pair.
  1. Put x = 1 into the equation: y2 = 1 + 3 = 4.This holds one input still while finding all its permitted outputs.
  2. Both y = 2 and y = −2 work.22 = 4 and (−2)2 = 4.
  3. Write not a function of x.One input, 1, has two different outputs, 2 and −2.
Answer
Not a function of x. Input 1 gives y = 2 and y = −2.
Check The points (1, 2) and (1, −2) both satisfy y2 = x + 3 and lie on the same upright line.
Counterexamples: what it is not, and the tempting wrong moves
✗ Not this: Keep only y = 2, so input 1 has one output.
The original squared equation also permits y = −2. Discarding it changes the relation.
✓ Instead: Keep both outputs and classify the whole sideways U as not a function of x.
Tips and tricks
  • When checking a squared output, try an input that makes its square positive. Plus zero and minus zero are the same output.
  • With the equation: input 1 gives y2 = 4. Both signs, 2 and −2, square to 4.
  • With the ruler: Hold horizontal position 1. The upright line contacts an upper point and a lower point.
  • With the equation: Input 1 gives y2 = 4. Both signs, 2 and −2, square to 4.
.4A horizontal line may meet three times

Picture three trains reaching a station at the same time. Each train still has one arrival time, but the arrival time alone cannot name the train. A function graph can likewise have three different inputs at one output height. Two contacts already disprove one-to-one. Finding three makes the same conflict even clearer. The rule H(x) = x3 − x gives output 0 at inputs −1, 0, and 1.

  • A horizontal line with two or more contacts disproves one-to-one.
  • H(x) = x3 − x gives H(−1) = H(0) = H(1) = 0.
  • The toolkit rule x3 is one-to-one; adding other terms to a cubic can create shared outputs.
-1010function
Three different inputs share output 0. On the graph, their points lie on horizontal height 0.
Reminder
  • Subtracting a negative. −1 − (−1) = −1 + 1 = 0.
The same idea, five ways
Say it

Three inputs give the same output zero.

Write it

The horizontal line at output 0 meets this function at least three times.

In math
  • H(−1) = H(0) = H(1) = 0
  • (−1, 0), (0, 0), (1, 0)
  • y = 0 is the common output level.
Like

Three trains share one arrival time.

See it
-1010function
Three different inputs share output 0. On the graph, their points lie on horizontal height 0.
Worked exampleA horizontal height can match three inputs

For H(x) = x3 − x, compute H(−1), H(0), and H(1). Does the horizontal line test show that H is one-to-one?

-1010function
Three different inputs share output 0. On the graph, their points lie on horizontal height 0.
What it asks. Find a shared output for three different inputs and use it to decide one-to-one.
Plan. Evaluate each input with parentheses, then compare the three outputs.
  1. H(−1) = (−1)3 − (−1) = −1 + 1 = 0.A negative cube stays negative, and subtracting a negative adds its opposite.
  2. H(0) = 03 − 0 = 0, and H(1) = 13 − 1 = 0.Evaluate the same rule at the other two inputs.
  3. The graph has points (−1, 0), (0, 0), and (1, 0), all on height 0.Each computed input-output pair is one graph point.
  4. H is a function, but not one-to-one.The formula gives one output per input, while the horizontal line at height 0 meets at least these three points.
Answer
  • H(−1) = 0.
  • H(0) = 0.
  • H(1) = 0.
  • H is a function, but not one-to-one.
Check The three arrows end at 0. That is permitted in a function but prevents output 0 from identifying one input.
Counterexamples: what it is not, and the tempting wrong moves
✗ Not this: Every cubic function is one-to-one because x3 is one-to-one.
Other cubic formulas can have extra terms. For x3 − x, inputs −1, 0, and 1 all give 0.
✓ Instead: Use the actual rule or graph. The toolkit cubic x3 is one-to-one, but H(x) = x3 − x is not.
Tips and tricks
  • Two different inputs with one shared output are enough to disprove one-to-one. You do not need to find every matching input.
  • With arrows: Three separate input arrows arrive at output 0. The function definition permits this; one-to-one does not.
  • With graph points: The three points have different first coordinates and the same second coordinate, so one level line contains all three.
Strategy: step by step
  1. Identify the input on the horizontal axis and the output on the vertical axis.
  2. Try vertical lines across the graph. One line meeting two distinct graph points proves it is not a function.
  3. If every vertical line meets at most once, the graph is a function. Some lines may miss the graph.
  4. For a function, try horizontal lines. One line meeting two distinct points proves it is not one-to-one.
  5. Passing every horizontal line proves one-to-one. State which test supports each conclusion.
Strategy
Check vertical, then horizontal
1
Does any vertical line meet two different graph points?
YesNot a function of x. Name that shared input and both outputs.
NoIf every vertical line has at most one contact, the graph is a function. Some lines may have no contact.
↓
2
Has the graph passed the function test?
YesNow look for a horizontal line meeting two or more graph points.
NoStop: it is already not a function of x, so do not call it a one-to-one function of x.
↓
3
Does any horizontal line have two or more contacts?
YesFunction, but not one-to-one. Name two different inputs and their common output.
NoIf every horizontal line has at most one contact, the function is one-to-one.
  1. Identify the input on the horizontal axis and the output on the vertical axis.
  2. Try vertical lines across the graph. One line meeting two distinct graph points proves it is not a function.
  3. If every vertical line meets at most once, the graph is a function. Some lines may miss the graph.
  4. For a function, try horizontal lines. One line meeting two distinct points proves it is not one-to-one.
  5. Passing every horizontal line proves one-to-one. State which test supports each conclusion.
Worked exampleA line, a V, and a circle

Decide whether each relation is a function of x and then, if it is a function, whether it is one-to-one: (a) y = x, (b) y = |x|, and (c) x2 + y2 = 1.

−22−22(−1, −1)(0, 0)(1, 1)
For y = x, each input has one output, and each output has one input.
−4−22424(−3, 3)(3, 3)
The horizontal level y = 3 meets the V twice.
(0, 1)
Top of the circle: input 0, output 1.
(0, −1)
Bottom of the same circle: input 0, output −1.
What it asks. Check one output per input for each relation; then check shared outputs for the ones that are functions.
Plan. For the line and V, count vertical and horizontal contacts. For the circle, compare the shown top and bottom points at the same input 0.
  1. (a) The diagonal line y = x has one point for each fixed x and one point for each fixed y. It passes both tests.The rule copies the input. Output 3 comes only from input 3, and the same statement works for every output.
  2. (b) The V-shaped graph of y = |x| has one height |x| for each input x, so it passes the vertical test.A fixed input has exactly one distance from 0.
  3. At height 3, the V has points (−3, 3) and (3, 3), so it fails the horizontal test.One output is shared by two distinct inputs.
  4. (c) At x = 0, the circle equation gives y = 1 or y = −1. It fails the vertical test.One vertical line meets two distinct points with the same input.
  5. Do not classify the circle relation as a one-to-one function.It has already failed the requirement to be a function of x.
Answer
  • (a) function and one-to-one.
  • (b) function, but not one-to-one.
  • (c) Not a function of x; therefore not a one-to-one function of x.
Check Use the equations independently: y = x recovers x = y; y = |x| gives two inputs, −3 and 3, for output 3; x2 + y2 = 1 gives two outputs for input 0.
Counterexamples: what it is not, and the tempting wrong moves
✗ Not this: Every vertical line must meet a function graph exactly once.
Inputs outside the domain have no graph point, so some vertical lines may miss it.
✓ Instead: Every vertical line must meet at most once.
✗ Not this: Passing one horizontal line proves the function is one-to-one.
Another height may have several inputs. On x2, height 0 has one match but height 4 has two.
✓ Instead: Every horizontal line must meet at most once; one failing height is enough to disprove it.
Tips and tricks
  • Use the memory cue V for vertical, the first function check. H holds the output height for the second check.
  • Intersects means meets at a point. A test line touching one included graph point counts as one intersection.
  • Write not a function with its shared input and different outputs. Write not one-to-one with its different inputs and shared output.
Trap. Using the horizontal line test to decide function status. Check vertical first, then horizontal, and label the conclusion from each test.