Turing Machines n1
Turing Machines n1
A Turing Machine (TM) is a theoretical computing model introduced by Alan Turing in 1936. It is a
mathematical abstraction used to formalize the concept of computation and algorithm. A TM is
considered one of the most powerful models of computation and is widely used in theoretical computer
science to explore the limits of what can be computed.
Operation of a TM
The machine reads a symbol from the tape, changes state based on the transition function δ, writes a
symbol on the tape, and moves its tape head left (L) or right (R). The process repeats until it enters either
the accept or reject state.
Unary Addition TM: A TM that takes an input in unary (e.g., "111+111") and outputs their sum
in unary (e.g., "111111").
Binary Addition TM: A TM designed to perform binary addition on numbers represented on the
tape.
Palindrome Checker TM: A TM that checks if a given input string is a palindrome (reads the same
forwards and backwards).
A function f:Σ∗→Σ∗ is a partial function if it is defined for some inputs and undefined for others. TMs
can be used to compute partial functions by defining transitions that accept certain inputs and reject
others.
Computing the Function f(x)=x+1 for unary numbers: The TM reads the input string in unary and
appends one more '1' symbol to compute the result.
A TM that halts on all inputs computes a total function, while a TM that may not halt on some inputs
computes a partial function.
Complex computations can be achieved by combining simpler TMs. This involves constructing a TM that
can simulate multiple TMs in sequence.
Sequential Composition
To compute a function g(f(x)) where f and g are each computed by individual TMs, Mf and Mg, we can
create a combined TM that:
Parallel composition allows two TMs to operate independently on different parts of the input. However,
this requires a multi-tape TM for full efficiency.
There are multiple variations of the standard TM model, each with unique properties:
Multi-tape Turing Machine: A TM with more than one tape, each with its own tape head,
allowing it to perform operations more efficiently.
Non-deterministic Turing Machine (NDTM): A TM where the transition function allows multiple
possible moves. It "branches" into multiple computational paths and accepts an input if any
branch leads to an accept state.
Universal Turing Machine (UTM): A TM capable of simulating any other TM given its description
and input. The UTM is a foundational concept for the theory of computation.
A multi-tape TM has multiple tapes, each with its own head. The transition function in a multi-tape TM
is: δ:Q×Γk→Q×Γk×{L,R}k where k is the number of tapes.
Multi-tape TMs are often more efficient than single-tape. TMs because they can store intermediate
results on separate tapes, reducing the need for back-and-forth movement on a single tape.
Example
A multi-tape TM can perform addition by placing two numbers on separate tapes and combining them
on a third tape, which simplifies the computation.
Non-deterministic Turing Machines allow for multiple possible transitions for a given state and symbol,
meaning the TM can "choose" between transitions.
An NDTM recognizes a language if there exists at least one computational path that leads to the accept
state for every input string in the language. If no path leads to an accept state, the machine rejects the
input.
Practical Implications
NDTMs are theoretically more powerful in terms of conceptual modeling but do not offer more
computing power in practice since any NDTM can be simulated by a deterministic TM, albeit with
potential exponential time overhead.
Structure of a UTM
The UTM takes a "description" of a TM (often encoded as a string) and an input to that TM. It then
simulates the TM's behavior on that input, thereby functioning as a general-purpose computer.
The UTM is a foundational concept in computer science because it demonstrates that a single machine
can perform any computation given the appropriate description and input.
The Church-Turing Thesis posits that any function that can be computed algorithmically can be
computed by a Turing Machine. While not formally provable, this thesis has strong empirical support and
is a foundational assumption in computer science.
The thesis implies that any physically realizable computing device has no greater power than a Turing
Machine, making TMs the standard model for defining computable functions.