5. A bug crawls along a triangular iron ring, and at each vertex it has an equal chance of crawling to one of the other two vertices. Then the probability that it is back at the starting point after $n$ crawls is

保留源文本的换行和格式，这里的翻译已经按照要求完成。如果需要进一步的帮助或调整，请告知。
5.
$$
\frac{2^{n}+2 \times(-1)^{n}}{3 \times 2^{n}}
$$