Functions

GATE CS previous year questions · 2 questions

GATE CS 2025 Set 1 | Question 17

MCQ · 1 mark · −0.33

\(g(.)\) is a function from \(A\) to \(B\), \(f(.)\) is a function from \(B\) to \(C\), and their composition defined as \(f(g(.))\) is a mapping from \(A\) to \(C\).

If \(f(.)\) and \(f(g(.))\) are onto (surjective) functions, which ONE of the following is TRUE about the function \(g(.)\)?

Options for GATE CS 2025 Set 1 | Question 17

Explanation

Answer: (D)

For \(f(g(.))\) to be onto, the values produced by \(g\) only have to be enough for \(f\) to reach every element of \(C\). That puts no one-to-one or onto condition on \(g\) itself.

Counterexample: \(A = \{1, 2\}\), \(B = \{p, q\}\), \(C = \{z\}\), with \(g(1) = g(2) = p\) and \(f(p) = f(q) = z\). Both \(f\) and \(f(g(.))\) are onto, yet \(g\) is not one-to-one (1 and 2 both go to \(p\)) and not onto (\(q\) is never reached). So (A), (B) and (C) are false.

Answer: D

GATE CS 2024 Set 1 | Question 32

NAT · 1 mark

Let \(A\) and \(B\) be non-empty finite sets such that there exist one-to-one and onto functions (i) from \(A\) to \(B\) and (ii) from \(A \times A\) to \(A \cup B\). The number of possible values of \(|A|\) is __________

Explanation

Answer: 2

A one-to-one and onto function (a bijection) exists between two finite sets exactly when they have the same number of elements. Let \(|A| = n \ge 1\).

  • Condition (i) gives \(|B| = n\).
  • Condition (ii) gives \(|A \cup B| = |A \times A| = n^{2}\).

The union of two \(n\)-element sets has between \(n\) elements (when \(A = B\)) and \(2n\) elements (when they are disjoint), so \(n \le n^{2} \le 2n\), which forces \(n \le 2\).

  • \(n = 1\): take \(A = B = \{a\}\); then \(|A \cup B| = 1 = 1^{2}\).
  • \(n = 2\): take disjoint \(A = \{a, b\}\) and \(B = \{c, d\}\); then \(|A \cup B| = 4 = 2^{2}\).

Both values occur, so \(|A|\) has 2 possible values.

Answer: 2