Try it yourself · Class 12 Maths · Relations and Functions

One-one and onto: slide a horizontal line and count where it meets the graph

A function from to is one-one if different inputs give different outputs, and onto if every real number is an output. The horizontal line test shows both at once: count how often the line meets the graph.

The blue curve is for real . The orange line is ; green dots mark the values with . A function is one-one if no horizontal line meets it twice, and onto if every horizontal line meets it at least once.

The simulation needs JavaScript; everything it shows is explained below.

What to change

  • Function tabs: , , with only, or .
  • Horizontal line : from -4 to 8 in steps of 0.5 (start at 4).
  • Reading the result: the readout counts the hits and says whether the function is one-one, onto and bijective.

What to watch

  • at = 4: one hit at = 1.59, and one hit for every , so it is one-one and onto, hence bijective.
  • at = 4: two hits, = -2 and = 2, so it is not one-one; at = -2 there is no hit, so it is not onto .
  • with at = 4: one hit at = 2, so it is one-one; but at = -2 there is no hit, so it is still not onto .
  • at = 4: one hit at = 2; at = -2 no hit, because is always positive: one-one but not onto.

The formula

A bijective function is both one-one and onto, and only a bijective function has an inverse.

Try these questions

Work each one out with the simulation, tap to see the answer, then try the chapter quiz.

  1. CBSE

    Show that the function defined by
    is one-one and onto, where is the set of all
    non-zero real numbers. Is the result true, if the domain is
    replaced by with co-domain being same as ?
    Show the answer
    is one-one and onto on . With domain it remains one-one but is not onto, so the result is not true.
  2. CBSE

    Show that the Modulus Function , given by
    , is neither one-one nor onto.
    Show the answer
    is neither one-one nor onto.
  3. Bihar Board 2018

    Examine whether the function is one-one(injective) if
    Show the answer
    one-one or injective

More to try in Relations and Functions

Every simulation in the Lab