Question
Let be an undirected graph, which is a path on 8 vertices. The number of matchings in is ______. (answer in integer)
Official answer and solution
- Official answer
- 34
- From
- Official GATE 2026 answer key
Solution
Use the Fibonacci recurrence for the number of matchings (independent edge sets, including the empty set) in a path graph on vertices.
Let denote the number of matchings (subsets of pairwise non-adjacent edges, including the empty matching) in a path graph on vertices. For the last edge :
- Matchings that do not include correspond to matchings of ().
- Matchings that do include cannot use and correspond to matchings of ().
With base cases (empty matching) and (empty matching and the single edge):
34
Forgetting to count the empty matching (which would give 33).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
- Question
- 57 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.