When writing about an algorithm or any mathematical construct, is it permissible to re-use already introduced notation, e.g. to describe a general case?
For example, I am writing about an algorithm and I have defined a sequence $A = {a_1, a_2, ... a_n}$, where I also define $a_i$ as well as $a_j$ to mark points within the sequence, and I defined $i,j \in \lbrace 1,2,...,n \rbrace$.
Now, for another part of the same algorithm, I want to define a Markov matrix $B$, and in there, I want to write "..., for example if state $i$ moves into state $j$, then ...". Note that I am using $i$ and $j$ in context of a general description for this matrix and not in reference to $A$.
Is this permissible, or what are the recommended ways of doing so?
(I am not asking for help in regards to the algorithm, and I could have used any other example. Thus, my question only relates to general advice on how to name variables.)