Summary
- Adjacency Matrix: Represents graph connections between vertices.
- Complete Graph: Each vertex connected to every other vertex by a single edge.
- Directed Graph: Edges have a specific travel direction.
- In-degree: Number of edges leading into a specific vertex.
- Strongly Connected Graph: Directed graph allowing walks in either direction between any two vertices.
- Weighted Graph: Edges assigned numerical values (e.g., distance, time).
- Weighted Adjacency Table: Shows exact edge weights; empty cells mean no direct connection.
- Undirected Weighted Graph: Table of least values has symmetry along the leading diagonal.
- Markov Chain States: Mutually exclusive events that change over time.
- Transition State Diagram: Visual representation of a Markov Chain; edges show transition probabilities.
- Markov Chain Probability Rule: Probabilities on arrows out of a single state sum to 1.
- Transition Matrix (): Shows transition probabilities. Columns = current states, Rows = next states. Column probabilities sum to 1.
- Walks of length : Number of walks found by raising adjacency matrix to power :
- Walks of length or less: Total walks found by summing successive powers of :
- Future States (Markov Chains): Probability vector for next state () found by multiplying transition matrix () by initial state vector ():
- Matrix Diagonalisation (for ): where is a diagonal matrix of eigenvalues and is a matrix of corresponding eigenvectors.
- Steady State Limits: As , has identical columns; every transition matrix has an eigenvalue of 1.
- Shortest Route Method: Fill direct connections, then check for shorter paths via intermediate vertices.
- Expected Populations (Markov Chains): Multiply by total population to find expected numbers in each state.
- Graph Theory (adjacency matrices, walks) and Markov Chains (transition matrices, steady states, diagonalisation) are HL topics.
- GDC: Store matrices, calculate or , check transition matrix column sums (must be 1).
- Exam Tip: Draw transition state diagrams to visualise problems.
- Exam Tip: For undirected graphs, use symmetry of least values table.
- Exam Tip: Verify steady state calculations by checking for identical columns in .
- Exam Tip: Always check for hidden shorter routes via intermediate nodes in least weights tables.
How it is examined
The result is the reliable question: raise the matrix to a power on the GDC, read one entry. "Walks of less than length" means summing , and students often forget the sum and give only . Building a transition matrix from a graph is the bridge into AHL 4.19, and the column-versus-row convention has to be stated in the question or the answer is ambiguous.
- Adjacency matrices.
- Walks.
- The number of -length walks, or walks of less than length, between two vertices.
- Weighted adjacency tables.
Practice questions
6 questions · 4 medium · 2 hardQuestion 1
MediumPaper 1 · calculator5 marksConsider the following directed network representing connections between four data servers: Server P, Server Q, Server R, and Server S.

