Clear Notion Academy

Matrices and Determinants (Beyond Advanced) Practice: A directed graph has vertices 1,2,3 and exactly four arcs: 1 2 , 2 3 , 3 1 and 3 2 (shown…

Question

A directed graph has vertices 1,2,31,2,3 and exactly four arcs: 1→21\to2, 2→32\to3, 3→13\to1 and 3→23\to2 (shown in the figure; there are no other arcs and no loops). A walk of length nn is a sequence of nn consecutive arcs, and arcs may be reused. Find the number of walks of length 2020 that start at vertex 33 and end at vertex 22.

Answer

Answer: 151

Hint

Let A=[aij]A=[a_{ij}] with aij=1a_{ij}=1 when there is an arc i→ji\to j, and recall that (An)ij(A^n)_{ij} counts walks of length nn. Compute A3A^3 and compare it with AA and II.

Solution

The adjacency matrix is A=[010001110]A=\begin{bmatrix}0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 0\end{bmatrix} and the number of walks of length nn from ii to jj is (An)ij(A^n)_{ij} (induction on nn using the definition of the product). Direct multiplication gives A2=[001110011]A^2=\begin{bmatrix}0 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 1 & 1\end{bmatrix} and A3=[110011111]=A+IA^3=\begin{bmatrix}1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 1 & 1\end{bmatrix}=A+I. Multiply A3=A+IA^3=A+I by AnA^{n}: An+3=An+1+AnA^{n+3}=A^{n+1}+A^{n}, so every entry of AnA^n satisfies sn+3=sn+1+sns_{n+3}=s_{n+1}+s_n. For the entry in row 33, column 22: s0=0s_0=0, s1=1s_1=1, s2=1s_2=1, and the recurrence gives 0,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,1510,1,1,1,2,2,3,4,5,7,9,12,16,21,28,37,49,65,86,114,151 for n=0,…,20n=0,\dots,20. So s20=151s_{20}=151. Enumerating walks directly is hopeless; the relation A3=A+IA^3=A+I reduces the work to twenty additions. Using A2A^2 instead of A3A^3 in the recurrence (a Fibonacci-style slip) gives a different, wrong sequence.

More questions from Matrices and Determinants (Beyond Advanced) Practice

Practise the full set: Matrices and Determinants — Beyond Advanced