CAT 2024 Slot 1 QA Q7 Permutations & Probability

Question 7 of the Quantitative Ability (QA) section, CAT 2024 Slot 1, with CAT's official answer and a worked solution.

Consider two sets \(A=\{2,3,5,7,11,13\}\) and \(B=\{1,8,27\}\). Let \(f\) be a function from \(A\) to \(B\) such that for every element \(b\) in \(B\), there is at least one element \(a\) in \(A\) such that \(f(a)=b\). Then, the total number of such functions \(f\) is
  1. A
    540
  2. B
    537
  3. C
    665
  4. D
    667

Answer: (A) 540 Permutations & Probability MCQ

Solution

  1. We need onto (surjective) functions from a 6-element set to a 3-element set.
  2. All functions: \(3^6 = 729\). Remove those missing at least one element of \(B\) by inclusion–exclusion: \(\binom31 2^6 - \binom32 1^6 = 192 - 3\).
  3. Onto functions \(= 729 - 192 + 3 = 540\).

Shortcut. Onto functions from \(n\) to 3 elements: \(3^n - 3\cdot2^n + 3\).