Write down the adjacency matrix for this network, assuming the order of vertices is P, Q, R, S.
Determine the number of different sequences of data transfers (walks) of length 4 that start and end at the same server.
An adjacency matrix has if there is a directed edge from vertex to vertex , and otherwise. Remember to consider loops.
The number of walks of length between two vertices can be found using the -th power of the adjacency matrix. To find walks that start and end at the same vertex, look at the diagonal elements.
Question 2
HardPaper 2 · calculator27 marks(a) A single data packet can be transferred between three servers, S1, S2, and S3, in a network. The possible direct transfers are:
- From S1, the packet can be sent to S2 or stay in S1.
- From S2, the packet can be sent to S1 or S3.
- From S3, the packet can be sent to S2 or stay in S3.
Write down the adjacency matrix for the directed graph representing these possible direct data transfers, ordering the servers S1, S2, S3.
(b) Find the total number of distinct data paths of length 5 from server S1 to server S2.
(c.i) Every possible sequence of 5 data transfers has the same probability of occurring. State this probability.
(c.ii) Use your answer to part (b) to find the probability that if a data packet was initially on server S1, it will be on server S2 after 5 transfers.
(d.i) A network administrator monitors the movement of two data packets. The possible combined states of the two packets (assuming they occupy distinct servers) are (packets on S1 and S2), (packets on S1 and S3), and (packets on S2 and S3).
The transitions between these states are modelled by the following transition matrix , where rows represent the current state and columns represent the next state, in the order :
State the probability that if the packets are currently in state , they will be in state after one transfer.
(d.ii) Using the transition matrix from part (d.i), state the probability that if the packets are currently in state , they will be in state after one transfer.
(d.iii) Using the transition matrix from part (d.i), state the probability that if the packets are currently in state , they will be in state after one transfer.
(e) Given that the two data packets are initially in state (on servers S1 and S2), find the probability that they will be in state (on servers S2 and S3) after 5 transfers.
(f) The data packets continue this pattern of transfers for a long period. Find the server that is occupied least and the proportion of the time it is free.
An adjacency matrix for a directed graph has if there is an edge from node to node , and otherwise. Remember to consider self-loops.
The number of walks of length between two nodes can be found by raising the adjacency matrix to the power of . The entry in the resulting matrix gives the number of walks from node to node .
Consider the number of choices for each individual transfer and how probabilities combine for a sequence of independent events.
The probability is the number of successful paths divided by the total number of possible paths of that length.
Identify the correct entry in the transition matrix based on the given order of states.
Identify the correct entry in the transition matrix based on the given order of states.
Identify the correct entry in the transition matrix based on the given order of states.
To find the probabilities after multiple steps, you need to raise the transition matrix to the power corresponding to the number of transfers. Then, select the entry that corresponds to the initial and final states.
For a long period, the system reaches a steady state. Calculate the steady-state probability vector for the combined states. Then, use these probabilities to determine the proportion of time each individual server is occupied.
Question 3
MediumPaper 1 · calculator6 marksA small data network consists of five communication relays, P, Q, R, S, and T. The direct connections between these relays are represented by an adjacency matrix, with rows and columns in alphabetical order.
(a) Draw and label a graph to represent the adjacency matrix.
(b) Determine the number of ways a data packet can travel from a relay and return to the same relay in exactly 3 hops.
Each entry in the adjacency matrix indicates a direct connection between relay and relay . A '1' means a connection, and a '0' means no direct connection. Since the matrix is symmetric, the connections are bidirectional.
The number of walks of length between two nodes in a graph is given by the corresponding entry in the -th power of the adjacency matrix. To find walks that start and end at the same node, look at the diagonal entries.
Question 4
HardPaper 2 · calculator17 marksThe following table shows the average transmission times in milliseconds (ms) for direct data packets between six deep-space observatories. Blank cells indicate no direct data link. The rows represent the sending observatory. The columns represent the receiving observatory.
| O1 | O2 | O3 | O4 | O5 | O6 | |
|---|---|---|---|---|---|---|
| O1 | - | 120 | 180 | - | - | - |
| O2 | 120 | - | - | 90 | 150 | - |
| O3 | 180 | - | - | 200 | - | 220 |
| O4 | - | 90 | 200 | - | 110 | 160 |
| O5 | - | 150 | - | 110 | - | 250 |
| O6 | - | - | 220 | 160 | 250 | - |
Show the direct data links between the observatories as a graph.
Write down the adjacency matrix for this graph, assuming the observatories are ordered O1, O2, O3, O4, O5, O6.
Using your answer to part (b), find the number of different ways to transmit data from and return to observatory O1 in exactly 4 hops.
State whether or not it is possible to transmit data from and return to observatory O1 in exactly 6 hops, having visited each of the other 5 observatories exactly once. Justify your answer.
The following table shows the least transmission time (in ms) to travel between the observatories.
| O1 | O2 | O3 | O4 | O5 | O6 | |
|---|---|---|---|---|---|---|
| O1 | 0 | 120 | 180 | a | 270 | 370 |
| O2 | 120 | 0 | 300 | 90 | 150 | b |
| O3 | 180 | 300 | 0 | 200 | 310 | 220 |
| O4 | a | 90 | 200 | 0 | 110 | 160 |
| O5 | 270 | 150 | 310 | 110 | 0 | 250 |
| O6 | 370 | b | 220 | 160 | 250 | 0 |
Find the values of and .
A research team needs to visit each of the observatories, starting and finishing at observatory O1. Use the nearest neighbour algorithm to find an upper bound for the total transmission time of the trip.
By deleting observatory O1, use the deleted vertex algorithm to find a lower bound for the total transmission time of the trip.
Represent each observatory as a vertex and each direct data link as an edge. Since transmission times are given, the graph should be weighted, but for showing direct links, you only need to draw the edges.
An adjacency matrix has elements if there is a direct link between vertex and vertex , and otherwise. For an undirected graph, the matrix is symmetric.
The entry of the -th power of the adjacency matrix gives the number of walks of length from vertex to vertex . You need to find the entry of .
Consider if a Hamiltonian cycle of length 6 exists in the graph, starting and ending at O1.
The values and represent the shortest paths between pairs of observatories. You can find these by tracing paths on the graph or using a shortest path algorithm.
Start at O1. At each step, move to the unvisited observatory that has the shortest direct transmission time from the current observatory. Continue until all observatories are visited, then return to O1.
Remove O1 and all its incident edges. Find the Minimum Spanning Tree (MST) for the remaining graph. Then, add the two shortest edges that connect O1 to any vertex in the MST.
Question 5
MediumPaper 1 · calculator9 marksA network of five research laboratories, A, B, C, D, and E, is connected by data links. The diagram below shows the connections between these laboratories.

