GateAI
Combinatorics

GATE CSE 2012 · Q37

MCQ2 marksEasy

Time

How many onto (or surjective) functions are there from an nn-element (n≥2n \ge 2) set to a 2-element set?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) 2n - 2

Combinatorics

Let the domain set be AA with ∣A∣=n|A| = n and the codomain set be B={b1,b2}B = \{b_1, b_2\} with ∣B∣=2|B| = 2.

  1. The total number of functions from AA to BB is:

    ∣B∣∣A∣=2n|B|^{|A|} = 2^n
  2. A function is not onto (not surjective) if its range does not cover the entire codomain BB. In this case, that happens when all elements of AA map to only b1b_1, or all elements map to only b2b_2.

  3. There are exactly 22 such constant functions:

    • f(x)=b1f(x) = b_1 for all x∈Ax \in A

    • f(x)=b2f(x) = b_2 for all x∈Ax \in A

  4. Therefore, the number of onto functions is:

    Total functions−Non-onto functions=2n−2\text{Total functions} - \text{Non-onto functions} = 2^n - 2

Hence, (C) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Combinatorics previous year question is Q37 of the GATE CSE 2012 paper. Find more GATE CSE PYQs on Combinatorics in Engineering Mathematics, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Combinatorics PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Combinatorics in GATE CSE

Combinatorics has 19 GATE CSE PYQs across 15 papers from 2012 to 2025. 5 of them are 2-mark MCQs like this one, and GATE CSE 2012 has 2.

How GATE tests Combinatorics

More from GATE CSE 2012

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2012 · Q37 · MCQ

How many onto (or surjective) functions are there from an n-element (n ≥ 2) set to a 2-element set?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.