Lecture#24-Universal Turing Machine
Lecture#24-Universal Turing Machine
Lecture#24
blog.bazaarvoice.com
Umar Faiz
Pakistan Institute of Engineering and Applied Sciences
TURING MACHINE
Input Tape
alphabet alphabet
States
is a finite set of symbols
containing as its
M (Q, , , , q0 , , F ) subset and it is the set of
tape symbols
Transition Final
function Initial states
blank
state
Slides based on Costas Busch - RPI
UNIVERSAL TURING MACHINES
• The Turing model is a better model for a general-purpose computer. This
model adds an extra element to the specific computing machine: the
program. A program is a set of instructions that tells the computer what to
do with data.
Tape 3
M
State of M
Slides based on Costas Busch - RPI
UNIVERSAL TURING MACHINES
Tape 1
Description of M
States: q1 q2 q3 q4
Move: L R
Encoding: 1 11
Encoding: 1 0 1 0 11 0 11 0 1
separator
Transitions:
Encoding:
1 0 1 0 11 0 11 0 1 00 11 0 1 10 111 0 111 0 11
separator
Slides based on Costas Busch - RPI
UNIVERSAL TURING MACHINES
Tape 1 contents of Universal Turing Machine:
Encoding of the simulated machine M as a binary string of 0’s and 1’s
111010011110010101,
…… } (Turing Machine …)
Even integers: 0, 2, 4, 6,
Correspondence:
Positive integers: 1, 2 , 3 , 4 ,
2n corresponds to n 1
Slides based on Costas Busch - RPI
COUNTABLE SETS: RATIONAL NUMBERS
Example: The set of rational numbers is countable
1 3 7
Rational numbers: , , ,
2 4 8
Positive integers: 1, 2, 3,
Doesn’t work:
we will never count 2 2 2
numbers with numerator 2: , , ,
1 2 3
Slides based on Costas Busch - RPI
RATIONAL NUMBERS
Diagonalization to show correspondence with N:
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1
Slides based on Costas Busch - RPI
RATIONAL NUMBERS
Diagonalization to show correspondence with N:
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1
Slides based on Costas Busch - RPI
RATIONAL NUMBERS
Diagonalization to show correspondence with N:
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1
Slides based on Costas Busch - RPI
RATIONAL NUMBERS
Diagonalization to show correspondence with N:
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
Slides based on Costas Busch - RPI
1
RATIONAL NUMBERS
Diagonalization to show correspondence with N:
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
Slides based on Costas Busch - RPI 1
RATIONAL NUMBERS
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
Slides based on Costas Busch - RPI
1
RATIONAL NUMBERS
1 1 2 1 2
Rational Numbers: , , , , ,
1 2 1 3 2
Correspondence:
Positive Integers: 1, 2, 3, 4, 5,
– We assume here is that each and every real number appears somewhere on this
list. We show that this is in fact wrong by making a new number that does not show
up in the list.
S
The powerset 2 of S is uncountable
Elements of S
Elements of the powerset have the form:
{s1 , s3}
{s5 , s7 , s9 , s10 }
……
Slides based on Costas Busch - RPI
UNCOUNTABLE SETS
We encode each element of the power set with a binary string of 0’s and
1’s Powerset Encoding
element s1 s2 s3 s4
{s1} 1 0 0 0
{s2 , s 3 } 0 1 1 0
{s1 , s 3 , s4 } 1 0 1 1
Slides based on Costas Busch - RPI
UNCOUNTABLE SETS
Let’s assume (for contradiction) that the powerset is countable, then we can
enumerate the elements of the powerset.
t2 1 1 0 0 0
t3 1 1 0 1 0
t4 1 1 0 0 1
Slides based on Costas Busch - RPI
UNCOUNTABLE SETS
Take the powerset element whose bits are the complements of the diagonal
t1 1 0 0 0 0
t2 1 1 0 0 0
t3 1 1 0 1 0
t4 1 1 0 0 1
New element: 0011
(birary complement of diagonal)
Slides based on Costas Busch - RPI
UNCOUNTABLE SETS
The new element must be some ti of the powerset
From the definition of ti the ith bit of ti must be the complement of itself,
which is not possible.
M1 M2 M3 ?
Turing machines: countable
Lk
Languages
Accepted by
Turing Machines