Turing machine loop and reject example
Here's a different way to think about it. Every step, the Turing machine looks at the current cell of the tape, then does the following:


Optionally, move the head left or right
Select a new state, or accept, or reject


If it accepts or rejects, it halts and doesn't do anything further. But this won't necessarily happen: it's also possible for it to get stuck in a loop it can never get out of. Imagine the following machine:


  State 0: if you see a 0, don't move, go to state 0
  State 0: if you see a 1, don't move, go to state 0  


It's never going to get out of state zero, it'll just stay in it forever.

It's possible for a single machine to do all three, depending on its input:


  State 0: if you see a 0, don't move, go to state 0
  State 0: if you see a 1, move right, go to state 1
  State 1: if you see a 0, don't move, reject
  State 1: if you see a 1, don't move, accept


Given the input 0 it'll loop, given the input 10 it'll reject, given the input 11 it'll accept.