# Horizontal Line Test

How to use the horizontal line test to see if a function is one-to-one: definition, how to test, examples, and their solutions.

## One-to-one

One-to-one means [one input], [one unique output].

So, if each *x* is mapped to a unique *y*,

then the function is one-to-one.

## Not One-to-one

If two or more *x*-s are mapped to the same *y*,

then the function is not one-to-one.

In this picture,*x*_{1} and *x*_{2} are mapped to the same *y*_{1}.

So this function is not one-to-one.

## How to Test

To do the test:

Make a horizontal line

on each point of the graph.

The horizontal line means [one unique output], *y*.

(To make a horizontal line,

you can use your pencil, ruler, etc.)

Then see if each vertical line shows [one input], *x*.

If every horizontal line shows one input,

then the graph passes the test.

Then the function is one-to-one.

Just think it as

the horizontal version of the vertical line test.

Vertical line test

Actually, the horizontal line test is also used

to see if a function has an inverse function.

To find out the details,

see the inverse function page below.

Inverse functions - Relationship between the horizontal line test

If there's any horizontal line

that does not show [one input],

then the function fails the test.

Then the function is not one-to-one.

## Example 1

Starting from the bottom,

do the horizontal line test.

Every horizontal line shows one input.

So the function passes the horizontal line test.

Then the function is one-to-one.

## Example 2

At the origin,

the horizontal line shows one input.

So, at the origin,

the function passes the horizontal line test.

But if you make a horizontal line like this,

it shows two inputs.

So the graph fails the horizontal line test.

So this function is not one-to-one.

## Example 3

If you make a horizontal line like this,

the horizontal line shows one input.

So, for this *y* value,

the function passes the horizontal line test.

But if you make a horizontal line like this,

it shows two inputs.

So the graph fails the horizontal line test.

So this function is not one-to-one.