Discrete
II: Theory of Computation
Fall 2014 |
email:
charles.e.hughes@knights.ucf.edu
Structure: TR 1330-1745 (1:30PM - 2:45PM), MSB-359; 28 class periods, each 75 minutes long.
Go To Week 1, 2, 3, 4,
5, 6, 7,
8, 9, 10,
11, 12, 13,
14, 15
Instructor: Charles Hughes; Harris Engineering Center 247C;
823-2762
Office Hours: TR 1515-1630
(3:15PM - 1:30PM)
GTA: Melanie Kaprocki; HEC-234 (Computer Vision Lab II); OH: M
1600-1730 (4:00PM - 5:30PM); F 1330-1500 (1:30PM - 3:00PM)
Text: Sipser, Introduction
to the Theory of Computation 2nd Ed., Cengage Learning, 2013+Notes
Secondary References: Hopcroft, Motwani and
Ullman, Introduction to Automata Theory, Languages and Computation
3rd Ed., Prentice
Hall, 2006.
Prerequisites: COT 3100; COP3503
Web Pages:
Base URL: http://www.cs.ucf.edu/courses/cot4210/Fall2014
Notes URL: http://www.cs.ucf.edu/courses/cot4210/Fall2014/Notes/COT4210Notes.pdf
Assignments: 8 or so.
Exams: 2 midterms and a final.
Material: I will draw heavily from Chapters 0-7 of Sipser.
Some material will also come from Hopcroft et al.. You are responsible
for
material discussed in notes and in in-class discussions. Not all of
this is addressed in either of these texts. I highly recommend
attending class, interacting with me and listening very carefully when
I say a topic is important to me; hint, hint about exam questions ;-)
Important Dates: Exam#1 -- September 26; Withdraw Deadline --
October 27; Exam#2 -- October 31; Final -- Tuesday, December 9,
1300-1550 (1:00PM-3:50PM)
Evaluation (Tentative):
Mid Terms -- 100 points each
Final Exam -- 150 points
Assignments -- 100 points
Bonus -- 50 points added to your best exam
Total Available: 500
Grading will be A >= 90%, B+ >= 87%, B >= 80%, C+ >=
77%, C >= 70%, D >= 50%, F < 50%
Weeks#1: (8/19, 8/21) -- Notes pp. 2-27 (Chapter 0 of
Sipser); Syllabus
- Introduction to computability: an historical perspective
- Basic notions of automata theory, formal languages,
computability and complexity
- Chomsky
Hierarchy (sets context for much of course)
Classes
of languages
Phrase
Structured Languages = (Recursively) Enumerable = Turing
Recognizable = Semi-Decidable; Membership in an re language is
undecidable
Decidable = Recursive: This class cannot be generated by any definable
class of grammars
Context Sensitive Languages (CSL) are
generated by Context Sensitive Grammars (CSG or Type1) and regognized
by Linear Bounded Automata (LBA); Membership in a CSL is decidable
Context
Free Languages (CFL) are generated by Context Free Grammars (CFG or
Type2) and recognized by Non-Deterministic Pushdown Automata (NPDA)
Deterministic
(unambiguous) Context Free Grammars are an undecidable subset of CFG,
but all deterministic CFLs are generated by LR(1) grammars (one token
lookahead)
Regular
Languages are generated by Regular (Right Linear) Grammars (Type3) and
recognized by Finite State Automata (FSA, DFA or NFA)
- Some
history of the genesis of the theory of computation (Hilbert, Godel,
Turing, Post, Kleene)
- Languages
(countable sets of strings); why there are problems that no program can
address
- Sets, sequences, relations and
functions (review)
- Computability: basic goals and definitions (solved,
solvable,
semi-decidable and complements)
- How computability concepts relate to each other
- Complexity theory: basic goals; big question is P=NP?
Assignment #1
See page 47 of Notes
Sample problems (of
same genre) and solutions to make your life a bit easier
Due: 8/28 by 1:30PM (Key)
Week#2: (8/26, 8/28)
-- Notes pp.
28-70 (Chapters 0 and 1 of Sipser); Dr. Workman's Notes pp. 1-8
- Discussions
about non-determinism versus determinism; universal versus existential
quantification; discrete versus continuous solution spaces
- Formal
definition of a Determinitic
Finite (State) Automaton (DFA)
A = (Finite State Set, Finite Input Alphabet, Transition Function,
Start State, Final States),
where transtion function maps (Current State, Current Input
Symbol) to Next State
Can represent Transition Function by State Transition Table or State
Transtion Diagram (preferred)
- Determinitic Finite (State) Automaton (DFA): what and why?
Sequential circuits; pattern matchers; lexical analyzers; simple
game/simulation behaviors
Formal definition and examples
State transition diagrams versus state transition tables
Simple closure (union, intersection, difference, exclusive or, negation)
- Non-determinism (NFA)
Closure under concatenation, Kleene *
Formal definition and examples
Assignment #2
See page 59 of Notes
Sample
problems (of same genre) and solutions to make
your life a bit easier
Due: 9/4 by 1:30PM (Key)
Week#3: (9/2, 9/4) -- Notes pp. 71-79
(Chapter
1 of Sipser); Regular
Equations; Samples; Dr. Workman's Notes pp. 8-57
- The epsilon (lambda) closure of a state of set of states
- Equivalence of DFAs and NFAs (subset of all states
construction)
- Reachable states from some given state
- Reaching states to some given state
- Minimizing the states of a DFA (indistinguishable vs
distinguishable states)
- Minimization example using notion of distinguishable
states
- Regular Expressions (closure of
primitive sets under union, concatenation and star)
- Every language defined by a Regular Expression is
accepted by an NFA
- Generalized NFA (GNFA) -- Definition
- Every language accepted by a DFA is defined by a Regular
Expression (ripping states out)
- Alternate approach through Rij(k) construction
- Languages defined by Regular Equations (not in text)
and NFAs without lambda transitions
- Closure of Regular Languages under
Reversal
Assignment #3
See page 71 of Notes
Sample problems (of
same genre) and solutions to
make your life a bit easier
Due: 9/11 by 1:30PM (Key)
Week#4: (9/9, 9/11)
-- Notes pp.
80-97 (Chapter
1 and 2 of Sipser); Samples;
Dr.
Workman's Notes pp. 17-57
- Reachable states from some given state
- Reaching states to some given state
- Closure of Regular Languages under Prefix, Postfix,
Substring, Min and Max
- Classic non-regular languages {0n1n | n is greater than or
equal to 0}
- Pumping Lemma for Regular
Languages
- Proofs that certain languages
are not regular using Pumping Lemma
- Basic notion of grammars and
languages generated by grammars
- Chomsky hierarchy (Type 3
through Type 0 grammars and languages)
- Regular (right linear, Type 3)
grammars
Assignment #4
See page 90 of Notes
Sample problems (of
same genre) and solutions to
make your life a bit easier
Due: 9/18 by 1:30PM (Key)
Week#5: (9/16, 9/18)
-- Notes pp. 98-100 (Chapters
1 and 2 of Sipser); Samples; Dr. Workman's Notes pp. 41-57
- Every language generated by a
regular grammar is regular
- Every regular language is
generated by a type 3 grammar
- The right and left linear
grammars generate equivalent classes of languages
- Can extend regular grammars to include strings rather than single characters
- Right-invariant equivalence relationships and
Myhill-Nerode Theorem
- Proofs that certain languages
are not regular using Myhill-Nerode Theorem
- Right-invariant equivalence relationships and
Myhill-Nerode Theorem
- Existence of
minimal state machine for any Regular Language
- More proofs that certain
languages
are not
regular using Pumping Lemma and Myhill-Nerode
- Topics and Promises for
MidTerm # 1
- Sample Exam
-- Complete this for
discussion on 9/23 (key)
Week#6: (9/22 (Help Session), 9/23 (review),
9/25 (Midterm1)
- Help Session in ENG1-224 on 9/22 from 4:00PM
to 5:30PM
- Review and go over sample questions
- MidTerm
1 (Chapters 0, 1; Notes pp. 1-97; Assignments
1-4; Regular Equations; Pumping Lemma; Dr. Workman's Notes, pp. 1-57 that were covered in class)
Week#7: (9/30, 10/2) -- Notes pp. 101-118; Chapter
2 of Sipser; Dr.
Workman's Notes pp. 34-63
- Grammars and closure properties
(union, concatenation, Kleene *)
- Transducers (automata with
output); Mealy and Moore Models
- Closure under homomorphism and
substitution
- Constructions using NFAs to show
closure under homomorphism
and substitution
- Closure under quotient, prefix,
substring and suffix, using substitution and intersection
- Constructions using regular
expressions and NFAs
- Difficulty with direct proof and
right linear grammars
- Review Chomsky hierarchy
- Notion of instantaneous
description for automata and grammars
- Notions of derivation and the
language generated by a grammar
- Derivations (leftmost/rightmost
- Parsing (parse trees; top
down/bottom up)
- Notion of ambiguity (inherent
versus due to a specific grammar)
- Context free grammars (CFGs) and
languages (CFLs)
- Sample grammars: {a^n b^n}; {w
w(reversed)}; {w | #a(w) = #b(w)}
- Closure properties for CFLs
(union, concatenation, Kleene *)
- Non-CFLs {a^n b^n c^n }, {ww | w is a string over Sigma* }
- Non-closure (intersection and
complement)
- Intersection of {a^n b^n c^m}
and {a^m b^n c^n}
- Complement of {ww | w is a
string over Sigma* } is a CFL
Assignment #5
See page 103 of Notes
Sample problems (of
same genre) and solutions to
make your life a bit easier
Due: 10/9 by 1:30PM (Key) Comments
Week#8: (10/7, 10/9) --
Notes pp.
110-119; Chapter 2 of Sipser;
Dr.
Workman's Notes pp. 57-68
- Pumping Lemma for CFLs (no proof)
- Non-CFLs {a^n b^n c^n }, {ww | w is a string over Sigma* }
- Parse trees, leftmost and
rightmost derivations, and ambiguity
- Chomsky Normal Form (CNF) and
the algorithm to convert a CFG to a CNF
- Eliminate lambda rules and
accommodate for nullable non-terminals
- Eliminate unit rules (chains
of non-terminals)
- Eliminate useless
non-terminals (no terminal string can be generated from them)
- Eliminate unreachable
non-terminals (cannot get to them from S)
- On rhs's of length >1,
replace each terminal with symbol that derives it directly
- Recursively change rhs of length k,
k>2, to two rules, one with rhs of length 2 and the other of length
k-1
- Sample of conversion to CNF
- More on parse trees and relation
of height to longest length of string produced
- Every
CFL is recognized by a PDA
- Top-down vs bottom-up acceptance
- Midterm Exam#1 Key
Week#9: (10/14, 10/16) -- Notes pp. 118-138;
Chapter
2 of Sipser; Dr.
Workman's Notes pp. 68-77, 86, 87
- Pushdown automata (PDA)
non-determinstic vs deterministic
- Equivalence of a variety of PDA
formalizations
- Bottom of stack marker versus
none at start
- Ability to push none or one,
versus many characters on stack
- Recognition by accepting
state, by empty stack and by both
- Cocke-Kasami-Younger polynomial time CFG
parser (details on pp. 86,87 of Dr.
Workman's Notes)
- Closure properties for CFLs (intersection with regular, substitution)
- Using substitution and
intersection with regular to get many more, e.g., prefix, suffix and
quotient with regular
- Shorthand notation for PDA
- Limitation of pop or push as
only stack moves
- Complete PDA equivalence to CFG
by showing every language accepted by PDA is a CFL
- Constructive proof of Pumping Lemma for CFLs
Assignment #6 (also a prep for Exam#2)
Assign#6:SampleMidterm2
Due: 10/23 by 1:30PM (Key) -- Just kidding; It does not have to be turned in.
Week#10: (10/21, 10/23) -- Notes pp.
139-164; Chapter 2, 3 of Sipser);
Dr.
Workman's Notes pp. 78-85
- Example to show PDA is a CFL by two different methods
- Non closure of CFLs under
complement and intersection, min and max
- Consider the two operations on languages max and min, where
max(L) = { x | x ∈ L and, for no non-null y does xy ∈ L } and
min(L) = { x | x ∈ L and, for no proper prefix of x, y, does y ∈ L }
Describe the languages produced by max and min. for each of the following:
L1 = { ai bj ck | k ≤ i or k ≤ j }
max(L1) = { ai bj ck | k =max(i, j) }
min(L1) = { λ } (string of length 0)
L2 = { ai bj ck | k > i or k > j }
max(L2) = { } (empty)
min(L2) = { ai bj ck | k =min(i, j)+1 }
- Greibach Normal Form
- Solvable Decision Problems for CFL, L
- Is w in L?
- Is L empty (non-empty)?
- Is L finite (infinite)?
- Unsolvable Decision Problems for CFL, L -- Later
- Is L = Sigma*
- Is L = L', where L' is some other CFL?
- Is L intersect L' empty (non-empty)
- Sample Exam2 is Assignment#6
- Topics and
Promises for MidTerm # 2
- Solver/Unsolved, Solvable/Unsolvable, Enumerable (semi-decidable)/Non-Enumerable
- Turing Machines
- I need to leave at 2:15 on Thursday and Melanie will start review at that time
- Note: 10/27 is the
Withdraw Deadline
Week#11: Notes pp.
141-144; 10/27
(Help Session), (10/28 (Review), 10/30 (Midterm2))
- Help Session in ENG1-427 on Monday, 10/27, from 4:00 to 5:45
- Variants of Turing Machines
- Turing Machines as enumerators/recognizers
- Factor Replacement Systems (FRS) as simple models of
computation
- Petri Nets as a model of synchronization; order their
transitions and they are Turing-enabled
- The necessity of order with FRSs
- Clean up details of anything missed from previous week
- Review and go over topics and sample questions
- MidTerm 2 on Thursday, 10/30
Week#12: (11/4,
11/6) -- Notes pp.
185-206; Chapters 4, 5 of Sipser
- The Halting Problem -- classic undecidable but recognizable
(semi-decidable, enumerable) problem
- Diagonalization proof for Halting Problem
- STP predicate (STP(f,x,t) iff f(x) converges in t steps or
fewer)
- VALUE(f,x,t) = f(x) if STP(f,x,t), else 0
- Reducibility as a technique to show undecidability
- The set of Algorithms (TOTAL)
- Total is not even re shown by diagonalization
- Reducibility as a technique to show non-re-ness
- Using reducibility to show properties of Zero = { f | for all
x f(x) =0 }
Assignment #7
See page 206 of Notes
Sample problems (of
same genre) and solutions to
make your life a bit easier
Due: 11/18 by 1:30PM (Key)
Week#13: (Veterans
Day,
11/13) -- Notes pp. 207-238 Chapters 5 of Sipser
- Many-one reducibility and equivalence
- Notion of (many-one) re-complete sets (HALT is one such set)
- The sets K and K0 are equivalent and re-complete
- STP predicate (STP(f,x,t) iff f(x) converges in t steps or
fewer)
- VALUE(f,x,t) = f(x) if STP(f,x,t), else 0
- Finally, proof that re and semi-decidable are same
- Proof that re and co-re iff recursive (decidable, solvable)
- Rice's Theorem (weak and strong forms)
- Applying Rice's
- Quantification as a tool to identify upper bound complexity
Practice Assignment
#8
See page 234 of Notes
Due: 11/25 by
1:30PM (Key)
Week#14: (11/18, 11/20) -- Notes pp. 239-281;
Chapters, 5 and
7 of Sipser (pp. 246-256 were informational only)
- Undecidable problems in formal language theory
- Post Correspondence Problem (PCP)
- Applications of PCP (Undecidability of Ambiguity of CFLs and
Non-emptiness of Intersection of CFLs)
- Application of PCP to Undecidability of Non-emptiness of CSLs
- Traces (computational histories)
- Is L = Sigma*? Is L = L^2? Non-closure of L1/2 (both CFLs)
- Midterm Exam#2 Key
- Introduction to Complexity Theory
- Verifiers versus solvers
- NP as verifiable in
deterministic polynomial time
- P as solvable in deterministic
polynomial time
- NP as solvable in
non-deterministic polynomial time
- Million dollar question: P = NP ?
- Some NP problems that do not
appear to be in P: SubsetSum, Partition
- Concepts of NP-Complete and
NP-Hard
- Canonical NP-Complete problem:
SAT (Satisfiability)
- Construction that maps every
problem solvable in non-deterministic polynomial time on TM to SAT
- 3SAT as a second NP-Complete problem
- 3SAT to SubsetSum reduction
- SubsetSum equivalence (within a
polynomial factor) to Partition
- 0-1 Integer Linear Programming
Week#15: (11/25,
Thanksgiving) -- Notes pp. 282-291;
Chapter 7 of Sipser
- Scheduling on multiprocessor
systems
- NP-Hard
- QSAT as an example of NP-Hard,
possibly not NP, problem
- co-NP
- Final Exam Topics (Notes
pp. 286-291)
- Some Samples (Notes
pp. 235-238)
- Sample Final (Key)
Review Sessions: TBD
Final Exam; Tuesday
December 9; 1300 - 1550 (1:00PM - 3:50PM)
© November 19, 2014