Construct a Turing Machine which test if a given character string consists of n zeros followed by n ones.


valid string



invalid strings

Initial condition

The character string is bounded by #-symbols on both sides. The read/write-head starts on the left #-symbol.

Final condition

If the input is valid, the Turing Machine has to halt in an empty world. If the input string is not valid, the world may not be empty upon termination.