Question

Let U={1,2,…,n}U = \{1, 2, \dots, n\}, where nn is a large positive integer greater than 1000. Let kk be a positive integer less than nn. Let A,BA, B be subsets of UU with ∣A∣=∣B∣=k|A| = |B| = k and A∩B=∅A \cap B = \emptyset. We say that a permutation of UU separates AA from BB if one of the following is true.

  • All members of AA appear in the permutation before any of the members of BB.
  • All members of BB appear in the permutation before any of the members of AA.

How many permutations of UU separate AA from BB?

Choose one option
Official answer and solution
Official answer
D
From
Official GATE 2023 answer key

Solution

Use combinatorics to choose positions and orderings for subsets AA and BB.

We want to construct a permutation of UU of size nn separating AA from BB, where ∣A∣=∣B∣=k|A| = |B| = k and A∩B=∅A \cap B = \emptyset:

  1. The total number of elements in A∪BA \cup B is 2k2k. In any permutation of nn elements, we choose 2k2k positions among the nn available slots in (n2k)\binom{n}{2k} ways.
  2. The remaining n−2kn - 2k elements of U∖(A∪B)U \setminus (A \cup B) can be placed in the remaining slots in (n−2k)!(n - 2k)! ways.
  3. For the 2k2k selected positions:
    • Case 1 (All AA before all BB): The first kk of these positions must be filled by elements of AA (k!k! ways), and the remaining kk positions by elements of BB (k!k! ways). This gives (k!)2(k!)^2 ways.
    • Case 2 (All BB before all AA): The first kk positions are filled by BB (k!k! ways) and the remaining kk by AA (k!k! ways). This gives (k!)2(k!)^2 ways.
    • Since k≥1k \ge 1, these two cases are mutually exclusive.
  4. Combining these gives:
    2×(n2k)×(n−2k)!×(k!)22 \times \binom{n}{2k} \times (n - 2k)! \times (k!)^2

Thus, Option (D) is correct.

Final answer

Option (D)

Common trap

Omitting the factor of 2 (accounting only for AA before BB and forgetting BB before AA).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2023 Computer Science and Information Technology (CS)
Question
48 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.