Class 12 Maths, Worked in Full Past papersGet updates
Chapter 1 · Relations and Functions

Example 8: f(x)=2xf(x)=2x on N\N⁠: one-one but not onto

ExamplesTypes of functions · Section 1.3
The question

Show that the function f:N→Nf : \N \to \N⁠, given by f(x)=2xf(x) = 2x⁠, is one-one but not onto.

Exam answer

One-one: Let x1,x2∈Nx_1, x_2 \in \N with f(x1)=f(x2)f(x_1) = f(x_2)⁠. Then

f(x1)=f(x2)⇒2x1=2x2⇒x1=x2\begin{aligned} f(x_1) = f(x_2) &\Rightarrow 2x_1 = 2x_2 \\ &\Rightarrow x_1 = x_2 \end{aligned}

Thus ff is one-one.

Not onto: Take 1∈N1 \in \N⁠. If f(x)=1f(x) = 1⁠, then 2x=12x = 1⁠, so x=12∉Nx = \frac12 \notin \N⁠. So 1 has no pre-image in N\N⁠. Thus ff is not onto.

Hence ff is one-one but not onto.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Doubling never sends two different numbers to the same place, because we can always undo it by halving: if 2x1=2x22x_1 = 2x_2⁠, halve both sides and x1=x2x_1 = x_2⁠. So ff is one-one. But the outputs of doubling a natural number are only the even numbers 2,4,6,…2, 4, 6, \dots To land on an odd number such as 1 we would need x=12x = \tfrac12⁠, which is not in the domain N\N⁠. So ff is not onto. Whether a function is onto depends on the sets it is defined between, not only on its formula.

Given, to show, and the plan
Given
The rule f(x)=2xf(x) = 2x⁠, with domain N={1,2,3,… }\N = \{1,2,3,\dots\} and codomain N\N⁠.
To show
(a) ff is one-one: f(x1)=f(x2)f(x_1) = f(x_2) forces x1=x2x_1 = x_2⁠. (b) ff is not onto: some element of the codomain N\N is not an image.
Plan
(1) Confirm ff really maps N\N into N\N and list a few values. (2) Prove one-one for arbitrary x1,x2x_1, x_2⁠. (3) Disprove onto with one explicit element, 1, and show why nothing maps to it. (4) Describe the full range, to see exactly what is missed.

Basics you need

1Domain and codomain

In f:X→Yf : X \to Y⁠, the domain XX is the set of allowed inputs and the codomain YY is the set in which outputs are allowed to land. Here both are N={1,2,3,… }\N = \{1, 2, 3, \dots\}⁠, so inputs like 12\tfrac12 or 00 are not allowed. Basics: what a function is

2One-one (injective)

ff is one-one if for every x1,x2∈Xx_1, x_2 \in X⁠, f(x1)=f(x2)f(x_1) = f(x_2) implies x1=x2x_1 = x_2⁠. In words: different inputs always give different outputs. Basics: one-one and onto

3Onto (surjective)

ff is onto if for every y∈Yy \in Y there is some x∈Xx \in X with f(x)=yf(x) = y⁠. Equivalently, the range of ff equals the whole codomain. To show onto fails, it is enough to find one y∈Yy \in Y that no input reaches.

4Proving and disproving

A "for every" claim (like one-one) is proved with arbitrary letters, never with a few examples. A "for every" claim (like onto) is disproved by one counterexample. Basics: proving and disproving

5Even numbers

A natural number is even when it equals 2k2k for some k∈Nk \in \N⁠. The odd numbers 1,3,5,…1, 3, 5, \dots are exactly those that are not of this form. Basics: integers, even and odd

