Professional Documents
Culture Documents
01 Intro
01 Intro
Peter J. Downey
Department of Computer Science
Theory of Computation
Lecture 01
Introduction
Lecture 01 1
CSC 573 Theory of Computation 1/5/2009
Major Themes
• Study models for
problems
machines
languages
• Classify
machines by their use of memory
grammars and languages by type
languages by class hierarchies
problems by their use of resources (time, space, …)
• Develop relationships between models
reduce solution of one problem to solution of another
simulate one machine by another
characterize grammar type by machine recognizer
Describing Problems
• Problems described by functions
Functions assign ouputs to inputs
Described by tables, formulae, circuits, math logic, algorithms
Example: TRAVELLING SALESPERSON problem
Input: n(n-1)/2 distances between n cities
Output: order to visit cities that gives shortest tour length
• Problems described by languages
``Yes/no’’ problems = decision problems
A language represents a problem or question
Input strings in the language: answer is ``yes’’; Else ``no”
Example: TM MEMBERSHIP problem
Input: a string w and a turing machine M
Output: ``yes” if w ∈ L ( M ) ;``no” otherwise
Equivalent to asking if string (e, w ) ∈ L H
Where LH = {( e, w) | Turing Machine M e halts on input w}
Types of Machines
• Logic circuit
memoryless; values combined using gates
c s
Circuit size = 5
<
⊕
>
Circuit depth = 3
>
⊕
x y z
Lecture 01 2
CSC 573 Theory of Computation 1/5/2009
a
2
a
• models programs with a finite number of bounded registers
•reducible to 0 registers
b, A/ε #, #/ε
top
$
b
R0 ← R0 + R1
Example: •
L0 : JMPZ R1 L1 •
•
INC R0
4
DEC R1 3
2
JM P L0
1
L1 : CONTINUE 0
Lecture 01 3
CSC 573 Theory of Computation 1/5/2009
b
•
•
•
Finite-
state
control
w M f(w)
yes
w M
no
M f(w)
Types of Language
• A language is a set of strings over an alphabet
L1 = { an bn cn | n ≥ 0}
L2 = { ai bj ck | i + j = k & i, j , k ≥ 0 }
• Grammars are rules for generating a language (set)
G1 : S → aBSc | abc | ε S ⇒ aBSc ⇒ aBaBScc⇒ aBaBabccc⇒ aBaaBbccc⇒ aaBaBbccc
Ba → aB ⇒ aaBabbccc⇒ aaaBbbccc⇒ aaabbbccc
Bb → bb
G2 : S → aSc | T | ε
T → bTc | ε
• Machines can accept or recognize languages (sets)
Lecture 01 4
CSC 573 Theory of Computation 1/5/2009
Lecture 01 5
CSC 573 Theory of Computation 1/5/2009
Obtaining Results
• Use definitions, theorems and lemmas, with proofs
• Proofs use construction, induction, reduction, contradiction
Construction: design an algorithm for a problem, or to
Lecture 01 6
CSC 573 Theory of Computation 1/5/2009
Classes of Languages
Reg
(0 3 ) * 00 = { 0 n | n mod 3 = 2 }
{ a n b n | n ≥ 0} CF
CS
e
bl
L {an bn cn | n ≥ 0 } da le
eci ab
D er
∃ algorithm to answer " x ∈ L ?" um
En
b ly
t a
pu n-
om no ble
LH Halting ProblemC ing ra
c lud ume
si n En
LH l l set tably
A u
mp
C SC 573 Theory of Computation Co Lecture 01-19
Lecture 01 7