PYQ Vault

NDA Maths · Functions

What a Function Is, and How to Classify It

A function assigns each input exactly one output; classifying it as one-one, onto, or bijective is about how inputs and outputs are paired.

Why this matters

Eight PYQs, all EASY–MODERATE — the vocabulary the rest of the chapter is built on. The bank tests three things: whether a given rule even is a function (the vertical-line / well-defined test), whether it is one-one and/or onto, and how to count functions of a given type. Get the definitions exact and these are free marks; blur 'onto' and 'into' and you lose them.

Test yourself — a quick 16-question Functions recall quiz, instant score.

Concept 1 of 4: Domain, codomain, range — the vocabulary

Every function comes with three sets. The domain is what you are allowed to put in, the codomain is the declared set of possible outputs, and the range is the part of the codomain you actually hit. Range is always a subset of the codomain — the gap between them is exactly what 'onto' is about.

Definition

For f:A→Bf:A\to B:

  • Domain =A=A: the set of all valid inputs.
  • Codomain =B=B: the declared target set.
  • Range =f(A)={f(x):x∈A}=f(A)=\{f(x):x\in A\}: the set of values actually taken. Always f(A)⊆Bf(A)\subseteq B.
  • Image of xx is f(x)f(x); pre-image of yy is any xx with f(x)=yf(x)=y.

Worked example

For f:R→Rf:\mathbb{R}\to\mathbb{R}, f(x)=x2f(x)=x^2, state the domain, codomain and range.
Practice this concept4 quick reps

Concept 2 of 4: Is it a function? Well-defined and the vertical-line test

A rule is a function only if every input gives exactly one output — no input left out, none sent to two places. On a graph this is the vertical-line test: any vertical line meets the graph at most once.

Definition

f:A→Bf:A\to B is a function iff for every x∈Ax\in A there is one and only one y∈By\in B with f(x)=yf(x)=y. Failures: a value with no output (gap in domain) or a value with two outputs (relation, not a function). A piecewise rule must agree at the join to stay well-defined.

Worked example

Does y2=xy^2=x define yy as a function of xx for x>0x>0?

The same idea in a real exam question:

NDA · Sep 2018 · Q25Moderate

Example 2 · Functions · Function Definition and Classification — Injectivity, Surjectivity, Bijectivity

Let A={x∈R:−1≤x≤1}A = \{x \in \mathbb{R} : -1 \leq x \leq 1\}, B={y∈R:−1≤y≤1}B = \{y \in \mathbb{R} : -1 \leq y \leq 1\} and S be the subset of A×BA \times B, defined by S={(x,y)∈A×B:x2+y2=1}S = \{(x,y) \in A \times B : x^2 + y^2 = 1\}. Which one of the following is correct?

Piecewise rules must agree at the boundary

A two-piece rule like f(x)=x2f(x)=x^2 on [0,4][0,4] and 3x3x on [4,8][4,8] is only a function if the pieces give the same value at the shared point x=4x=4 (here 16≠1216\neq12, so it is not well-defined). Always check the join before declaring it a function.

Concept 3 of 4: One-one, onto, and bijective

One-one (injective): different inputs give different outputs — no two arrows land together. Onto (surjective): every element of the codomain is hit — range equals codomain. Bijective: both at once, so inputs and outputs pair up perfectly (and the function is invertible).

Definition

  • Injective: f(x1)=f(x2)⇒x1=x2f(x_1)=f(x_2)\Rightarrow x_1=x_2 (equivalently, every horizontal line meets the graph at most once).
  • Surjective: range == codomain, i.e. every y∈By\in B has a pre-image.
  • Bijective: injective and surjective. Only bijections have an inverse.
  • Monotonic ⇒ injective: a strictly increasing or strictly decreasing function is automatically one-one — the fastest injectivity test. If it is also onto its codomain, it is a bijection. (You can often see monotonicity directly, without calculus: x∣x∣x|x| is −x2-x^2 then x2x^2, both increasing and meeting at 0, so it is strictly increasing and one-one.)

Onto depends on the codomain you declare — shrinking the codomain to the range makes any function onto.

