GATE / CS ARCHIVE

GATE CSE 2026 SET 1 / QUESTION 57

All matchings in an eight-vertex path

Discrete Mathematics · Graph Theory · Full GATE CSE 2026 Set 1 paper

GATE 2026 Set 1, Q57 2 marks · NAT
Report issue

Graph Theory

Question 57, GATE 2026: Let G be a path on eight vertices. Count all matchings, including the empty matching, as an integer.
Tap to enlarge
Answer & solution

Official answer: 34

Givens and goal

Let G be a path on eight vertices. Count all matchings, including the empty matching, as an integer.

Approach

Split matchings according to whether the first edge is selected, obtaining a Fibonacci recurrence.

Step-by-step solution

1. Let Mn count matchings of an n-vertex path, including the empty matching. If the first vertex is unmatched, the remaining choices are any matching of the last n−1 vertices, giving Mn−1.
2. If the first vertex is matched, it must use the edge to the second vertex. No other chosen edge may touch either of those vertices, leaving a path on n−2 vertices and Mn−2 choices.
3. These cases are disjoint and exhaustive, so Mn=Mn−1+Mn−2, with M0=M1=1. The values through n=8 are 1,1,2,3,5,8,13,21,34.
4. A separate count by matching size agrees: choosing k nonadjacent edges among the seven edges gives binomial(8−k,k). Summing for k=0,1,2,3,4 yields 1+7+15+10+1=34.

Common error: The empty set is a matching and contributes one. Omitting it gives an off-by-one result.

Recurrence table

    Number of vertices n:   0  1  2  3  4  5   6   7   8
    Number of matchings:    1  1  2  3  5  8  13  21  34

For the separate binomial count, label the seven edges 1,…,7. A matching of size k selects indices i₁<…<ik with ij+1≥ij+2. Compress the mandatory gaps by setting jr=ir−(r−1). This becomes an ordinary k-subset of {1,…,8−k}, explaining binomial(8−k,k), rather than merely quoting that count.

Original paper, page 44 · Answer key