Question

Let PP be the partial order defined on the set {1,2,3,4}\{1,2,3,4\} as follows

P={(x,x)∣x∈{1,2,3,4}}∪{(1,2),(3,2),(3,4)}P = \{(x, x) \mid x \in \{1,2,3,4\}\} \cup \{(1,2), (3,2), (3,4)\}

The number of total orders on {1,2,3,4}\{1,2,3,4\} that contain PP is __________

Official answer and solution
Official answer
5
From
Official GATE 2024 answer key

Solution

Count the number of topological orderings (linear extensions) of the poset ({1,2,3,4},P)(\{1, 2, 3, 4\}, P) where 1≺21 \prec 2, 3≺23 \prec 2, and 3≺43 \prec 4.

A total order on {1,2,3,4}\{1, 2, 3, 4\} that contains PP is a linear extension (topological sort) satisfying the three precedence constraints:

1≺2,3≺2,3≺41 \prec 2, \quad 3 \prec 2, \quad 3 \prec 4

Since only 11 and 33 have in-degree 00 (no predecessors), the first element of the total order must be either 11 or 33:

  1. If 11 is first: the remaining elements {2,3,4}\{2, 3, 4\} must satisfy 3≺23 \prec 2 and 3≺43 \prec 4, so 33 must come before both 22 and 44. This gives 2 total orders:
    • (1,3,2,4)(1, 3, 2, 4)
    • (1,3,4,2)(1, 3, 4, 2)
  2. If 33 is first: the remaining elements {1,2,4}\{1, 2, 4\} only need to satisfy 1≺21 \prec 2 (element 44 can be placed in any of the 3 positions among {1,2,4}\{1, 2, 4\}). This gives 3 total orders:
    • (3,1,2,4)(3, 1, 2, 4)
    • (3,1,4,2)(3, 1, 4, 2)
    • (3,4,1,2)(3, 4, 1, 2)

Total number of total orders containing PP is 2+3=52 + 3 = 5.

Final answer

5

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

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
Question
34 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.