Solution

  1. Check that ff maps N\N into N\N⁠, and list some values

    If xx is a natural number, then 2x=x+x2x = x + x is a natural number too, so every output lies in the codomain N\N⁠. Each input gives exactly one output, so ff is a genuine function N→N\N \to \N⁠. A few values:

    xx123456
    f(x)=2xf(x) = 2x24681012

    Two things stand out: the outputs never repeat, and the odd numbers 1,3,5,…1, 3, 5, \dots never appear.

    inputs x (domain N)outputs 2x (codomain N); rose circles are never reached123456123456789101112……
    Each input xx sends one arrow to 2x2x⁠. No output receives two arrows (one-one), but every odd output, shown in rose, receives none (not onto).
    Computing a few values first shows what to expect before we try to prove anything: the table already suggests "one-one: yes" and "onto: no". The check that outputs lie in N\N matters because the question names the codomain N\N⁠; if some output fell outside it, ff would not be a function N→N\N \to \N at all.
    N\N is closed under addition: the sum of two natural numbers is a natural number. Since 2x=x+x2x = x + x⁠, doubling stays inside N\N⁠.
  2. One-one: equal outputs force equal inputs

    Take arbitrary x1,x2∈Nx_1, x_2 \in \N and suppose f(x1)=f(x2)f(x_1) = f(x_2)⁠. Then

    f(x1)=f(x2)⇒2x1=2x2⇒x1=x2.\begin{aligned} f(x_1) = f(x_2) &\Rightarrow 2x_1 = 2x_2 \\ &\Rightarrow x_1 = x_2. \end{aligned}

    (The second implication divides both sides by 2.)

    So whenever two inputs have the same image, they are the same input. Hence ff is one-one.

    Definition 5 is a statement about every pair x1,x2x_1, x_2⁠, so we use letters that could stand for any natural numbers. We start from the hypothesis f(x1)=f(x2)f(x_1) = f(x_2) and derive the conclusion x1=x2x_1 = x_2⁠. Dividing by 2 is valid because 2≠02 \ne 0⁠: if two numbers are equal, half of one equals half of the other.
    Cancellation: if c≠0c \ne 0 and c a=c bc\,a = c\,b⁠, then a=ba = b⁠. Here c=2c = 2⁠. This is exactly the step that would fail for a constant function like g(x)=0⋅xg(x) = 0\cdot x⁠, which is not one-one.
  3. Not onto: nothing maps to 1

    To be onto, every element of the codomain N\N must be an image. Look at 1∈N1 \in \N⁠. If some xx had f(x)=1f(x) = 1⁠, then

    2x=1⟹x=12.2x = 1 \quad\Longrightarrow\quad x = \frac{1}{2}.

    But 12\tfrac12 is not a natural number, so it is not in the domain. The equation 2x=12x = 1 has only this one solution, so no x∈Nx \in \N satisfies f(x)=1f(x) = 1⁠. Hence 1 is not the image of any element of the domain, and ff is not onto.

    "Onto" says for every yy in the codomain there is a preimage. One yy without a preimage destroys that claim, so a single counterexample is a complete proof. We must show the preimage is missing, not just that we failed to find one: solving 2x=12x = 1 gives the only possible candidate, x=12x = \tfrac12⁠, and it lies outside N\N⁠. (A different argument works too: for every x∈Nx \in \N⁠, 2x≥2>12x \ge 2 > 1⁠.)
    When solving f(x)=yf(x) = y to test onto, always check that the solution belongs to the domain. The algebra happily produces 12\tfrac12⁠; the domain N\N is what rules it out. Basics: one-one and onto
  4. Describe the range exactly

    The range of ff is the set of all its outputs:

    Range of f={2x:x∈N}={2,4,6,8,… },\begin{aligned} \text{Range of } f &= \{2x : x \in \N\} \\ &= \{2, 4, 6, 8, \dots\}, \end{aligned}

    the set of even natural numbers. Every even number 2k2k is reached (by x=kx = k⁠), and no odd number is reached, because for an odd yy the only solution of 2x=y2x = y is x=y2x = \tfrac{y}{2}⁠, which is not a whole number. So the range is a proper part of N\N⁠, and by the Remark after Definition 6 (ff is onto exactly when the range equals the codomain), ff is not onto. Infinitely many elements of the codomain are missed, not just 1.

    Stating the range shows the full picture behind the single counterexample. It also explains which change of sets would make ff onto: if the codomain were the set of even natural numbers, ff would be onto (and then a bijection).
    Range versus codomain: the codomain is declared in the question (f:N→Nf : \N \to \N⁠); the range is what the rule actually produces. Onto means they coincide.
  5. Conclude, and compare with Example 9

    ff is one-one (Step 2) and not onto (Step 3). So f:N→N, f(x)=2xf : \N \to \N,\ f(x) = 2x is one-one but not onto.

    The very next example in the book, Example 9, uses the same formula f(x)=2xf(x) = 2x on R\R instead of N\N⁠. There, x=12x = \tfrac12 is allowed, ff becomes onto, and the function is a bijection. The formula is the same; the sets changed the answer.

    This example is also the textbook's evidence, in the Remark after Example 14, that on an infinite set a one-one function from the set to itself need not be onto. For finite sets that cannot happen (Examples 13 and 14).
