Solution (source code)

= Solution

With states ordered as $(A,B,C)$ and rows representing the current state, the <Markov chain> has transition <matrix>
$$
\boxed{
P=\begin{pmatrix}
0&1/2&1/2\\
3/4&0&1/4\\
3/4&1/4&0
\end{pmatrix}}.
$$