GateAI
Discrete Mathematics

GATE CSE 2022 · Q58

NAT2 marksMedium

Time

Let G(V,E)G(V,E) be a directed graph, where V={1,2,3,4,5}V = \{1,2,3,4,5\} is the set of vertices and EE is the set of directed edges, as defined by the following adjacency matrix AA. A[i][j]={1,1≤j≤i≤50,otherwiseA[i][j] = \begin{cases} 1, & 1 \le j \le i \le 5 \\ 0, & \text{otherwise} \end{cases} A[i][j]=1A[i][j] = 1 indicates a directed edge from node ii to node jj. A *directed spanning tree* of GG, rooted at r∈Vr \in V, is defined as a subgraph TT of GG such that the undirected version of TT is a tree, and TT contains a directed path from rr to every other vertex in VV. The number of such directed spanning trees rooted at vertex 5 is _________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 24

Discrete Mathematics

A directed spanning tree (arborescence) rooted at vertex 55 must satisfy the following properties:

  1. The root vertex 55 has an in-degree of 00.

  2. Every other vertex j∈{1,2,3,4}j \in \{1, 2, 3, 4\} must have an in-degree of exactly 11.

  3. The subgraph contains no cycles (ignoring self-loops).

From the adjacency matrix definition, a directed edge exists from ii to jj (i→ji \to j) if and only if j≤ij \le i. Ignoring self-loops (i=ji = j), edges only go from a higher-numbered vertex to a strictly lower-numbered vertex (i>ji > j). Therefore, the graph is a Directed Acyclic Graph (DAG), ensuring that any choice of incoming edges cannot form a cycle.

For each vertex j∈{1,2,3,4}j \in \{1, 2, 3, 4\}, we choose exactly one incoming edge from a vertex ii such that i>ji > j:

  • For vertex 44: possible incoming edges from {5}  ⟹  1\{5\} \implies 1 choice.

  • For vertex 33: possible incoming edges from {4,5}  ⟹  2\{4, 5\} \implies 2 choices.

  • For vertex 22: possible incoming edges from {3,4,5}  ⟹  3\{3, 4, 5\} \implies 3 choices.

  • For vertex 11: possible incoming edges from {2,3,4,5}  ⟹  4\{2, 3, 4, 5\} \implies 4 choices.

The total number of directed spanning trees rooted at vertex 55 is:

1×2×3×4=4!=241 \times 2 \times 3 \times 4 = 4! = 24

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Discrete Mathematics previous year question is Q58 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Discrete Mathematics in Engineering Mathematics, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Discrete Mathematics in GATE CSE

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 2022 has 3.

How GATE tests Discrete Mathematics

More from GATE CSE 2022

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2022 · Q58 · NAT

Let G(V,E) be a directed graph, where V = {1,2,3,4,5} is the set of vertices and E is the set of directed edges, as defined by the following adjacency matrix A. A[i][j] = 1, & 1 ≤ j ≤ i ≤ 5 0, & otherwise A[i][j] = 1 indicates a directed edge from node i to node j. A *directed spanning tree* of G, rooted at r ∈ V, is defined as a subgraph T of G such that the undirected version of T is a tree, and T contains a directed path from r to every other vertex in V. The number of such directed spanning trees rooted at vertex 5 is …

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.