Lecture Pushdown Automata
tape
tape head
stack head
finite
control
stack
a
l
p
h
a
b
e
t
The tape is divided into finitely many cells.
Each cell contains a symbol in an alphabet
.
a
The head scans at a cell on the tape and
can read a symbol on the cell.
Lecture 16
Deterministic Turing Machine
(DTM)
tape
head
Finite Control
a
l
p
h
a
B
e
The tape has the left end but infinite to the
right. It is divided into cells. Each cell
contains a symbol in an alphabet . There
exists a special symbol B which represen
Lecture 22. Time of DTM
Time of DTM
TimeM (x) = # of moves that DTM M takes
on input x.
TimeM(x) < infinity iff x L(M).
Time Bound
M is said to have a time bound t(n) if for
every x with |x| < n,
TimeM(x) < max cfw_n+1, t(n)
Theorem
For any multitape D
Lecture 23 Space Complexity
of DTM
Space
SpaceM(x) = # of cell that M visits on the
work (storage) tapes during the
computation on input x.
If M is a multitape DTM, then the work
tapes do not include the input tape and the
write-only output tape.
Space
Lecture 25 NP Class
P = ? NP = ? PSPACE
They are central problems in
computational complexity.
If P = NP, then
P
NP-complete
Ladner Theorem
If NP P, then there exists a set A lying
-between P and NP-complete class, i.e., A
is in NP, but not in P and not
r‘ .~ wast-EH" '
DIM-M“ . 9 _-‘_£;’_
EQE¢T9£4T+T31:T+T$:+1;-+T §§ {41' F F-V'F$_ —
a+F+r$a¢a*F‘) “*“*“ ' I ‘9—
d (6) . . “A; _
* - -——-, r-r_v_ .T———
\'- i ,_ , ,4?
an?“ -— l ‘_
kg) ‘ *-‘ * J —-=
-— g a
I — ’ —<~—— 4 k _7
T ‘ é_‘ P ‘r g —:—L' _
9 ‘
Lecture 13 Parsing and
Ambiguity
Given a string x and a CFG G = (V, , R, S),
determine whether x L(G) and if x L(G),
find a derivation S * x.
This problem is called Parsing.
To solve the parsing problem, we first study
the parse tree.
The parse tree is th
Lecture 12 Examples of CFL
n
n
Example 1. L=cfw_0 1 | n > 0 is a CFL.
To show that L is a CFL, we need to construct a
CFG G generating L.
Let G = (V, , R, S) where
V = cfw_S
= cfw_0, 1
R =cfw_S |0S1
Example 2. Construct CFG to generate
R
L=cfw_xx | x is
Lecture 11 Context-Free
Grammar
Definition
A context-free grammar (CFG) G is a
quadruple (V, , R, S) where
V: a set of non-terminal symbols
: a set of terminals (V = )
R: a set of rules (R: V (V U )*)
S: a start symbol.
Example
V = cfw_q, f,
= cfw_
Lecture 1 String and
Language
String
string is a finite sequence of symbols.
For example,
string
( s, t, r, i, n, g)
CS4384
( C, S, 4, 3, 8)
101001
(1, 0)
Symbols are given through alphabet.
An alphabet is a finite set of symbols.
Examples of Alphabet
Lecture 3 Graph Representation
for Regular Expressions
digraph (directed graph)
A digraph is a pair of sets (V, E) such that
each element of E is an ordered pair of
elements in V.
A path is an alternative sequence of
vertices and edges such that all edg
Lecture 5 Examples of DFA
Construct DFA to accept (0+1)*
0
1
Construct DFA to accept 00(0+1)*
0
0
1
0
0
1
1
1
(0+1)*00(0+1)*
Idea: Suppose the string x1x2 xn is on
the tape. Then we check x1x2, x2x3, .,
xn-1xn in turn.
Step 1. Build a checker
0
0
Step
Lecture 6 Nondeterministic
Finite Automata (NFA)
NFA
tape
head
Finite Control
a
l
p
h
a
b
e
t
The tape is divided into finitely many cells.
Each cell contains a symbol in an alphabet
.
a
The head scans at a cell on the tape and
can read a symbol on the c
Lecture 7 From NFA to DFA
DFA
For every string x, there is a unique path
from initial state and associated with x.
x
x is accepted if and only if this path ends
at a final state.
NFA
For any string x, there may exist none or
more than one path from init
Lecture 8 From NFA to
Regular Language
Induction on k= # of states other
than initial and final states
K=0
a
a*
b
c*a(d+bc*a)*
a
c
d
k>1
ac*e
c
a
e
ac*d
bc*e
d
b
bc*d
Example 1
0
1
0+10
0
1
0
Why?
10
0
1
1
(0+10)*0(1+10(0+10)*0)*
0+10
1
0
(0+10)*0
How to
Lecture 9 Minimum DFA
For each regular language, there is a
unique minimum DFA.
How do we find it?
Applications.
For each language L, how many DFA
accepts L?
Answer: infinity
If we dont allow any useless state (i.e., a
state not be visited), how man
Lecture 10 Pumping Lemma
A property of regular sets
Weak version
Strong version
Applications
Pumping Lemma (weak)
If a language L is accepted by a DFA M
with m states, then any string x in L with |
x| > m can be written as x = uvw such that
(1) v , and
Course
Professor
Term
Meetings
CS 4384 001 Automata Theory
Dr. William J. Pervin
Fall 2015
TR 8:30am-9:45am in ECSN2.112
Professors Contact Information
Office Phone 972-883-2719 (e-mail preferred)
Office Location ECSN4.626
Email Address pervin@utdallas.ed