Now I have a program which will generate a sequence of digits. Each digit will output a number uniformly randomly in $\{0,1,2,3,4,5,6,7,8,9\}$. However it will never print the same digit twice in a row. We will start with digit $0$. And we will stop when we print the sequence $7, 2, 3$. Prove that this program will terminate almost surely. (i.e. $P(\text{stopping time} < \infty) = 1$).
My efforts: I want to show $7$ is a recurrent state and we will reach it for infinite times. And for each time, the probability of not getting $7, 2, 3$ is $\frac{80}{81}$, which is less than $1$. Then for k times the probability that we don't get this sequence is $(\frac{80}{81})^k$ since they are independent for different time we reach $7$. Then when k tends to infinity, the probability will tend to $0$. So the probability of not terminating is $0$.
My definition: Let $\{X_k\}_{k \in \mathbb{Z}_{>=0}}$ be the outputs of the sequence . It's obvious it's a Markov Chain.
Define $T_x = \inf\{n\geq1: X_n = x \}$.
For $k \geq 2$, $T_x^k = \inf\{n> T_x^{k-1}: X_n = x \} \text{ if $T_x^{k-1} < \infty$} $. Otherwise $T_x^k = \infty$. Define $T_x^1 = T_x$.
$\mathbb{P}_y(T_x < \infty)$ means that the probability started from y, at some later time visits state $x$.
I can prove $\mathbb{P}_0(T_7^k < \infty \text{ for }k \in \mathbb{N}) = 1$. But I'm wondering how do I define the number of visits to 7 rigorously. I tried $N_y = \sum_{k=1}^{\infty}I_{\{T_y^k < \infty\}}$. But I cannot rigorously prove $N_7 = \infty$.