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

Example 7: Roll numbers: one-one but not onto

ExamplesOne-one and onto functions · Section 1.3
The question

Let A be the set of all 50 students of Class X in a school. Let f:A→Nf : A \to \N be function defined by f(x)=roll number of the student xf(x) = \text{roll number of the student } x⁠. Show that ff is one-one but not onto.

Exam answer

One-one: Let x1,x2∈Ax_1, x_2 \in A with f(x1)=f(x2)f(x_1) = f(x_2)⁠. Then the students x1x_1 and x2x_2 have the same roll number. Two different students of a class cannot have the same roll number, so x1=x2x_1 = x_2⁠. Thus ff is one-one.

Not onto: Without loss of generality, let the roll numbers be 1,2,…,501, 2, \ldots, 50⁠. Then 51∈N51 \in \N is not the roll number of any student, so 51 has no pre-image in AA⁠. 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

One-one asks: do different inputs always get different outputs? Onto asks: is every element of the codomain used? Roll numbers are issued so that no two students share one, so ff is one-one. But 50 students can use up at most 50 natural numbers, while N\N has infinitely many, so some natural numbers (such as 51) are nobody's roll number, and ff is not onto. The codomain N\N is simply far too big to be filled.

Given, to show, and the plan
Given
A = the 50 students of Class X; f:A→Nf : A\to\N⁠, f(x)f(x) = the roll number of student xx⁠.
To show
(a) ff is one-one; (b) ff is not onto.
Plan
(1) Note why ff is a function at all. (2) One-one: take two different students and show their images differ. (3) Not onto: exhibit one natural number that is not the image of any student, and explain why such a number must exist whatever the roll numbers are.

Basics you need

1Function, domain, codomain, range

f:A→Bf : A\to B assigns to each x∈Ax\in A exactly one f(x)∈Bf(x)\in B⁠. A is the domain, B the codomain, and the range is the set of outputs actually produced, {f(x):x∈A}\{f(x) : x\in A\}⁠, which is a subset of B. Basics: what a function is

2One-one (injective)

Definition 5: ff is one-one if the images of distinct elements are distinct, that is f(x1)=f(x2)⇒x1=x2f(x_1) = f(x_2) \Rightarrow x_1 = x_2⁠. Equivalently, x1≠x2⇒f(x1)≠f(x2)x_1 \ne x_2 \Rightarrow f(x_1)\ne f(x_2)⁠. Basics: one-one and onto

3Onto (surjective)

Definition 6: f:X→Yf : X\to Y is onto if every y∈Yy\in Y is the image of some x∈Xx\in X⁠. By the Remark after Definition 6, ff is onto exactly when range of ff = Y. To show it is not onto, one yy that is never an output is enough.

4A finite set cannot fill an infinite one

A function on a set with 50 elements produces at most 50 different outputs. N={1,2,3,… }\N = \{1,2,3,\dots\} is infinite, so such a function can never have range equal to N\N⁠. Basics: counting choices

