8. A person tosses a coin, with the probability of landing heads up and tails up being $\frac{1}{2}$ each. Construct the sequence $\left\{a_{n}\right\}$, such that $a_{n}=\left\{\begin{array}{ll}1, & \text { if the } n \text {th toss is heads; } \\ -1, & \text { if the } n \text {th toss is tails. }\end{array}\right.$ Let $S_{n}=a_{1}+a_{2}+\cdots+a_{n}$. Then the probability that $S_{2} \neq 0$, and $S_{8}=2$ is $\qquad$ (answer in simplest fraction form).
8. $\frac{13}{128}$.

From $S_{2} \neq 0$, we know that the first two tosses are either both heads or both tails.

When the first two tosses are both heads, by $S_{8}=2$, we know that in the next six tosses, there must be three heads and three tails, the probability of which is
$$
P_{1}=\left(\frac{1}{2}\right)^{2} \mathrm{C}_{6}^{3}\left(\frac{1}{2}\right)^{6}=\frac{5}{64} \text {. }
$$

When the first two tosses are both tails, by $S_{8}=2$, we know that in the next six tosses, there must be five heads and one tail, the probability of which is
$$
P_{2}=\left(\frac{1}{2}\right)^{2} \mathrm{C}_{6}^{5}\left(\frac{1}{2}\right)^{6}=\frac{3}{128} \text {. }
$$

Therefore, the required probability is $P_{1}+P_{2}=\frac{13}{128}$.