Function MCQs: 11 Solved Questions on Domain, Range and Counting

Attempt 11 past-paper function MCQs, then check concise solutions covering finite mappings, ranges, subset images, countability and equivalence relations.

KnowledgeGate Team

Exam prep & CS education

Updated 8 Aug 20267 min read

You may know the words domain, co-domain and range, yet still reverse the base and exponent when counting functions, or assume that every co-domain value must be used. Both slips cost the whole mark: in the count of functions the co-domain size is the base and the domain size is the exponent, and a perfectly valid function may leave part of its co-domain untouched. Attempt each question below before reading its explanation, then open the linked solved-question page for the full working.

Counting functions from finite sets

Q1. The number of functions from an m element set to an n element set is (GATE 1998)

  • (a) m + n

  • (b) mⁿ

  • (c) nᵐ

  • (d) m * n

Correct answer: (c). Each of the m domain elements independently chooses one of n co-domain values, so the product rule gives nᵐ functions. For A={1,2,3} and B={p,q}, the count is 2³=8, not 3²=9. Different inputs may share an output unless injectivity is required.

Mapping diagram from domain A={1,2,3} to co-domain B={p,q} where each of the three inputs chooses p or q, giving 2³=8 possible functions.

Q2. Suppose X and Y are sets and |X| and |Y| are their respective cardinalities. It is given that there are exactly 97 functions from X to Y. From this one can conclude that (GATE 1996)

  • (a) |X|=1,|Y|=97

  • (b) |X|=97,|Y|=1

  • (c) |X|=97,|Y|=97

  • (d) None of the above

Correct answer: (a). Put a=|X| and b=|Y|. The count is bᵃ=97, and because 97 is prime, its positive-integer power form is 97¹. Thus |X|=1 and |Y|=97; the other stated counts are 1⁹⁷=1 and 97⁹⁷, which is far larger than 97.

Q3. Let A be a finite set having x elements and let B be a finite set having y elements. What is the number of distinct functions mapping B into A. (ISRO 2014)

  • (a) xʸ

  • (b) 2^(x+y)

  • (c) yˣ

  • (d) y! / (y-x)!

Correct answer: (a). “Mapping B into A” makes B the y-element domain and A the set of x choices for every input, so the answer is xʸ. With x=3 and y=2, there are 3²=9 mappings from B to A. The expression yˣ counts functions in the opposite direction.

Continue with Discrete Mathematics MCQs when you want a broader collection beyond these finite-set counts.

Domain, co-domain, range and special functions

Q4. What is the range of the following function? {(4, 8), (9, 2), (-3, -4)} (UPLT 2018)

  • (a) {4, 9, -3}

  • (b) {8}

  • (c) {(4, 8), (9, 2), (-3, -4)}

  • (d) {8, 2, -4}

Correct answer: (d). In each ordered pair, the first value is the input and the second is the output. The domain is {4,9,-3}, while the attained outputs form the range {8,2,-4}. The co-domain is not stated, so do not silently equate it with the range.

Q5. The value of Floor(8.4) + Ceil(9.9) is: (UPPSC Polytechnic Lecturer 2022)

  • (a) 18

  • (b) 19

  • (c) 20

  • (d) 17

Correct answer: (a). Floor(8.4)=8, the greatest integer not exceeding 8.4, while Ceil(9.9)=10, the least integer not below 9.9. Therefore 8+10=18. Truncating both decimals would incorrectly produce 17.

Q6. f(x) and g(y) are functions of x and y, respectively, and f(x) = g(y) for all real values of x and y. Which one of the following options is necessarily TRUE for all x and y? (GATE 2023)

  • (a) f(x)=0 and g(y)=0

  • (b) f(x)=g(y)=constant

  • (c) f(x)=constant and g(y) not constant

  • (d) f(x)+g(y)=f(x)-g(y)

Correct answer: (b). Fix y=0 and write g(0)=c; the equality forces f(x)=c for every x. Now fix any x and vary y, which forces g(y)=c for every y. Taking c=7 confirms that both functions must be constant but need not be zero.

Images of subsets: where equality fails

Q7. Let f: A → B be a function, and let E and F be subsets of A. Consider the following statements about images. S1: f(E ∪ F) = f(E) ∪ f(F) S2: f(E ∩ F) = f(E) ∩ f(F) Which of the following is true about S1 and S2? (GATE 2001)

  • (a) Only S1 is correct

  • (b) Only S2 is correct

  • (c) Both S1 and S2 are correct

  • (d) Neither S1 nor S2 is correct

Correct answer: (a). Membership proves S1 because an output from E∪F comes from an input in E or F. For intersections, only f(E∩F)⊆f(E)∩f(F) always holds. Take A={1,2}, f(1)=f(2)=0, E={1} and F={2}: f(E∩F)=∅ but f(E)∩f(F)={0}, so equality fails when f is not injective.

