More on Turing Machines.
Example to see how TMs work: check that a string has 2n 0’s, for some n.
M: On input string w:
- Sweep left to right across the tape, crossing off every other 0.
- If in stage 1 the tape contained a single 0, ACCEPT
- If in stage 1 the tape contained an odd number of 0’s (but more than one), REJECT
- Return he head to the left-hand end of the tape
- Start over.