I'm trying to appropriate myself some notions related to Markov chains (for which I'm not at all a specialist) and I have this question about the notion of "number of visits" in a certain state.
Let $(X_t)_{t \in \mathbb{N}}$ be a homogeneous Markov chain with transition matrix $(P_{i,j})$ and states ${1,2,…,n}$.
I define the number of visits to state $j$ by $$N_j = \sum_{t=0}^\infty \mathbb{1}_{X_t = j}$$
Does it make sense to define the mean number of visits to state $j$ starting from state $i$ by $v_{j,i} = \mathbb{E} (N_j \, | \, X_0=i)$ ?
In that case, is it right to write the following: $$ v_{j,i} = \mathbb{E} \left((\sum_{t=0}^\infty \mathbb{1}_{X_t = j}) \, | \, X_0=i \right) = \mathbb{E} \left( \sum_{t=0}^\infty (\mathbb{1}_{X_t = j} \, | \, X_0=i) \right) = \sum_{t=0}^\infty \mathbb{E}(\mathbb{1}_{X_t = j} \, | \, X_0=i) = \sum_{t=0}^\infty P^t_{i,j} $$
If it is, I then say that a state $j$ in recurrent if and only if $v_{j,j} = \infty$ and transient if and only if $v_{j,j} < \infty$. Am I right in using these definitions?
Thank you for any comments that would help me better understand if something is wrong...