200 likes | 232 Views
Automata and Formal Languages (Final Review). Hongwei Xi University of Cincinnati. Regular Languages. Deterministic Finite Automata D = (Q, S , d , q 0 , F) d : Q x S -> Q Nondeterministic Finite Automata N = (Q, S , D , q 0 , F) D : Q x S -> P(Q)
E N D
Automata and Formal Languages(Final Review) Hongwei Xi University of Cincinnati Final Review
Regular Languages • Deterministic Finite AutomataD = (Q, S, d, q0, F)d: Q x S -> Q • Nondeterministic Finite AutomataN = (Q, S, D, q0, F)D: Q x S -> P(Q) • Regular ExpressionsR = a | e| f | R1 o R2 | R1 u R2 | R* Final Review
Regular Languages • Every NFA N can be converted to a DFA D, where L(N) = L(D) • Every regular expression R corresponds to an NFA N, where L(R) = L(N) • Every DFA D can be converted to a regular expression R, where L(D) = L(R) Final Review
Nonregular Languages • Pumping Lemma:For any regular language L, there exists a number p (pumping length) such that for each s in L with length at least p, we have s=xyz, where • xy^iz in L for i = 0,1,2,… • |y| > 0 • |xy| <= p Final Review
Context-free Languages • Context-free grammarsG = (V, S, R, S) • Ambiguous CFGs • Chomsky Normal Form • Pushdown Automata • L is a context-free language if and only if it is recognized by a PDA Final Review
Non-context-free Languages • Pumping Lemma:For any CFL A, there exists a numberp (pumping length) such that for each s in A, we have s = uvxyz, where • uv^ixy^iz in L for i = 0,1,2,… • |vy| > 0 • |vxy| <= p Final Review
Computability Theory • Turing machines:TM = (Q,S,G,d,q0,qaccept,qreject)d: Q x G -> Q x G x {L,R} • Multitape Turing machines • Nondeterministic Turing machinesNTM = (Q,S,G,D,q0,qaccept,qreject)D: Q x G -> P (Q x G x {L,R}) Final Review
Computability Theory • Enumerator • Decider • Church-Turing Thesis:Intuitive notion of algorithms =Turing machine algorithms Final Review
Decidability • Decidable problems concerning regular languages:ADFA, EDFA, EQDFA, ALLDFA, INFINITEDFA, etc. • Decidable problems concerning context-free languages:ACFG, ECFG, etc. Final Review
Undecidability • Halting Problem:ATM = {<M, w> | M accepts w} • Countability, Uncountablity • Diagnalization • The complement of ATM is not Turing-recognizable Final Review
More Undecidable Problems • EQTM • EQCFG • ALLCFG (but ECFG is decidable!) • Post correspondence problem Final Review
Time Complexity • Big-O and Small-o notation • Time(t(n)) ={ L | L is a language decided by a O(t(n)) time Turing Machine } Final Review
Time Complexity • Let t(n) be a function, where t(n) >= n for all natural numbers n. • Then every t(n) time multitape TM has an equivalent O(t^2(n)) time single-tape TM • Then every t(n) time Nondeterministic TM single-tape TM has an equivalent O(2^(t(n))) time single-tape TM Final Review
The Class P • P = the union of time(n^k) for all natural numbers k • Examples in P • PATH • RELPRIME • Every context-free language is in P • Dynamic programming Final Review
The Class NP • NP stands for nondeterministic polynomial time • Verifier • Every language in NP has a polynomial time verifier • Every language in NP is decided by a polynomial time nondeterministic TM Final Review
The Class NP • Examples in NP • HAMPATH • CLIQUE • SUBSET-SUM Final Review
P vs. NP • One of the greatest questions in theoretical computer science: • P = NP? • In general, people believe P is a proper subclass of NP • In general, it is difficult to find a lower time bound for a given problem Final Review
NP-completeness • Polynomial time reducibility: A <=P B • B is NP-complete if • B is in NP • A <=P B for all A in NP • Cook-Levin Theorem:SAT is NP-complete Final Review
More NP-Complete Problems • 3SAT • HAMPATH • CLIQUE • SUBSET-SUM Final Review
Final Exam • Date: December 5, 2000 • Place: 501 Swift Hall • Time: 1:30 – 3:30 PM • Choose 10 out of 15 problems Final Review