4. An ant is at vertex $A$ of a cube $A B C D-E F G H$, and each time it moves to one of the three adjacent vertices with equal probability. What is the probability that the ant is back at vertex $A$ after six moves? $\qquad$ .
As shown in the figure, the 8 vertices are divided into 4 groups: $\{A\},\{B, D, E\}$, $\{C, F, H\},\{G\}$. Let the probabilities of the ant being at the vertices corresponding to the 4 sets after the $n$-th crawl be $a_{n}, b_{n}, c_{n}, d_{n}$, respectively, then
$$
\begin{array}{l}
a_{n+1}=\frac{1}{3} b_{n}, b_{n+1}=a_{n}+\frac{2}{3} c_{n}, c_{n+1}=\frac{2}{3} b_{n}+d_{n} \\
d_{n+1}=\frac{1}{3} c_{n} . \text { Thus }\left(a_{1}, b_{1}, c_{1}, d_{1}\right)=(0,1,0,0) \\
\left(a_{2}, b_{2}, c_{2}, d_{2}\right)=\left(\frac{1}{3}, 0, \frac{2}{3}, 0\right) ; \\
\left(a_{3}, b_{3}, c_{3}, d_{3}\right)=\left(0, \frac{7}{9}, 0, \frac{2}{9}\right) ;\left(a_{4}, b_{4}, c_{4}, d_{4}\right)=\left(\frac{7}{27}, 0, \frac{20}{27}, 0\right) ; \\
\left(a_{5}, b_{5}, c_{5}, d_{5}\right)=\left(0, \frac{61}{81}, 0, \frac{20}{81}\right) ; \quad\left(a_{6}, b_{6}, c_{6}, d_{6}\right)=\left(\frac{61}{243}, 0, \frac{182}{243}, 0\right) .
\end{array}
$$

Therefore, the probability of the ant returning to vertex $A$ after six crawls is $\frac{61}{243}$.