Result

f(x)=2xf(x) = 2x from N\N to N\N is one-one, since 2x1=2x2⇒x1=x22x_1 = 2x_2 \Rightarrow x_1 = x_2⁠, and not onto, since 1∈N1 \in \N would need the preimage x=12∉Nx = \tfrac12 \notin \N⁠. Its range is the set of even natural numbers {2,4,6,… }\{2, 4, 6, \dots\}⁠.

Play this problem

Balloon Pop, in the chapter’s Games tab. Machine 1 is f(x) = 2x: hunt for a balloon nothing can hit. Play Balloon Pop ↗

Check it with numbers

Take the inputs 1,2,…,1001, 2, \dots, 100⁠. Their images 2,4,…,2002, 4, \dots, 200 are 100 different numbers, as one-one predicts. Among the numbers 1,2,…,2001, 2, \dots, 200⁠, exactly the 100 odd ones are never hit, and the smallest of them is 1, as the counterexample says. Also f(37)=74f(37) = 74⁠, and 7474 has no other preimage: 2x=742x = 74 only for x=37x = 37⁠.

Common mistakes
  1. Writing x=y2x = \tfrac{y}{2} and declaring ff onto. That is the argument for R\R (Example 9). On N\N the preimage y2\tfrac y2 must itself be a natural number, and for odd yy it is not.
  2. Proving one-one with examples. "f(1)=2f(1) = 2⁠, f(2)=4f(2) = 4⁠, all different" checks a few pairs only. The proof must use arbitrary x1,x2x_1, x_2⁠.
  3. Running the implication backwards. One-one is f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2⁠. The direction x1=x2⇒f(x1)=f(x2)x_1 = x_2 \Rightarrow f(x_1) = f(x_2) is true for every function and proves nothing.
  4. Forgetting that 0∉N0 \notin \N here. The book's N\N starts at 1. That does not change this answer, but it matters in other questions.
What to take away
  1. One-one: assume f(x1)=f(x2)f(x_1) = f(x_2) and work towards x1=x2x_1 = x_2⁠. For f(x)=axf(x) = ax with a≠0a \ne 0⁠, cancelling aa does it in one line.
  2. Not onto: name one element of the codomain and show that the only candidate preimage lies outside the domain.
  3. One-one and onto are properties of the triple (rule, domain, codomain). Change the sets and the answer can change.

Every fact used, and where it comes from

FactUsed inSource
Definition of one-one (injective)Step 2Definition 5, Section 1.3 (Lesson: types of functions)
Definition of onto (surjective)Steps 3, 4Definition 6, Section 1.3
ff onto   ⟺  \iff range of ff = codomainStep 4Remark after Definition 6, Section 1.3
N\N closed under addition, so 2x∈N2x \in \NStep 1Properties of natural numbers
Cancelling a non-zero factor: 2x1=2x2⇒x1=x22x_1 = 2x_2 \Rightarrow x_1 = x_2Step 2Arithmetic
2x=1  ⟺  x=122x = 1 \iff x = \tfrac12⁠, and 12∉N\tfrac12 \notin \NStep 3Solving a linear equation
Infinite sets: one-one need not imply ontoStep 5Remark after Example 14, Section 1.3
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →