Вы находитесь на странице: 1из 6

# Universal Turing Machine (UTM):

A Turing Machine is the mathematical tool equivalent to a digital computer. It was suggested by the
mathematician Turing in the 30s, and has been since then the most widely used model of computation
in computability and complexity theory.
The model consists of an input output relation that the machine computes. The input is given in
binary form on the machine's tape, and the output consists of the contents of the tape when the
machine halts.
What determines how the contents of the tape change is a finite state machine (or FSM, also called a
finite automaton) inside the Turing Machine. The FSM is determined by the number of states it has,
and the transitions between them.
At every step, the current state and the character read on the tape determine the next state the FSM
will be in, the character that the machine will output on the tape (possibly the one read, leaving the
contents unchanged), and which direction the head moves in, left or right.
The problem with Turing Machines is that a different one must be constructed for every new
computation to be performed, for every input output relation.
This is why we introduce the notion of a universal Turing machine (UTM), which along with the
input on the tape, takes in the description of a machine M. The UTM can go on then to simulate M on
the rest
Theorem: There is a Turing machine UTM called the universal Turing machine that, when run on
⟨M, w⟩, where M is a Turing machine and w is a string, simulates M running on w.

## The Church Thesis:

What is an algorithm? “A rule for solving a mathematical problem in a finite number of steps”

“Is there a Universal Algorithm which can solve all Mathematical problems?”

Attempts to find one failed. So perhaps there isn‟t one. Can we prove there is no universal algorithm?

## We need to be able to define an algorithm precisely so as to prove properties of algorithms.

An algorithm should be

## • Precise and unambiguous

• Simple

• General

Alan Turing, devised an abstract machine now called a Turing Machine to define/represent algorithms

Alonso Church devised the Lambda Calculus which formalises algorithms as functions.

Neither knew of the other‟s work in progress both published in 1936 the demonstrated equivalence of
their formalisms strengthened both their claims to validity, expressed as the Church-Turing Thesis.
Turing Machines are precise, simple, and general.

## The Church-Turing Thesis:

“A problem can be solved by an algorithm iff it can be solved by a Turing Machine” Turing
Machines implement algorithms. All algorithmically solvable problems can be solved by a Turing
Machine.

“A function is computable iff it can be solved by a Turing Machine” “an algorithm is what a Turing
Machine implements”

Definition:

## A language is recursively enumerable if some Turing machine accepts it.

Let L be a recursively enumerable language and the Turing Machine that accepts it M, w ∈ L, w if
then halts in a final state M if w ∉ L then M halts in a non-final state or loops forever.

Definition:

A language is recursive if some Turing machine accepts it and halts on any input string.

Let L be a recursive language and the Turing Machine that accepts it M, w ∈ L, w if then halts in a
final state M, if w∉ L then M halts in a non-final state.

## Decidability and the Halting Problem:

The problem of decidability may be stated roughly as follows: is it possible for an algorithm to
correctly answer a yes/no question for all possible input?

For example:

Is there an algorithm that will tell us whether or not two arbitrary DFAs recognize the same language?

Is there an algorithm that will tell us whether or not two arbitrary context-free grammars generate the
same language?

Given an arbitrary Turing machine and initial tape, will the Turing machine reach the Halt state?

A problem is decidable if such an algorithm exists. The first problem (deciding whether or not two
DFAs are equivalent) is decidable. The second two problems are undecidable: there is no algorithm
that can correctly answer these questions for all possible input. The last problem (whether or not a
Turing machine will reach the Halt state for some initial tape) is known as the Halting Problem, and is
a very famous problem in the theory of computation.

## The Halting Problem is Undecidable:

Here is a sketch of how you can prove that the Halting problem is undecidable. (This is a summary of
the proof presented in the Wikipedia article on the Halting Problem: see the section entitled "Sketch
of proof".)
Assume that a TM capable of solving the halting problem exists. Call this TM halt. It takes, as input,
the encoded representation of a TM and an input tape on which the encoded TM will run. Let's call
this input pair (p, i): p for "program" (the encoded TM) and i for "input" (the input tape). If input TM
p will halt on input i, then halt halts and outputs "true". If input TM p will not halt on i, then halt halts
and outputs "false". So, we can view halt as a function that takes parameters p and i and produces the
output "true" or "false" depending on whether or not TM p halts on input i.

P halts on
Output “true”;
Halt
p, i Halt
Output “false”;
Halt
P does not halt on

Based on halt, we can trivially construct a new TM, which we can call trouble, which will work as
follows. It first duplicates the entire input tape q, creating two copies of the original input tape. It
then runs halt, using one copy of the original input q as parameter p and the other copy of the original
input q as parameter i. If halt (q, q) outputs "false", then trouble TM halts. If halt (q, q) outputs
"true", then trouble goes into an infinite loop (and thus does not halt).

Halt

q Trouble

## halt (q, q) outputs “true”

Any TM can be encoded as an initial tape. So, let's assume that the encoding of trouble as a tape is
called t.

Consider what will happen when trouble is executed with t as its input tape. Does trouble halt?

If trouble halts, that means that halt(t,t) answered "false". However, that means that trouble does not
halt when given t as input.

If trouble does not halt, that means that halt(t,t) answered "true". However, that means that trouble
does halt when given t as input.

In either case, halt gave the wrong answer. Therefore, given any TM that claims to solve the halting
problem, it is possible to construct a program/input pair for which it will answer incorrectly. So, any
claim that a particular TM solves the Halting problem can be proved false, meaning that the Halting
Problem is undecidable.
The undecidability of the halting problem has several important consequences. The main
consequence is that, in general, it is impossible to predict exactly what a program will do when it is
executed. This problem may be stated as follows:

## Introduction to Undecidability, Undecidable problems about TMs

Decidable Problems:

A problem is decidable if we can construct a Turing machine which will halt in finite amount of time
for every input and give answer as „yes‟ or „no‟. A decidable problem has an algorithm to determine
the answer for a given input.

Examples

Equivalence of two regular languages: Given two regular languages, there is an algorithm and
Turing machine to decide whether two regular languages are equal or not.

Finiteness of regular language: Given a regular language, there is an algorithm and Turing machine
to decide whether regular language is finite or not.

Emptiness of context free language: Given a context free language, there is an algorithm whether
CFL is empty or not.

Undecidable Problems

A problem is undecidable if there is no Turing machine which will always halt in finite amount of
time to give answer as „yes‟ or „no‟. An undecidable problem has no algorithm to determine the

Examples

## Ambiguity of context-free languages: Given a context-free language, there is no Turing machine

which will always halt in finite amount of time and give answer whether language is ambiguous or
not.

Equivalence of two context-free languages: Given two context-free languages, there is no Turing
machine which will always halt in finite amount of time and give answer whether two context free
languages are equal or not.

Everything or completeness of CFG: Given a CFG and input alphabet, whether CFG will generate
all possible strings of input alphabet (∑*)is undecidable.

Regularity of CFL, CSL, REC and REC: Given a CFL, CSL, REC or REC, determining whether
this language is regular is undecidable.

Note: Two popular undecidable problems are halting problem of TM and PCP (Post Correspondence
Problem). Semi-decidable Problems
Post correspondence problem (PCP), Modified PCP: