I'm preparing for an exam and I already know, if you have a transition matrix of a Markov chain given, how to calculate the probability to reach state $A$ from state $B$.
But I don't know how to reach one state in specific steps from another state.
Let's say there is this transition matrix given of a Markov chain:
$$P=\begin{pmatrix} 0.3 & 0.3 & 0.4\\ 0.2 & 0.7 & 0.1\\ 0.2 & 0.3 & 0.5 \end{pmatrix}$$
On the internet I have found a formula to calculate the probability to reach state $i$ (for the first time) after $n$ steps when you start from $i$: $$f_{i}^{(n)} = P\left(X_n=i, X_k \neq i \text{ for } 1 \leq k < n \mid X_0=i\right)$$
Or another formula (different site) I found: $$p_{ij}^{k} := P\left[X_{t+k} = j \mid X_t=i\right]=(P^k)_{ij}$$
, the probability to reach state $j$ in exactly $k$ steps starting from state $i$
Buuut I don't really understand anything here... How can I use this formula? :c
Let's say I wanted calculate the probability $f_{02}^{3}$ so to start from state $0$ and reach state $2$ in $3$ steps, how would this be done? Or some other example (if mine is badly chosen) where I can see how this works please? :/