Practise the neighbouring ideas with Set Theory and Relations MCQs: 12 Solved.

Nested counting with products, power sets and functions

Q8. Let X, Y, Z be sets of sizes x, y and z respectively. Let W = X x Y. Let E be the set of all subsets of W. The number of functions from Z to E is: (GATE 2006)

  • (a) z^(2xy)

  • (b) z x 2^(xy)

  • (c) z^(2x + y)

  • (d) 2^(xyz)

Correct answer: (d). Count inside out: |W|=xy, so its power set E has 2^(xy) elements, and the number of functions is |E|^z=(2^(xy))^z=2^(xyz). For x=2, y=3 and z=2, |W|=6, |E|=64 and the final count is 64²=4096=2¹².

Q9. Let N be the set of natural numbers. Consider the following sets. P: Set of Rational numbers (positive and negative). Q: Set of functions from {0, 1} to N. R: Set of functions from N to {0, 1}. S: Set of finite subsets of N. Which of the sets above are countable? (GATE 2018)

  • (a) Q and S only

  • (b) P and S only

  • (c) P and R only

  • (d) P, Q and S only

Correct answer: (d). P is countable, Q corresponds to ordered pairs of natural numbers, and S is a countable union of the families of k-element subsets, so all three are countable. R is the set of infinite binary sequences and is uncountable by the diagonal argument. Q chooses only two natural-number outputs, while each member of R makes infinitely many binary choices.

For a structured route through the wider subject sequence, use GATE Guidance by Sanchit Sir.

Double counting and relations on functions

Q10. Let S = {1, 2, 3, ...., m}, m>3. Let X₁, X₂, ..., Xₙ be the subsets of S each of size 3. Define a function f from S to the set of natural numbers as, f(i) is the number of sets Xⱼ that contain the element i. That is, f(i) = |{j | i ϵ Xⱼ}| then (GATE 2006)

The summation of f(i) from i equals 1 to m.
  • (a) 3m

  • (b) 3n

  • (c) 2m + 1

  • (d) 2n + 1

Correct answer: (b). Count the incidence pairs (i,Xⱼ) by element or by subset; every one of the n subsets contributes exactly three. With m=5, n=2, X₁={1,2,3} and X₂={3,4,5}, the values are 1,1,2,1,1. Their sum is 6=3n.

Q11. Which of the following is an equivalence relation on the set of all functions from Z to Z ? (UGC NET 2018)

  • (a) {(f, g) : f(x) - g(x) = 1 for all x in Z}

  • (b) {(f, g) : f(0) = g(0) or f(1) = g(1)}

  • (c) {(f, g) : f(0) = g(1) and f(1) = g(0)}

  • (d) {(f, g) : f(x) - g(x) = k for some k in Z}

Correct answer: (d). The intended relation is f~g when f(x)-g(x)=k for every x and one fixed integer k. Reflexivity uses k=0, symmetry changes k=4 to -4, and transitivity combines k₁=4 with k₂=-1 to give k₁+k₂=3. For (b), take f values (0,0), g values (0,1) and h values (1,1) at inputs 0 and 1: f~g and g~h, but f is not related to h, so transitivity fails.

The NTA-UGC-NET Paper - 2 course provides a broader route through Discrete Structures.

The five traps behind these answers

Trap

Correct rule

Questions

Reversing the count

Co-domain size is the base; domain size is the exponent.

Q1-Q3

Treating range as co-domain

The range contains attained outputs and may be smaller than the co-domain.

Q4

Truncating both values

Floor rounds down; ceiling rounds up.

Q5

Preserving every image equality

Images preserve unions; intersection equality needs injectivity.

Q7

Counting the outer object first

Count nested set constructions from the inside out.

Q8-Q9

For Q6, the trap is stopping at f(x)=g(y)=0 when any single constant value works just as well. For Q10, count the same incidences by elements and subsets: 1+1+2+1+1=6=3(2). For Q11, test the three properties separately: k=0 is reflexive, 4 becomes -4 under symmetry, and 4+(-1)=3 under transitivity. If this language feels shaky, rebuild it with Set Theory and Relations for GATE: Closures and Posets.

How to use these 11 function MCQs for revision

Use two passes. First, answer all 11 without notes and write the governing definition or count beside each: Q1-Q3 cover finite counts, Q4-Q6 range and special-function reasoning, Q7 subset images, Q8-Q9 nested and infinite counting, and Q10-Q11 advanced structure.

After one week, retry only the missed questions and explain aloud why every distractor fails. About 40 questions sit under this subtopic in the KnowledgeGate bank, so each linked question page opens onto more practice of the same kind. The short version is simple: identify the domain and co-domain before counting, work from the innermost set outward, and test advanced properties one at a time.