The Meaning of the Variables
Q[i,qj] means that at time i, MX is in state qj
H[i,j] means that at time i, MX is scanning tape square j. Note that in p(n) transitions, the read-write head can move at most distance p(n) from its starting point.
S[i,j,sk] means that at time I, the contents of tape square j is sk.