Practice Dependency Graphs in Math

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

A dependency graph is a directed graph where nodes are variables and arrows show which variables directly influence which others.

Like a flowchart: A affects B, B affects C. Arrows show dependencies.

Showing a random 20 of 50 problems.

Example 1

easy
In the chain Aโ†’Bโ†’Cโ†’DA \to B \to C \to D, how many ancestors does DD have?

Example 2

easy
A graph has edges Aโ†’BA \to B, Aโ†’CA \to C, Bโ†’DB \to D. List the parents of DD.

Example 3

medium
Find a valid evaluation order for C=A+BC = A + B, E=C+DE = C + D, where A,B,DA, B, D are inputs.

Example 4

medium
Given Aโ†’BA \to B, Aโ†’CA \to C, Bโ†’DB \to D, Cโ†’DC \to D, Dโ†’ED \to E, list one valid topological order.

Example 5

easy
In a dependency graph, the edge Xโ†’YX \to Y means which variable directly influences the other?

Example 6

easy
Three tasks have the following dependencies: Task B depends on Task A, and Task C depends on Task B. Draw the dependency graph and determine a valid execution order.

Example 7

medium
Given D=A+BD = A + B and E=Dโ‹…CE = D \cdot C, list every variable that EE depends on, directly or indirectly.

Example 8

easy
A formula computes C=A+BC = A + B. Draw the dependency arrows.

Example 9

medium
Variables: rainfall โ†’\to soil moisture โ†’\to crop yield, and temperature โ†’\to crop yield. If only temperature changes, does soil moisture change?

Example 10

easy
For z=f(x)+g(y)z = f(x) + g(y), draw the dependency graph and identify the leaf node.

Example 11

medium
In the graph Aโ†’BA \to B, Aโ†’CA \to C, Bโ†’DB \to D, Cโ†’DC \to D, what is the out-degree of AA?

Example 12

medium
Tasks Aโ†’BA \to B, Aโ†’CA \to C, Bโ†’DB \to D, Cโ†’DC \to D. What is the minimum number of stages to complete all tasks if independent tasks can run in parallel?

Example 13

easy
Does correlation between AA and BB guarantee that one depends on the other? Answer yes or no.

Example 14

easy
A node with no incoming arrows in a dependency graph is called a ____ variable.

Example 15

medium
In a causal dependency graph Xโ†’Yโ†’ZX \to Y \to Z, intervening on YY (forcing its value) breaks which arrow?

Example 16

medium
Given the dependencies: DD depends on AA and BB; EE depends on BB and CC; FF depends on DD and EE. Find all valid topological orderings.

Example 17

challenge
A graph claims Aโ†’BA \to B, Bโ†’CB \to C, Cโ†’AC \to A is a valid computation pipeline. Identify the flaw and state the condition needed to fix it.

Example 18

medium
How many distinct topological orderings does the DAG Aโ†’BA \to B, Aโ†’CA \to C have? (No other edges.)

Example 19

medium
In the DAG with edges Aโ†’BA \to B, Aโ†’CA \to C, Bโ†’DB \to D, Cโ†’DC \to D, Dโ†’ED \to E, what is the longest path length (in edges) from AA to EE?

Example 20

medium
In a spreadsheet, cell C1=A1+B1C1 = A1 + B1 and D1=C1โ‹…2D1 = C1 \cdot 2. If A1A1 changes, which cells must be recomputed?