Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Linear Bounded Automata
LBAs
1
Linear Bounded Automata (LBAs)
are the same as Turing Machines
with one difference:
The input string tape space
is the only tape space allowed to use
2
Linear Bounded Automaton (LBA)
Input string
[ a b c d e ]
Left-end
marker
Working space
in tape
Right-end
marker
All computation is done between end markers
3
We define LBA’s as NonDeterministic
Open Problem:
NonDeterministic LBA’s
have same power with
Deterministic LBA’s ?
4
Example languages accepted by LBAs:
L {a b c }
n n n
L {a }
n!
Conclusion:
LBA’s have more power than NPDA’s
5
Later in class we will prove:
LBA’s have less power
than Turing Machines
6
A Universal Turing Machine
7
A limitation of Turing Machines:
Turing Machines are “hardwired”
they execute
only one program
Real Computers are re-programmable
8
Solution:
Universal Turing Machine
Attributes:
• Reprogrammable machine
• Simulates any other Turing Machine
9
Universal Turing Machine
simulates any other Turing Machine
M
Input of Universal Turing Machine:
Description of transitions of
Initial tape contents of
M
M
10
Three tapes
Tape 1
Description of
Universal
Turing
Machine
M
Tape 2
Tape Contents of
M
Tape 3
State of
M
11
Tape 1
Description of
We describe Turing machine
as a string of symbols:
We encode
M
M
M as a string of symbols
12
Alphabet Encoding
Symbols:
a
b
c
d
Encoding:
1
11
111
1111
13
State Encoding
States:
q1
q2
q3
q4
Encoding:
1
11
111
1111
Head Move Encoding
Move:
L
R
Encoding:
1
11
14
Transition Encoding
Transition:
(q1, a) (q2 , b, L)
Encoding:
1 0 1 0 11 0 11 0 1
separator
15
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
16
Tape 1 contents of Universal Turing Machine:
encoding of the simulated machine
as a binary string of 0’s and 1’s
M
17
A Turing Machine is described
with a binary string of 0’s and 1’s
Therefore:
The set of Turing machines forms a language:
each string of the language is
the binary encoding of a Turing Machine
18
Language of Turing Machines
L = { 010100101,
00100100101111,
111010011110010101,
(Turing Machine 1)
(Turing Machine 2)
……
…… }
19
Countable Sets
20
Infinite sets are either:
Countable
or
Uncountable
21
Countable set:
There is a one to one correspondence
between
elements of the set
and
positive integers
22
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
23
Example:
The set of rational numbers
is countable
Rational numbers:
1 3 7
, , ,
2 4 8
24
Naïve Proof
Rational numbers:
1 1 1
, , ,
1 2 3
Correspondence:
Positive integers:
1, 2, 3,
Doesn’t work:
we will never count
numbers with nominator 2:
2 2 2
, , ,
1 2 3
25
Better Approach
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
26
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
27
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
28
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
29
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
30
1
1
1
2
1
3
2
1
2
2
2
3
3
1
3
2
4
1
1
4
31
Rational Numbers:
1 1 2 1 2
, , , , ,
1 2 1 3 2
Correspondence:
Positive Integers:
1, 2, 3, 4, 5,
32
We proved:
the set of rational numbers is countable
by describing an enumeration procedure
33
Definition
Let
S be a set of strings
An enumeration procedure for S
Turing Machine that generates
all strings of S one by one
is a
and
Each string is generated in finite time
34
strings
s1, s2 , s3 , S
Enumeration
Machine for S
output
(on tape)
Finite time:
s1, s2 , s3 ,
t1, t2 , t3 ,
35
Enumeration Machine
Time 0
Configuration
q0
Time t1
x1 # s1
qs
36
Time t2
x2 # s2
qs
Time t3
x3 # s3
qs
37
Observation:
A set is countable if there is an
enumeration procedure for it
38
Example:
The set of all strings {a, b, c}
is countable
Proof:
We will describe the enumeration procedure
39
Naive procedure:
Produce the strings in lexicographic order:
a
aa
aaa
aaaa
......
Doesn’t work:
strings starting with b
will never be produced
40
Better procedure:
Proper Order
1. Produce all strings of length 1
2. Produce all strings of length 2
3. Produce all strings of length 3
4. Produce all strings of length 4
..........
41
a
b
c
Produce strings in
Proper Order:
aa
ab
ac
ba
bb
bc
ca
cb
cc
aaa
aab
aac
......
length 1
length 2
length 3
42
Theorem:
The set of all Turing Machines
is countable
Proof: Any Turing Machine can be encoded
with a binary string of 0’s and 1’s
Find an enumeration procedure
for the set of Turing Machine strings
43
Enumeration Procedure:
Repeat
1. Generate the next binary string
of 0’s and 1’s in proper order
2. Check if the string describes a
Turing Machine
if YES: print string on output tape
if NO: ignore string
44
Uncountable Sets
45
Definition:
A set is uncountable
if it is not countable
46
Theorem:
Let
S be an infinite countable set
The powerset
2
S
of
S is uncountable
47
Proof:
Since
S is countable, we can write
S {s1, s2 , s3 ,}
Elements of
S
48
Elements of the powerset have the form:
{s1, s3}
{s5 , s7 , s9 , s10 }
……
49
We encode each element of the power set
with a binary string of 0’s and 1’s
Powerset
element
Encoding
s1
s2
s3
s4
{s1}
1
0
0
0
{s2 , s 3 }
0
1
1
0
{s1, s 3 , s4 }
1
0
1
1
50
Let’s assume (for contradiction)
that the powerset is countable.
Then:
we can enumerate
the elements of the powerset
51
Powerset
element
Encoding
t1
1
0
0
0
0
t2
1
1
0
0
0
t3
1
1
0
1
0
t4
1
1
0
0
1
52
Take the powerset element
whose bits are the complements
in the diagonal
53
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)
54
The new element must be some
of the powerset
ti
However, that’s impossible:
from definition of
ti
the i-th bit of ti must be
the complement of itself
Contradiction!!!
55
Since we have a contradiction:
The powerset
S of
2
S is uncountable
56
An Application: Languages
Example Alphabet :
{a, b}
The set of all Strings:
S {a, b} { , a, b, aa, ab, ba, bb, aaa, aab,}
*
infinite and countable
57
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}
58
Example Alphabet :
{a, b}
The set of all Strings:
S {a, b} { , a, b, aa, ab, ba, bb, aaa, aab,}
*
infinite and countable
The powerset of
S contains all languages:
2 {{},{a},{a, b}{aa, ab, aab},}
S
L1 L2
L3
uncountable
L4
59
Languages: uncountable
L1
L2
L3
M1
M2
M3
Lk
?
Turing machines: countable
There are infinitely many more languages
than Turing Machines
60
Conclusion:
There are some languages not accepted
by Turing Machines
These languages cannot be described
by algorithms
61