State, giving a reason, whether the network graph is
(i) simple;
(ii) connected.
Complete the adjacency matrix for this network.
Hence, determine the number of ways a data packet can travel from Lab A to Lab C using fewer than three direct links.
Recall the definition of a simple graph. A simple graph does not contain loops or multiple edges between the same pair of vertices.
Recall the definition of a connected graph. A graph is connected if there is a path between every pair of distinct vertices.
The entry in the adjacency matrix represents the number of direct links between laboratory and laboratory . Remember that the matrix is symmetric for an undirected graph.
The number of walks of length between two vertices is given by the corresponding entry in the -th power of the adjacency matrix. 'Fewer than three direct links' means paths of length 1 or 2.
Question 6
MediumPaper 1 · calculator7 marksA streaming service offers two subscription plans: Premium and Basic. The service has found that customers' choices follow a pattern. If a customer has the Premium plan in a given month, the probability they will keep the Premium plan the next month is 0.8. If a customer has the Basic plan in a given month, the probability they will upgrade to the Premium plan the next month is 0.1.
(a) Let the states be Premium (State 1) and Basic (State 2). Write down the transition matrix, T, for this Markov chain.
(b) A new customer subscribes to the Premium plan in their first month, January. Find the probability that this customer will have the Premium plan in March of the same year.
(c) Find the steady state probability vector for this Markov chain.
The columns of the transition matrix represent the current state (Premium, Basic) and the rows represent the next state (Premium, Basic). Remember that the probabilities in each column must sum to 1.
The initial state is that the customer has the Premium plan, so the initial state vector is . March is two months after January, so you need to calculate the state after two transitions.
The steady state vector, , is a probability vector that does not change from one state to the next. It must satisfy the equation . Let and solve for .
No question on this page matches those filters. Try another difficulty or paper.
1,013 more IB Math AI questions in the app
Every answer is marked mark by mark, IB-style, and the AI tutor helps when you are stuck.
Where marks are lost
- Using your own wrong value after failing a "show that." All follow through is withdrawn for the rest of that question.
- Leaving an answer in calculator notation. Never accepted in a final answer, and AI's constant calculator use makes this the easiest slip in the whole subject.
Links to other topics and subjects
- International-mindedness: the "Bridges of Konigsberg" problem.
- Links to websites: adjacency matrices and airlines. PageRank is one method for determining the importance rank of a webpage, simulation at www.eprisner.de/MAT103/PageRank.html