In the same very productive paper, Turing also proves that deciding if an arbitrary program will output an infinite number of symbols, cannot be done in finite time. His proof is quite cognitively challenging, but Tom LeBlanc has a version that is easier to follow [2].
I also implemented one of his early examples, which prints the sequence
001011011101111...
A solution to this is described in table form:
![]() |
Turing uses very stylistic letters as notation, which are ironically not very computer-friendly |
I keep track of the tape using a dict. Both tape, head, and state are global variables.
Conclusions
Using a Turing machine is a very pure way of programming. That is to say, one works with an extremely small set of operations, and one needs to model every detail of the problem. It feels like building a house by starting collecting mud from the creek instead of buying bricks.
It is not an efficient way of programming, even if one would implement the operations directly in hardware. Modern hardware is better than being able to see a single symbol at a time. It is not efficient for the programmer either. It is tricky to debug and a hard way to model problems. The Turing machine mostly has value as a theoretical tool.
[1] On Computable Numbers (Turing 1936)
[2] Undecidability
Inga kommentarer:
Skicka en kommentar