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

Example 10: Onto but not one-one on N\N

ExamplesTypes of functions · Section 1.3
The question

Show that the function f:N→Nf : \N \to \N⁠, given by f(1)=f(2)=1f(1) = f(2) = 1 and f(x)=x−1f(x) = x - 1⁠, for every x>2x > 2⁠, is onto but not one-one.

Exam answer

Not one-one: f(1)=f(2)=1f(1) = f(2) = 1 but 1≠21 \ne 2⁠. Thus ff is not one-one.

Onto: Let y∈Ny \in \N⁠. If y=1y = 1⁠, then f(1)=1=yf(1) = 1 = y⁠. If y≥2y \ge 2⁠, then y+1∈Ny + 1 \in \N⁠, y+1>2y + 1 > 2⁠, and

f(y+1)=(y+1)−1=yf(y + 1) = (y + 1) - 1 = y

So every y∈Ny \in \N has a pre-image. Thus ff is onto.

Hence ff is onto but not one-one.

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

The one idea this problem is built on

The rule "subtract 1" shifts every number from 3 onwards down by one step: 3→2, 4→3, 5→4,…3 \to 2,\ 4 \to 3,\ 5 \to 4, \dots That covers every output from 2 upwards. The only output left to cover is 1, and the rule sends two inputs there, 1 and 2. So every output is reached (onto), but the output 1 is reached twice (not one-one). This is the mirror image of Example 8: there, a function from N\N to itself was one-one but not onto.

Given, to show, and the plan
Given
A function from N\N to N\N defined in two pieces: f(1)=f(2)=1f(1) = f(2) = 1⁠, and f(x)=x−1f(x) = x - 1 when x>2x > 2⁠.
To show
(a) ff is not one-one. (b) ff is onto.
Plan
(1) Check the pieces cover every natural number and give outputs in N\N⁠. (2) Disprove one-one with one explicit pair. (3) Prove onto for an arbitrary yy⁠, in two cases: y=1y = 1 and y≠1y \ne 1⁠. (4) Conclude.

Basics you need

1A function given in pieces

Each input must be covered by exactly one piece, and each output must lie in the codomain. To evaluate f(x)f(x)⁠, first decide which piece xx belongs to. Basics: what a function is

2One-one and onto

One-one: f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2⁠. Onto: for every yy in the codomain there is an xx in the domain with f(x)=yf(x) = y⁠. Basics: one-one and onto

3Disproving and proving

One pair x1≠x2x_1 \ne x_2 with f(x1)=f(x2)f(x_1) = f(x_2) disproves one-one. Onto, a "for every yy" claim, needs an argument for an arbitrary yy⁠. Basics: proving and disproving

4Proof by cases

If every y∈Ny \in \N is either 11 or at least 22⁠, proving the claim separately for these two cases proves it for all yy⁠. The cases must cover everything.

