Professional Documents
Culture Documents
Computation Model 01 Intro
Computation Model 01 Intro
Lecture 01
Introduction
where
Theory of Computation, NTUEE Lecture 01-5
Types of Machines
• Logic circuit
memoryless; values combined using gates
c s
Circuit size = 5
Circuit depth = 3
x y z
a
2
a
• models programs with a finite number of bounded registers
•reducible to 0 registers
b, A/ #, $/
models finite program + one unbounded stack of bounded registe
top
$
b
b, A/ #, $/
models finite program + one unbounded stack of bounded registe
aaabbb#
A
A A A
A A A A A
$ $ $ $ $ $ $
acceptin
Theory of Computation, NTUEE g Lecture 01-9
Types of Machines (cont.)
• Pushdown Automaton (PDA)
finite control and a single unbounded stack
a, A/AA
b, A/
L { a n b n # : n 1} a, $/A$
b, A/ #, $/
models finite program + one unbounded stack of bounded registe
aaabbbb
#
A
A A A ? rejectin
A A A A A g
$ $ $ $ $ $ $
b, A/ #, $/
models finite program + one unbounded stack of bounded registe
aaabb#
A
A A A rejectin
A A A A A ? g
$ $ $ $ $ $
R0 R0 R1
Example:
L0 : JMPZ R1 L1
INC R0
4
DEC R1 3
2
JMP L0
1
L1 : CONTINUE 0
fixed amount of information (b) per cell
Finite-
state
control
w M f(w)
yes
w M
no
M accepts strings which cause it to enter a final state
Generator - ``generates” a set of strings
M f(w)
M generates all values generated during computation
Theory of Computation, NTUEE Lecture 01-14
How Machines are Used
The equivalence between acceptor and generator
for wi=w0,w1,w2,w3,…,do
wi print wi
Acceptor yes
no
#include “acceptor.h”
generator() {
for wi=w0,w1,w2,w3,…,do if accept(wi)
print(wi);
}
w>
wi
Generator w=
return “yes”
one wi at at time w
w<i
wi return “no”
#include “generator.h”
acceptor(w) {
while (wi=generator) null, do
if w=wi, return “yes”; else if w<wi,
return “no”;
} Lecture 01-16
Theory of Computation, NTUEE
Types of Language
• A language is a set of strings over an alphabet
L1 { a n b n c n | n 0 }
L2 { a i b j c k | i j k & i, j , k 0 }
• Grammars are rules for generating a set of strings
G•2 :Machines
S aSc | T | can accept languages (sets)
T bTc |
4
2
2 3 2
4
1 3
3 3 Why?
cities visited in order
1,4,2,3,1 tour distance = 10
= strict inclusion
= 2-way “Chomsky Hierarchy”
conversion
algorithm Lecture 01-20
Theory of Computation, NTUEE
Classifying Problems by
Resources
• What is the smallest size circuit (fewest gates)
to add two binary numbers?
• What is the smallest depth circuit for binary
addition? (low depth fast)
• can a FSA be used to recognize all binary
strings with = numbers of 1s & 0s? Must a
stronger model be used?
• How quickly can we determine if strings of
length n are in TSL?
• How much space is needed to decide if
boolean formulae of length n are satisfiable?
I A 0 I A A * B
0 0 I
I B B
0 0 I 0 0 I
embed
invert
A,B pick A*B
matrix
Reg
(0 3 ) * 00 { 0 n | n mod 3 2 }
{ a n b n | n 0} C
F
CS l
a b
L {an bn cn | n 0 } i d l e
e c ab
D er
m
algorithm to answer " x L ?" eEnu
b ly le
ta b
pu m er a
LH Co
Halting Problem
m
Enu
b l y
u t a
LH omp
n -C
No Lecture 01-26
Theory of Computation, NTUEE
Summary: Theory of
Computation
• Models of the computing process
circuits
finite state automata
pushdown automata
Turing machines
capabilities and limitations
• Notion of ``effectively computable procedure’’
universality of the notion
Church’s Thesis
what is algorithmically computable
• Limitations of the algorithmic process
unsolvability (undecidability) & reducibility
• Inherent complexity of computational problems
upper and lower bounds: classification by resource use
NP-completeness & reducibility