Problem: A bug starts at a vertex of an equilateral triangle. On each move, it randomly selects one of the two vertices where it is not currently located, and crawls along a side of the triangle to that vertex. Given that the probability that the bug moves to its starting vertex on its tenth move is $m/n,$ where $m$ and $n$ are relatively prime positive integers, find $m + n.$

Solution: As a note, do NOT do this on the exam as it will eat up your time, but feel free to experiment around with this if you have a good enough understanding of linear algebra. This writeup will be extremely lengthy because I am assuming just very basic concepts of linear algebra. The concepts here extend to higher levels of mathematics, so feel free to explore more in depth so that you can end up solving almost any variation of this classic problem.
There are a possible of 3 states for this problem, so we can model the problem as a stochastic process. The resulting process has a transition matrix of:
\[\hat{T} = \begin{bmatrix} 0 & 0.5 & 0.5\\ 0.5 & 0 & 0.5\\ 0.5 & 0.5 & 0 \end{bmatrix}\]
We aim to diagonalize this transition matrix to make it easier to exponentiate by converting it into what's known as it's Jordan Canonical Form.
In order to do this, we must extract the eigenvalues and eigenvectors of the matrix. The eigenpolynomial for this matrix is obtained by calculating this matrix's determinant with $0-\lambda$ about it's main diagonal like so: \[\hat{T}_{\lambda} = \begin{bmatrix} 0-\lambda & 0.5 & 0.5\\ 0.5 & 0-\lambda & 0.5\\ 0.5 & 0.5 & 0-\lambda \end{bmatrix}\]
We have the matrix's eigenpolynomial to be $\lambda^3 - \frac{3\lambda}{4} + \frac{1}{4}$ , and extracting eigenvalues by setting the polynomial equal to $0$ , we have 2 eigenvalues: $\lambda_1 = 1$ of multiplicity 1, and $\lambda_2 = -\frac{1}{2}$ of multiplicity 2. To extract the eigenvectors, we must assess the kernel of this matrix (also known as the null space), or the linear subspace of the domain of $\hat{T}$ where everything gets mapped to the null vector.
We first do this for $\lambda_1$ . Taking $-\lambda_1$ across the diagonals to get $\hat{T}_{\lambda_1} = \begin{bmatrix} -1 & 0.5 & 0.5\\ 0.5 & -1 & 0.5\\ 0.5 & 0.5 & -1 \end{bmatrix}$ , we first reduce it to reduced row echelon form, which is $\begin{bmatrix} 1 & 0 & -1\\ 0 & 1 & -1\\ 0 & 0 & 0 \end{bmatrix}$ . From here, we compute the kernel by setting \[\begin{bmatrix} 1 & 0 & -1\\ 0 & 1 & -1\\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} x_1\\ x_2\\ x_3  \end{bmatrix} = 0\] . So if we take our free variable $x_3 = 0 = t$ , then that means that in the same fashion, $x_1 - x_1 = x_2 - x_2 = 0 = t$ , so hence, the kernel of $\hat{T}_{\lambda} = \begin{bmatrix} t\\ t\\ t \end{bmatrix}$ , or more simply, $t\begin{bmatrix} 1\\ 1\\ 1 \end{bmatrix}$ $\begin{bmatrix} 1\\ 1\\ 1 \end{bmatrix}$ is the eigenvector corresponding to $\lambda_1$ . We do the same computations for our second unique eigenvalue, but I will save the computation to you. There are actually 2 eigenvectors for $\lambda_2$ , because the reduced row echelon form for $\hat{T}_{\lambda_2}$ has 2 free variables instead of 1, so our eigenvectors for $\lambda_2$ are $\begin{bmatrix} -1\\ 1\\ 0 \end{bmatrix}, \begin{bmatrix} -1\\ 0\\ 1 \end{bmatrix}$ . We are now ready to begin finding the Jordan canonical form
In linear algebra, the JCF (which also goes by the name of Jordan Normal Form) is an upper triangular matrix representing a linear transformation over a finite-dimensional complex vector space. Any square matrix that has a Jordan Canonical Form has its field of coefficients extended into a field containing all it's eigenvalues. You can find more information about them on google, as well as exactly how to find them but for now let's get on with the problem. I will skip the computation in this step, largley because this writeup is already gargantuan for a simple AIME problem, and because there are countless resources explaining how to do so.
We aim to decompose $\hat{T}$ into the form $\hat{T} = SJS^{-1}$ , where $S$ is a matrix whose columns consist of the eigenvectors of $\hat{T}$ $J$ is the Jordan matrix, and $S^{-1}$ is, well, the inverse of $S$ . We have 1 eigenvalue of multiplicity 1, and 1 of multiplicity 2, so based on this info, we set our eigenvalues along the diagonals like so.
We have: \[J = \begin{bmatrix} -\frac{1}{2} & 0 & 0\\ 0 & -\frac{1}{2} & 0\\ 0 & 0 & 1 \end{bmatrix}, S = \begin{bmatrix} -1 & -1 & 1\\ 0 & 1 & 1\\ 1 & 0 & 1 \end{bmatrix}, S^{-1} = \frac{1}{3}\begin{bmatrix} -1 & -1 & 2\\ -1 & 2 & -1\\ 1 & 1 & 1 \end{bmatrix}\] and so: \[\hat{T} = \begin{bmatrix} 0 & 0.5 & 0.5\\ 0.5 & 0 & 0.5\\ 0.5 & 0.5 & 0 \end{bmatrix} = SJS^{-1} = \begin{bmatrix} -1 & -1 & 1\\ 0 & 1 & 1\\ 1 & 0 & 1 \end{bmatrix}\begin{bmatrix} -\frac{1}{2} & 0 & 0\\ 0 & -\frac{1}{2} & 0\\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} -\frac{1}{3} & -\frac{1}{3} & \frac{2}{3}\\ -\frac{1}{3} & \frac{2}{3} & -\frac{1}{3}\\ \frac{1}{3} & \frac{1}{3} & \frac{1}{3} \end{bmatrix}\] Now that we have converted to Jordan Canonical Form, it is extremely easy to compute $\hat{T}^n$
It is an important fact that for any matrix $K$ with Jordan decomposition $SJ_kS^{-1}$ , we have that $K^n = S(J_k)^nS^{-1}$ Using this fact, we aim to find the general solution for the problem. $J^n = \begin{bmatrix} \left(-\frac{1}{2}\right)^n & 0 & 0\\ 0 & \left(-\frac{1}{2}\right)^n & 0\\ 0 & 0 & 1 \end{bmatrix}$ , and using the laws of matrix multiplication, \[SJ^n = \begin{bmatrix} (-1)^{n+1}\left(\frac{1}{2}\right)^n & (-1)^{n+1}\left(\frac{1}{2}\right)^n & 1\\ 0 & \left(-\frac{1}{2}\right)^n & 1\\ \left(-\frac{1}{2}\right)^n & 0 & 1 \end{bmatrix}\] So finally, our final, generalized transition matrix after any number of steps $n$ is: \[\hat{T}^n = \begin{bmatrix} \frac{1}{3} - \frac{1}{3}(-1)^{1+n}(2)^{1-n} & \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)} & \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)}\\ \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)} & \frac{1}{3} - \frac{1}{3}(-1)^{1+n}(2)^{1-n} & \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)}\\ \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)} & \frac{1}{3} + \frac{1}{3}(-1)^{n+1}(2)^{1-(1+n)} & \frac{1}{3} - \frac{1}{3}(-1)^{1+n}(2)^{1-n} \end{bmatrix}\]
For the sake of this problem, we seek the top left element, which is $\frac{1}{3} - \frac{1}{3}(-1)^{1+n}(2)^{1-n}$ . Substituting $n=10$ readily gives the probability of the bug reaching it's starting position within 10 moves to be $\frac{171}{512} \implies m+n = \boxed{683}$

Answer:  683