Solution

  1. Check that ff is a well-defined function N→N\N \to \N

    Every natural number is either 1, or 2, or greater than 2, and exactly one of these holds. So exactly one rule applies to each input. The outputs lie in N\N⁠: f(1)=f(2)=1∈Nf(1) = f(2) = 1 \in \N⁠, and if x>2x > 2 then x≥3x \ge 3⁠, so x−1≥2x - 1 \ge 2 is a natural number. A few values:

    xx1234567
    rule usedf(1)=1f(1)=1f(2)=1f(2)=13−13-14−14-15−15-16−16-17−17-1
    f(x)f(x)1123456
    inputs x (domain N)outputs f(x) (codomain N); every output is reached1234567123456two arrows land here……
    Inputs 1 and 2 (rose) both go to 1; every input x≥3x \ge 3 moves one place left to x−1x - 1⁠. Every output receives an arrow (onto), but the output 1 receives two (not one-one).
    The two special values f(1)f(1) and f(2)f(2) are there for a reason: the rule x−1x - 1 cannot be used at x=1x = 1⁠, because 1−1=0∉N1 - 1 = 0 \notin \N⁠. Checking that each piece stays inside N\N shows the definition makes sense. The table and diagram then suggest the answer before we prove it.
    In this book N={1,2,3,… }\N = \{1, 2, 3, \dots\} does not contain 0. That is exactly why f(1)f(1) needs its own definition.
  2. Not one-one: 1 and 2 share an image

    From the definition, f(1)=1f(1) = 1 and f(2)=1f(2) = 1⁠. So

    f(1)=f(2)but1≠2.f(1) = f(2) \qquad\text{but}\qquad 1 \ne 2.

    Two different inputs have the same image, so ff is not one-one.

    One-one claims that for every pair x1,x2x_1, x_2⁠, equal images force equal inputs. A single pair that violates this is a complete disproof, so no general argument is needed. Here the pair is handed to us by the definition itself.
    "Many-one" is the book's name for a function that is not one-one (Definition 5). This ff is many-one.
  3. Onto, case y≠1y \ne 1⁠: use the input y+1y + 1

    Take an arbitrary y∈Ny \in \N with y≠1y \ne 1⁠, so y≥2y \ge 2⁠. We want xx with f(x)=yf(x) = y⁠. Only the piece x−1x - 1 produces values ≥2\ge 2⁠, so solve x−1=yx - 1 = y⁠, giving the candidate x=y+1x = y + 1⁠. Check it:

    • y+1∈Ny + 1 \in \N⁠, and y+1≥3>2y + 1 \ge 3 > 2⁠, so the piece f(x)=x−1f(x) = x - 1 is the one that applies to it.
    • f(y+1)=(y+1)−1=yf(y + 1) = (y + 1) - 1 = y⁠. ✓

    So every y≥2y \ge 2 is an image.

    The check "y+1>2y + 1 > 2" is essential and easy to skip. The formula x−1x - 1 is only valid for x>2x > 2⁠, so before using it on y+1y+1 we must confirm that y+1y + 1 is in that piece. It is, because y≥2y \ge 2⁠. (The book chooses x=y+1x = y + 1 and checks f(y+1)=y+1−1=yf(y+1) = y + 1 - 1 = y⁠.)
    With a piecewise function, the candidate preimage must fall in the piece whose formula you used to find it.
  4. Onto, case y=1y = 1⁠: use the input 1

    The remaining element of the codomain is y=1y = 1⁠. The recipe of Step 3 would give x=2x = 2⁠, but 2 is not in the piece x>2x > 2⁠, so we cannot use that formula. Instead, the definition gives directly

    f(1)=1.f(1) = 1.

    (So does f(2)=1f(2) = 1⁠.) Hence 1 is also an image. Every y∈Ny \in \N is either 1 or at least 2, and both cases are done, so ff is onto.

    The two cases y=1y = 1 and y≥2y \ge 2 together cover all of N\N⁠, so proving each one proves onto for every yy⁠. The value 1 needs separate treatment for the same reason f(1)f(1) and f(2)f(2) needed separate definitions: the general formula does not reach it.
    Proof by cases: split the possibilities into cases that cover everything, then prove each. Basics: proving and disproving
  5. Conclude, and compare with Examples 8, 13 and 14

    ff is onto (Steps 3 and 4) and not one-one (Step 2). So ff is onto but not one-one.

    For a function from a finite set to itself this could never happen: Example 13 shows that onto forces one-one on {1,2,3}\{1, 2, 3\}⁠. The textbook's Remark after Example 14 points to this example and Example 8 as proof that on an infinite set like N\N⁠, onto and one-one can come apart.

    Why the infinite set allows it: ff "wastes" one input by sending both 1 and 2 to 1, yet still has infinitely many inputs left to cover the infinitely many outputs 2,3,4,…2, 3, 4, \dots A finite set has no such spare supply.
Result

ff is onto: 1=f(1)1 = f(1)⁠, and every y≥2y \ge 2 equals f(y+1)f(y + 1)⁠. It is not one-one: f(1)=f(2)=1f(1) = f(2) = 1 with 1≠21 \ne 2⁠.

Check it with numbers

Apply ff to the inputs 1,2,…,1011, 2, \dots, 101⁠. The outputs are 1,1,2,3,…,1001, 1, 2, 3, \dots, 100⁠: every number from 1 to 100 appears (onto, as far as these inputs reach), and 101 inputs give only 100 different outputs, so some output must repeat (it is 1). For a single value: y=58y = 58 should come from x=59x = 59⁠, and indeed 59>259 > 2⁠, so f(59)=58f(59) = 58⁠. ✓

Common mistakes
  1. Using x=y+1x = y + 1 for y=1y = 1 as well. It gives x=2x = 2⁠, and the formula x−1x - 1 does not apply at 2. The answer f(2)=1f(2) = 1 happens to be right, but by the special rule, not by the formula.
  2. Forgetting the case y=1y = 1 entirely. Then onto has only been shown for y≥2y \ge 2⁠.
  3. Thinking "onto" needs one-one. Onto only asks that every output be reached at least once; reaching one output twice is allowed.
  4. Writing f(1)=1−1=0f(1) = 1 - 1 = 0⁠. The formula x−1x - 1 is only for x>2x > 2⁠, and 0 is not in N\N anyway.
What to take away
  1. For a piecewise function, prove onto piece by piece, checking that each candidate input lies in the piece whose formula you used.
  2. This example (onto, not one-one) and Example 8 (one-one, not onto) show that on infinite sets the two properties are independent.
  3. Pictures help: an arrow diagram shows at a glance which outputs get no arrow and which get two.

Every fact used, and where it comes from

FactUsed inSource
N={1,2,3,… }\N = \{1, 2, 3, \dots\}⁠; x>2⇒x−1≥2x > 2 \Rightarrow x - 1 \ge 2Step 1Natural numbers
Definition of one-one; "many-one"Step 2Definition 5, Section 1.3 (Lesson: types of functions)
Definition of ontoSteps 3, 4Definition 6, Section 1.3
One counterexample disproves a "for all" statementStep 2Logic of quantifiers
Proof by cases (y=1y = 1 or y≥2y \ge 2⁠)Steps 3, 4Logic
Infinite sets: onto need not imply one-oneStep 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 →