Академический Документы
Профессиональный Документы
Культура Документы
1
A limitation of Turing Machines:
they execute
only one program
2
Solution: Universal Turing Machine
Attributes:
• Reprogrammable machine
3
Universal Turing Machine
simulates any other Turing Machine M
Description of transitions of M
Initial tape contents of M
4
Tape 1
Three tapes
Description of M
Universal
Tape 2
Turing
Machine
Tape Contents of M
Tape 3
State of M 5
Tape 1
Description of M
6
Alphabet Encoding
Symbols: a b c d
7
State Encoding
States: q1 q2 q3 q4
Move: L R
Encoding: 1 11
8
Transition Encoding
Encoding: 1 0 1 0 11 0 11 0 1
separator
9
Machine Encoding
Transitions:
(q1, a ) (q2 , b, L) (q2 , b) (q3 , c, R)
Encoding:
1 0 1 0 11 0 11 0 1 00 11 0 110 111 0 111 0 11
separator
10
Tape 1 contents of Universal Turing Machine:
11
A Turing Machine is described
with a binary string of 0’s and 1’s
Therefore:
12
Language of Turing Machines
111010011110010101, ……
…… }
13
Countable Sets
14
Infinite sets are either: Countable
or
Uncountable
15
Countable set:
16
Example: The set of even integers
is countable
Even integers: 0, 2, 4, 6,
Correspondence:
Positive integers: 1, 2, 3, 4,
2n corresponds to n 1
17
Example: The set of rational numbers
is countable
1 3 7
Rational numbers: , , ,
2 4 8
18
Naïve Proof
1 1 1
Rational numbers: , , ,
1 2 3
Correspondence:
Positive integers: 1, 2, 3,
Doesn’t work:
we will never count 2 2 2
, , ,
numbers with nominator 2: 1 2 3
19
Better Approach
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 20
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 21
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 22
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 23
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 24
1 1 1 1
1 2 3 4
2 2 2
1 2 3
3 3
1 2
4
1 25
1 1 2 1 2
Rational Numbers: , , , , ,
1 2 1 3 2
Correspondence:
Positive Integers: 1, 2, 3, 4, 5,
26
We proved:
27
Definition
and
29
Enumeration Machine
Configuration
Time 0
q0
Time t1 x1 # s1
qs
30
Time t2 x2 # s2
qs
Time t3 x3 # s3
qs
31
Observation:
32
Example:
The set of all strings {a, b, c}
is countable
Proof:
We will describe an enumeration procedure
33
Naive procedure:
Produce the strings in lexicographic order:
a
aa
aaa
aaaa
......
Doesn’t work:
strings starting with b
will never be produced
34
Better procedure: Proper Order
..........
35
a
b length 1
c
aa
ab
ac
Produce strings in ba
Proper Order: bb length 2
bc
ca
cb
cc
aaa
aab length 3
aac
......
36
Theorem: The set of all Turing Machines
is countable
37
Enumeration Procedure:
Repeat
1. Generate the next binary string
of 0’s and 1’s in proper order
39
Definition: A set is uncountable
if it is not countable
40
Theorem:
41
Proof:
Elements of S
42
Elements of the powerset have the form:
{s1, s3}
{s5 , s7 , s9 , s10 }
……
43
We encode each element of the power set
with a binary string of 0’s and 1’s
Encoding
Powerset
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
44
Let’s assume (for contradiction)
that the powerset is countable.
45
Powerset
Encoding
element
t1 1 0 0 0 0
t2 1 1 0 0 0
t3 1 1 0 1 0
t4 1 1 0 0 1
46
Take the powerset element
whose bits are the complements
in the diagonal
47
t1 1 0 0 0 0
t2 1 1 0 0 0
t3 1 1 0 1 0
t4 1 1 0 0 1
from definition of ti
Contradiction!!!
49
Since we have a contradiction:
S
The powerset 2 of S is uncountable
50
An Application: Languages
51
Example Alphabet : {a, b}
The set of all Strings:
*
S {a, b} { , a, b, aa, ab, ba, bb, aaa, aab,}
infinite and countable
A language is a subset of S:
L {aa, ab, aab}
52
Example Alphabet : {a, b}
The set of all Strings:
*
S {a, b} { , a, b, aa, ab, ba, bb, aaa, aab,}
infinite and countable
M1 M2 M3 ?
Turing machines: countable
55
Languages not accepted by Turing Machines
Lk
Languages
Accepted by
Turing Machines
56