One-one (injective): distinct inputs → distinct outputstarget 4 unused — one-one but not ontoOnto (surjective): every output is hittwo inputs share output 3 — onto but not one-oneBijective: perfect pairing (one-one AND onto)invertible

Worked example

Classify f:R→Rf:\mathbb{R}\to\mathbb{R}, f(x)=x2f(x)=x^2, as one-one / onto.
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

NDA · Apr 2021 · Q38Moderate

Example 3 · Functions · Function Definition and Classification — Injectivity, Surjectivity, Bijectivity

Consider the following statements: 1. A function f:Z→Zf:\mathbb{Z}\to\mathbb{Z}, defined by f(x)=x+1f(x)=x+1, is one-one as well as onto. 2. A function f:N→Nf:\mathbb{N}\to\mathbb{N}, defined by f(x)=x+1f(x)=x+1, is one-one but not onto. Which of the above statements is/are correct?

'Onto' is not absolute — it depends on the codomain

f:N→Nf:\mathbb{N}\to\mathbb{N}, f(x)=x+1f(x)=x+1 is one-one but not onto (nothing maps to 1). The same rule on Z→Z\mathbb{Z}\to\mathbb{Z} is onto. Read the declared domain and codomain before deciding.

A non-monotone function usually fails one-one (and often onto)

On a symmetric interval, an even-ish function doubles back: cos⁡(πx)\cos(\pi x) on (−1,1)(-1,1) hits its maximum at x=0x=0, so it is neither one-one nor onto (−1,1)(-1,1). Contrast x∣x∣x|x|, which is strictly increasing and is a bijection of (−1,1)(-1,1). Check monotonicity before declaring a bijection.

Concept 4 of 4: Counting functions of a given type

Counting how many functions exist from a finite set to another is just the multiplication principle: each input independently picks an output. Restricting to one-one or onto narrows the count.

Definition

Let ∣A∣=m|A|=m, ∣B∣=n|B|=n.

  • All functions A→BA\to B: nmn^m (each of mm inputs has nn choices).
  • One-one (needs n≥mn\ge m): n(n−1)⋯(n−m+1)=nPmn(n-1)\cdots(n-m+1)={}^{n}P_{m}.
  • Onto (general): inclusion–exclusion, ∑k=0n(−1)k(nk)(n−k)m=nm−(n1)(n−1)m+(n2)(n−2)m−…\displaystyle\sum_{k=0}^{n}(-1)^k\binom nk (n-k)^m = n^m-\binom n1(n-1)^m+\binom n2(n-2)^m-\dots; for n=2n=2 it is 2m−22^m-2, for n=3n=3 it is 3m−3⋅2m+33^m-3\cdot2^m+3 (so 3636 onto maps from a 4-set to a 3-set). Needs m≥nm\ge n; when m=nm=n onto = one-one = n!n!.

Number of functions A → B

functions A→B=nminjections=nPm=n!(n−m)!bijections (m=n)=n!relations=2mn\text{functions }A\to B=n^{m}\qquad \text{injections}={}^{n}P_{m}=\dfrac{n!}{(n-m)!}\qquad \text{bijections }(m=n)=n!\qquad \text{relations}=2^{mn}

Worked example

With ∣A∣=3|A|=3, ∣B∣=4|B|=4: how many functions, and how many are one-one?
Practice this concept4 quick reps

The same idea in a real exam question:

NDA · Apr 2024 · Q35Easy

Example 4 · Functions · Function Definition and Classification — Injectivity, Surjectivity, Bijectivity

Let A={1,2,3,4,5}A=\{1,2,3,4,5\} and B={6,7}B=\{6,7\}. What is the number of onto functions from AA to BB?

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (1)

  • Counting functions of a given type

    Number of functions A → B

    functions A→B=nminjections=nPm=n!(n−m)!bijections (m=n)=n!relations=2mn\text{functions }A\to B=n^{m}\qquad \text{injections}={}^{n}P_{m}=\dfrac{n!}{(n-m)!}\qquad \text{bijections }(m=n)=n!\qquad \text{relations}=2^{mn}

Watch out for (3)

Test yourself on Functions

20 past NDA questions from this chapter, timed at 25 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.