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.)
Depends heavily on the context. If one can unambiguously understand what you mean you are fine. Using i and j to describe two indexes reads very easily, but not when i refers to three different things in one line of reasoning (so using the same symbols in a proof for example). On the other hand, when your indexes start getting subscripts of their own, like $i^h_{k, top}$ then you should stop and reconsider your life.