moomoomath logo header
lime green horizontal line
Welcome to MooMooMath
study skills A teachers secret guide to your best grades
Master the 7 pillars of school success

Improve your grades and lower your stress
A-Z Video List
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?
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