5. Two people, A and B, take turns tossing a coin until it lands heads up or tails up, with the rule that the first to toss heads up wins; the loser of the previous game tosses first in the next game. If A tosses first in the first game, then the probability that A wins the $n$-th game is $\qquad$ .
5. $\frac{1}{2}+\frac{1}{6}\left(-\frac{1}{3}\right)^{n-1} \quad(n \geqslant 1)$.

Let the probability of player A winning the $n$-th game be $p_{n}$, and in each game, the probability of the player who goes first winning is
$$
\frac{1}{2}+\left(\frac{1}{2}\right)^{3}+\cdots+\left(\frac{1}{2}\right)^{2 n-1}+\cdots=\frac{2}{3} \text {. }
$$

Then $p_{1}=\frac{2}{3}$,
$$
p_{n}=\frac{1}{3} p_{n-1}+\frac{2}{3}\left(1-p_{n-1}\right)=\frac{2}{3}-\frac{1}{3} p_{n-1} \text {. }
$$

Thus, $p_{n}-\frac{1}{2}=-\frac{1}{3}\left(p_{n-1}-\frac{1}{2}\right)$,
$$
p_{1}-\frac{1}{2}=\frac{1}{6} \text {. }
$$

Therefore, $p_{n}=\frac{1}{2}+\frac{1}{6}\left(-\frac{1}{3}\right)^{n-1}(n \geqslant 1)$.