moomoomath logo header
lime green horizontal line
Welcome to MooMooMath
Quick Math Homework Help
Geometry Coach
geometry coach lesson plans
In order for a  graph graph of an equation to be a function it must pass the vertical line test. If it passes the test it means that each x input has a unique y output.

If the shape touches any vertical line more than once it is not a function. Some teachers will call this the "pencil test." 















vertical line test on graph paper/this is not a function
vertical line test on graph paper
pencil vertical line test
pencil for function pencil test
A function will pass the horizontal line test if for each y value (the range) there is only one x value ( the domain)  which is the definition of a function.

If a function passes the vertical line test, and the horizontal line test, it is 1 to 1.

Look at the graph below. Notice that graph touches the vertical line at 2 and -2 when it intersects the x axis at 4. Therefore when x = 4 there are  two different y-values (2 and -2). For any input x, a function can only have one corresponding y value.  So this function FAILS the vertical line test.
The vertical line test, also called a pencil test, is a simple test used to determine if a graph of an equation is a function. 

If you draw a vertical line on the coordinate plane where the equation is graphed, and move this line from left to right, it should only touch the graph once, in order for the graph to be a function. ( a pencil works perfect for the vertical line)

If the graph intersects the vertical line more than once,  it is not a function, and any x value may have two y values.

Related resources Vertical line test and Horizontal line Test

white box/what is a function?
video tutorial function-vertical line test
black line

Vertical Line Test

The pencil only touches the function graph once, so it is a Function!
The pencil touches the line three times, fails vertical line test, so it is not a Function!
Touches Here
Touches Here

The Pencil Test

Touches Here

Why does the function-vertical line test work?

graph that failed function-vertical test

Horizontal Line Test

fail horizontal line test
horizontal line test
The vertical line test can used with a the horizontal line test to determine if the original function has an inverse function. (one to one) 

The horizontal line test works similar to the vertical line test. 

This time you draw a horizontal line, and if the line touches the original function in more than one place it fails the horizontal line test, and the inverse of the function is not a function.

 If a graph of a function passes both the vertical line test and the horizontal line test then the graph is " one to one" and is written  f^ -1(x).
This graph passes the vertical line test so it is a function, but fails the horizontal line test

Therefore, the graph is not one to one and the inverse of this graph is not a function.
This graph passes the vertical line test so it is a function, and passes the horizontal line test

Therefore, the graph is  "one to one," and the inverse of this graph is also  a function.

Why does the Horizontal Line Test work?

graph of a function/function-vertical line function also called the pencil test
pencil
Hi Welcome to MooMooMath. Today we are going to talk about “What is a function?” We have another video that explains it from ordered pairs, but now we are going to look at the graphs. One of these drawings is a function and one of these is not. See if you can guess which is a function. Now let’s go over the rules of a function, and then we will come back and answer that. The rules are this, you are going to take the vertical line test, or some teachers call it the pencil test, because they drag the pencil across vertically to test it. This one on the left does pass the test because it does not touch more than one time. Notice I’m running my pencil across (my vertical line) and my graph is only touching in one place. Over here (points to graph on the right) the pencil touches the graph in two places. I think of it as shocking you by touching two points so it shocks you. So let’s go back to our two problems. One is a function, one is not. I will apply my vertical line test and this one (graph on the left) is passing the test but this one (graph on right) it is touching in two places. I start getting shocked because I’m touching the graph in two places. Because it fails the vertical line test, it is not a function and this one (graph on the left) is a function. Hope the vertical line test, pencil test helps you out.