Search⌘ K

The Universal Turing Machine

Explore the concept of the Universal Turing Machine, which can simulate any other Turing machine by reading encoded instructions and input strings. Understand how this idea models general-purpose computation and the method for encoding Turing machines as strings. Gain insight into the foundational principles linking Turing machines and modern computers in this lesson.

The rationale for a universal Turing machine

The Turing machines we have seen so far are single-purpose automata—they only solve one problem or accept one language. Alan Turing went beyond that in his research to define a universal machine, a TM\text{TM} capable of simulating any other TM\text{TM}. The universal Turing machine (UTM)\text{(UTM)} takes two inputs: a symbolic encoding of another machine and an input string. It then simulates the execution of the input machine on the input string and yields the result of that execution. This should sound familiar—that’s exactly how general-purpose computers operate, and the UTM\text{UTM} is where the idea of a stored-program computing mechanism originated. In other words, programs are just strings (rendered in some encoding) fed into a computer, and the computer runs the program on whatever input we give it.

Note: Just as a Turing machine models a specific computational process, the universal Turing machine models a computer.

Converting a Turing machine for use in a UTM

Recall that the operation of a TM\text{TM} is defined by its transition function, δ\delta. Each element in δ\delta is a pairing of two inputs with three outputs, which we can represent as a 5-tuple. For example, the transition δ(q0,a)=(q1,b,)\delta(q_0,a)=(q_1,b,\to) can be represented in text by the string “q0,a,q1,b,Rq_0,a,q_1,b,R ...