Determining the first return distribution of 2-states Markov chain 
A Markov chain has the transition matrix $$
       P= \begin{pmatrix}
       1-a & a \\
        b & 1-b \\
       \end{pmatrix}
$$
  Find the first return distribution $f_{00}^n=\Pr\{X_1\neq 0,...,X_{n-1} \neq0,X_n=0\mid X_0=0\}$.

My attempt:
For $n=0$, $f_{00}^0$=$0$.
For n=1, $f_{00}^1$=$1=a$.
For n=2, $f_{00}^2$=Pr{$X_1\neq 0,X_2=0 |X_0=0$}=$(1-a)^2$+ab
For n=3, $f_{00}^3$=$(1-a)^3$+2ab(1-a)+ab(1-b)
And my idea was to make a generalization knowing the first results but I couldn't find the pattern because from n=2 to n=3 the expressions changes a lot and I think I'll change more for n=4.
Is there another  way to find the first return distribution $f_{00}^n$, without using software?
 A: Draw the state transition diagram and find out the possible transitions.
The following is the state transition diagram:

Note that $f_{00}^{(1)}=p_{00}^{(1)}=1-a$. 
\begin{eqnarray*}
f_{00}^{(1)}&=&p_{00}^{(1)}=1-a\\
f_{00}^{(2)}&=&p_{01}^{(1)}p_{10}^{(1)}=a\cdot b\\
f_{00}^{(3)}&=&p_{01}^{(1)}p_{11}^{(1)}p_{10}^{(1)}=a\cdot (1-b)\cdot b\\
f_{00}^{(4)}&=&p_{01}^{(1)}\underbrace{p_{11}^{(1)}p_{11}^{(1)}}p_{10}^{(1)}=a\cdot (1-b)^2\cdot b\\
f_{00}^{(4)}&=&p_{01}^{(1)}\left(p_{11}^{(1)}\right)^2p_{10}^{(1)}=a\cdot (1-b)^2\cdot b\\
\vdots&=&\vdots\\
f_{00}^{(n)}&=&p_{01}^{(1)}\left(p_{11}^{(1)}\right)^{n-2}p_{10}^{(1)}=a\cdot (1-b)^{n-2}\cdot b,\qquad \text{ for } n\geq 2.\\
\end{eqnarray*}
However, if the state space is slightly large, then the following recursive formula will be useful:
\begin{equation*}
F^{(n+1)}=P\left( F^{(n)}-F_{d}^{(n)}\right)
\end{equation*}
where $P$ is the transition probability matrix of a Markov chain, $F^{(n)}=\left(f_{ij}^{(n)}\right)$ and  $F_{d}^{(n)}$ denotes a diagonal matrix containing the diagonal elements of $F^{(d)}$. \
Consider a Markov chain whose TPM is
\begin{equation*}
P=\left( \begin{array}{cc}
1-a & a\\
b & 1-b
\end{array}
\right)=F
\end{equation*}
Then,
\begin{equation*}
F_{d}^{(1)}=\left( \begin{array}{cc}
1-a & 0\\
0 & 1-b
\end{array}
\right)
\end{equation*}
\begin{equation*}
F^{(2)}=P\left(F^{(1)}-F_{d}^{(1)}\right)=\left( \begin{array}{cc}
1-a & a\\
b & 1-b
\end{array}
\right)\cdot \left( \begin{array}{cc}
0 & a\\
b & 0
\end{array}
\right)=\left( \begin{array}{cc}
ab & a(1-a)\\
b(1-b) & ab
\end{array}
\right)
\end{equation*}
\begin{equation*}
F^{(3)}=P\left(F^{(2)}-F_{d}^{(2)}\right)=\left( \begin{array}{cc}
1-a & a\\
b & 1-b
\end{array}
\right)\cdot \left( \begin{array}{cc}
0 & a(1-a)\\
b(1-b) & 0
\end{array}
\right)=\left( \begin{array}{cc}
ab(1-b) & a(1-a)^2\\
b(1-b)^2 & ab(1-a)
\end{array}
\right)
\end{equation*}
