Turing Machines as Functions
Learn about the various applications of Turing machines.
Turing machines can also act as functions by leaving output on the tape. The following computes . We encode numbers in unary notation, so , etc. The idea is to use two states for evenness vs. oddness and then leave either a or on the tape.
Press + to interact
States and change all 's to blanks. The state is the halt state. When a number is even, a blank will eventually appear while in state , so we erase all the ’s and leave a on the tape. From ...
Access this course and 1400+ top-rated courses and projects.