GATE Computer ScienceHardGATE CS (PYQ pattern)

How many labelled forests on the vertex set {1, 2, 3, 4, 5} have exactly 2 connected components (trees, isolated vertices allowed)?

  1. A. 110
  2. B. 125
  3. C. 100
  4. D. 45

Correct answer: A. 110

Component sizes are 4 + 1 or 3 + 2. A 4-vertex tree plus an isolated vertex: 5 · 4² = 80. A 3-vertex tree plus an edge: C(5,3) · 3 · 1 = 30. Total 110.

More Discrete Mathematics questions

Exams that ask this topic