Solution

  1. ff really is a function from A to N\N

    Each student of the class is given exactly one roll number, and roll numbers are natural numbers. So every x∈Ax\in A is assigned exactly one value f(x)∈Nf(x)\in\N⁠, which is what a function A→NA\to\N requires.

    Before asking whether ff is one-one or onto, it is worth confirming that ff is a function. Here that is a fact about how schools work: no student is left without a roll number, and no student has two.
    A function assigns exactly one output to each input (Basic 1).
  2. One-one: different students have different roll numbers

    Take any two students x1,x2∈Ax_1, x_2 \in A with x1≠x2x_1 \ne x_2⁠. A roll number is issued to identify one student, so no two different students of the class share a roll number. Hence

    x1≠x2  ⇒  f(x1)≠f(x2).x_1 \ne x_2 \;\Rightarrow\; f(x_1) \ne f(x_2).

    Equivalently, if f(x1)=f(x2)f(x_1) = f(x_2)⁠, the two students have the same roll number, so they are the same student: x1=x2x_1 = x_2⁠. Therefore ff is one-one.

    One-one is a claim about every pair of different inputs, so we take an arbitrary pair x1≠x2x_1 \ne x_2⁠. The mathematical content is just Definition 5; the fact that makes it true comes from the situation described (the purpose of a roll number is to tell students apart). The contrapositive form "f(x1)=f(x2)⇒x1=x2f(x_1)=f(x_2) \Rightarrow x_1=x_2" is the form the textbook writes after "i.e." in Definition 5, so we show that both forms give the same conclusion.
    "x1≠x2⇒f(x1)≠f(x2)x_1\ne x_2 \Rightarrow f(x_1)\ne f(x_2)" and "f(x1)=f(x2)⇒x1=x2f(x_1)=f(x_2) \Rightarrow x_1=x_2" say the same thing (one is the contrapositive of the other). Basics: how to prove and disprove
  3. Not onto: 51 is nobody's roll number

    As the textbook says, we may assume the roll numbers are 1,2,…,501, 2, \dots, 50 (see Step 4 for why this assumption costs nothing). Then the range of ff is

    range of f={f(x):x∈A}={1,2,3,…,50}.\text{range of } f = \{f(x) : x\in A\} = \{1, 2, 3, \dots, 50\}.

    The natural number 5151 is in the codomain N\N but not in this set: no student has roll number 51, so there is no x∈Ax\in A with f(x)=51f(x) = 51⁠. Hence ff is not onto. (So are 52,53,…52, 53, \dots⁠; one is enough.)

    AmanBinaChetanZoya ⋮⋮ 12350 5152, 53, …no arrow A: 50 students N: codomain f = roll number
    Each student sends exactly one arrow, and no two arrows land on the same number: one-one. But only 50 numbers ever receive an arrow, and every number from 51 on receives none: not onto.
    "Onto" is a "for every yy in the codomain" claim, so to deny it we need one yy that is missed. The textbook's solution writes "image of any element of X under ff"; the domain in this example is called A, so read X as A there (it is a slip in the book's wording, not a change in the mathematics).
    Remark after Definition 6: f:X→Yf : X\to Y is onto if and only if range of ff = Y. Here range ={1,…,50}≠N= \{1,\dots,50\} \ne \N⁠.
  4. Why "without loss of generality" is safe

    Suppose the school used any other 50 different natural numbers as roll numbers, say r1<r2<⋯<r50r_1 < r_2 < \dots < r_{50}⁠. Then the range of ff is {r1,…,r50}\{r_1, \dots, r_{50}\}⁠, and the natural number r50+1r_{50} + 1 is larger than every roll number, so it is not a roll number at all. Again some element of N\N is not an image, and ff is not onto.

    More simply: a set of 50 students has at most 50 images, and N\N is infinite, so the range can never be all of N\N⁠.

    The phrase "without loss of generality" means "the special case we pick does not affect the conclusion". This step shows why: the argument does not depend on which 50 numbers are used. Only the particular missing number (51, or r50+1r_{50}+1⁠) changes.
    A function defined on a set of nn elements has at most nn different outputs (Basic 4). Every finite set of natural numbers has a largest element, and one more than it is a natural number not in the set.
  5. Conclude

    ff is one-one (Step 2) and not onto (Steps 3 and 4). So ff is one-one but not onto, and in particular it is not bijective (Definition 7).

    One-one and onto are separate properties. Here the first holds and the second fails, purely because the codomain N\N is much larger than the domain. If we shrank the codomain to B={1,…,50}B = \{1,\dots,50\}⁠, the same rule would be a bijection A→BA\to B⁠: the properties depend on the codomain, not just on the rule.
    Bijective means one-one and onto (Definition 7). Lesson: types of functions
Result

No two students share a roll number, so different students have different images: ff is one-one. Only 50 natural numbers are roll numbers, so, for example, 51∈N51\in\N is not the image of any student: ff is not onto.

Check it with numbers

With roll numbers 1 to 50: the range has 5050 elements and contains no number from 5151 to 999999 (or beyond). If instead the roll numbers were 50 random different numbers below 10000, the largest one plus 1 is always missing; the verification script tries 200 such random choices and finds the missing number every time. A function on 50 inputs never has more than 50 different outputs.

Common mistakes
  1. Confusing range and codomain. The codomain is N\N (stated in f:A→Nf : A\to\N⁠); the range is the set of roll numbers actually used. Onto means these two are equal.
  2. Proving one-one with one pair of students. "Aman has 1 and Bina has 2" checks one pair; the argument must hold for every pair of different students.
  3. Thinking "not onto" needs the roll numbers to be 1 to 50. Any 50 roll numbers leave infinitely many natural numbers unused.
  4. Writing "51 is not in A". The point is that 51 is in the codomain N\N but not in the range; A is a set of students, not numbers.
What to take away
  1. One-one: different inputs, different outputs. Onto: every codomain element is an output.
  2. A function from a finite set to an infinite set can be one-one but is never onto.
  3. Whether a function is onto depends on the codomain: the same rule onto {1,…,50}\{1,\dots,50\} would be onto.

Every fact used, and where it comes from

FactUsed inSource
Function, domain, codomain, rangeSteps 1, 3Class XI; Section 1.3 (Basics: what a function is)
One-one (injective)Step 2Definition 5, Section 1.3 (Lesson: types of functions)
Onto (surjective); onto ⇔ range = codomainSteps 3, 4Definition 6 and the Remark after it, Section 1.3
BijectiveStep 5Definition 7, Section 1.3
No two students share a roll number; each has oneSteps 1, 2The situation described in the example
nn inputs give at most nn outputs; N\N is infiniteStep 4Counting (Basics: counting choices)
Next example: one-one but not onto with a formulaComparisonExample 8
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 →