The green line is the line we will use to run the test. It’s basically a horizontal line that can cross or intersect a graph in at least one point.
In the picture above, the line intersects the graph in two points and these points are (-1, -1) and (2, -1).
Horizontal line test and one-to-one function
If a horizontal line test cuts the graph in more than one point, the graph is not one to one. Therefore, the above diagram is not one to one as the line intersects the diagram in two points.
See below another test for horizontal lines that only cuts the graph at one point.
Here we draw two lines to emphasize the fact that no matter how many horizontal lines you draw, this graphic will only ever be cut or intersected in one point.
Since in every horizontal line test the graph is only intersected at one point, we say that the graph immediately above it is one to one.
What is the difference between a horizontal and a vertical line test?
The first diagram we drew above is not one to one because the horizontal line crossed the two points (-1, -1) and (2, -1). As you can see here, two different x-values - 1 and 2 – are mapped to the same y-value or -1