Let G be an undirected graph, which is a path on 8 vertices. The number of matchings in G is … (answer in integer)
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2026 Set 1 · Q57
Time
Your answerNumerical answer
Solution
Official answer: 34
Discrete MathematicsA matching in a graph is a set of edges without common vertices (including the empty set).
Let denote the number of matchings in a path graph on vertices.
To find a recurrence relation for :
If the last edge is not included in the matching, the number of valid matchings is .
If the last edge is included in the matching, no other edge incident to can be chosen, leaving valid matchings on the remaining vertices.
Thus, the recurrence is:
Base cases:
(empty path has matching: the empty set)
( vertex has matching: the empty set)
( edge: empty set or the edge itself)
Computing the values iteratively (which gives the Fibonacci numbers where ):
Therefore, the number of matchings in a path on 8 vertices is 34.
Try the question first, then check your work.
Examiner trap
Consider whether the last edge is included in the matching or not to establish a Fibonacci-like recurrence relation .
This Discrete Mathematics previous year question is Q57 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Discrete Mathematics in Engineering Mathematics, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Discrete Mathematics PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Discrete Mathematics has 50 GATE CSE PYQs across 23 papers from 2011 to 2026. 6 of them are 2-mark NAT questions like this one, and GATE CSE 2026 Set 1 has 3.
How GATE tests Discrete MathematicsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.