Skip to content

GATE CS 2023 Q38 — Combinatorics: Counting, Recurrence Relations, Generating Functions

Explain with AI

Let U={1,2,…,n},U=\{1,2, \ldots, n\}, where nn is a large positive integer greater than 1000.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 B?B? 

Choose one option
View worked solution

Answer: D

To find the number of permutations of UU that separate AA from BB, we can break down the construction of any such permutation into three independent steps:

  1. Choose the positions for the elements of A∪BA \cup B:

    The total number of elements in A∪BA \cup B is ∣A∣+∣B∣=2k|A| + |B| = 2k (since A∩B=∅A \cap B = \emptyset). Out of the nn available positions in the permutation, we choose 2k2k positions to place the elements of A∪BA \cup B.

    Number of ways to choose these positions = (n2k)\dbinom{n}{2k}

  2. Arrange the remaining elements:

    The remaining n−2kn - 2k elements of U∖(A∪B)U \setminus (A \cup B) must be placed in the remaining n−2kn - 2k positions.

    Number of ways to arrange these elements = (n−2k)!(n - 2k)!

  3. Arrange the elements of AA and BB in the chosen 2k2k positions:

    According to the definition of separation, there are two mutually exclusive cases:

    • Case 1: All elements of AA appear before all elements of BB.
      The first kk of the chosen 2k2k positions must be occupied by elements of AA, and the remaining kk positions by elements of BB.
      Number of ways = k!×k!=(k!)2k! \times k! = (k!)^2
    • Case 2: All elements of BB appear before all elements of AA.
      The first kk of the chosen 2k2k positions must be occupied by elements of BB, and the remaining kk positions by elements of AA.
      Number of ways = k!×k!=(k!)2k! \times k! = (k!)^2

    Total ways to arrange AA and BB in the chosen positions = (k!)2+(k!)2=2(k!)2(k!)^2 + (k!)^2 = 2(k!)^2

By the product rule, the total number of such permutations is:

2(n2k)(n−2k)!(k!)22 \binom{n}{2k} (n - 2k)! (k!)^2

Hence, the correct option is D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Combinatorics: Counting, Recurrence Relations, Generating Functions questions