12. To relieve students' stress, a class in the senior year of a certain school held a basketball shooting game, during which two students, A and B, took turns in a fixed-point shooting competition (each person shoots once per round). Under the same conditions, in each round, A and B stand at the same position, A shoots first, and each person shoots once. If one of them hits, the one who hits gets 1 point, and the one who misses gets -1 point; if both hit or both miss, both get 0 points. Suppose the probability of A hitting each shot is $\frac{2}{3}$, and the probability of B hitting each shot is $\frac{1}{2}$, and each shot is independent.
(1) After 1 round of shooting, let A's score be $X$. Find the distribution of $X$ and its expectation;
(2) If after $n$ rounds of shooting, use $p_{i}$ to denote the probability that A's cumulative score is lower than B's cumulative score after the $i$-th round of shooting.
(i) Find $p_{1}, p_{2}, p_{3}$;
(ii) Given $p_{0}=0$, and from computer simulation, we have $p_{i}=a p_{i+1}+b p_{i-1}\left(i \geqslant 1, i \in \mathbf{N}^{*}\right)$, please find the values of $a, b$ based on the values of $p_{1}, p_{2}, p_{3}$ from (i), and then find the general term formula of the sequence $\left\{p_{n}\right\}$.
(1) $X=-1,0,1$, and $P(X=-1)=\frac{1}{3} \times \frac{1}{2}=\frac{1}{6}, P(X=0)=\frac{1}{3} \times \frac{1}{2}+\frac{2}{3} \times \frac{1}{2}=\frac{1}{2}$, $P(X=1)=\frac{2}{3} \times \frac{1}{2}=\frac{1}{3}$. The distribution of $X$ is as follows:
\begin{tabular}{|c|c|c|c|}
\hline$X$ & -1 & 0 & 1 \\
\hline$P$ & $\frac{1}{6}$ & $\frac{1}{2}$ & $\frac{1}{3}$ \\
\hline
\end{tabular}
The expectation of $X$ is $E X=-\frac{1}{6}+\frac{1}{3}=\frac{1}{6}$.
(2) ( i ) $p_{1}=\frac{1}{6}, p_{2}=\frac{1}{6^{2}}+2 \times \frac{1}{6} \times \frac{1}{2}=\frac{7}{36}$,
$p_{3}=\frac{1}{6^{3}}+C_{3}^{2} \times \frac{1}{6^{2}} \times\left(\frac{1}{2}+\frac{1}{3}\right)+C_{3}^{1} \times \frac{1}{6} \times \frac{1}{2^{2}}=\frac{43}{216}$.
( ii ) $\left\{\begin{array}{l}\frac{1}{6}=a \cdot \frac{7}{36}, \\ \frac{7}{36}=a \cdot \frac{43}{216}+b \cdot \frac{1}{6}\end{array} \Rightarrow\left\{\begin{array}{l}a=\frac{6}{7}, \\ b=\frac{1}{7} .\end{array} \Rightarrow p_{n}=\frac{6}{7} p_{n+1}+\frac{1}{7} p_{n-1}\right.\right.$.
Thus, $6 p_{n+1}=7 p_{n}-p_{n-1}$, the characteristic equation is $6 x^{2}-7 x+1=0 \Rightarrow x_{1}=\frac{1}{6}, x_{2}=1$.
Assume $p_{n}=c_{1} \cdot \frac{1}{6^{n}}+c_{2}$, substituting into $\left\{\begin{array}{l}0=c_{1}+c_{2}, \\ \frac{1}{6}=c_{1} \cdot \frac{1}{6}+c_{2}\end{array} \Rightarrow\left\{\begin{array}{l}c_{1}=-\frac{1}{5}, \\ c_{2}=\frac{1}{5} .\end{array}\right.\right.$
In summary, $p_{n}=\frac{1}{5}\left(1-\frac{1}{6^{n}}\right)\left(n \in \mathbf{N}^{*}\right)$.