GATE / CS ARCHIVE

GATE CSE 2023 / QUESTION 48

GATE CSE 2023 Q48

Discrete Mathematics · Combinatorics & Counting · Full GATE CSE 2023 paper

GATE 2023, Q48 2 marks · MCQ
Report issue

Combinatorics & Counting

Question 48, GATE 2023: Let U={1,...,n}, n>1000, and disjoint A,B⊆U each have size k>0. Count permutations in which every A-element precedes every B-element or every B-element precedes every A-element; other elements may appear anywhere.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Choose the 2k positions occupied by A∪B in binomial(n, 2k) ways. For A before B, the first k chosen positions receive A in k! orders and the last k receive B in k! orders. The remaining elements occupy other positions in(n−2k)! orders. The reversed block order contributes an equal, disjoint count because k>0. Total 2 binomial(n, 2k)(k!)²(n−2k)!, option D. Existence of the disjoint sets implicitly guarantees 2k≤n.

Teaching detail. A and B need not occupy consecutive positions in the full permutation: unrelated U-elements may be interspersed. After choosing their 2k positions, requiring A before B completely determines which k positions are reserved for each set but leaves internal order free. As an alternative check, all binomial(2k,k) patterns of A/B labels among those positions are equally likely, and exactly two are favorable. Multiplying n! by 2/binomial(2k,k) gives the same expression. When k=1 every permutation qualifies, and the formula correctly reduces to n!.

Original paper, page 51 · Answer key