170 likes | 304 Views
Midterm 1 review. Jundong Liu School of EECS liu@cs.ohiou.edu. What is a DFA?. What’s an NFA. What’s the difference between DFAs and NFAs. DFAs: each state + each symbol: one transition NFAs: each state + each symbol: zero, one or more transitions NFAs: transitions may be labeled with e.
E N D
Midterm 1 review Jundong Liu School of EECS liu@cs.ohiou.edu
What’s the difference between DFAs and NFAs • DFAs: each state + each symbol: one transition • NFAs: each state + each symbol: zero, one or more transitions • NFAs: transitions may be labeled with e
How to design FAs • Reader as automaton • Remember the states that make difference • NFAs have “intelligence” to select paths.
How do FAs compute? • What’s the meaning of “accept”? • What’s the meaning of “recognize”? • What’re regular languages?
Operations • With DFAs, how to implement the union operation? What about intersection and complementation? • With NFAs, how to implement union? • With NFAs, how to implement concatenation? • With NFAs, how to implement star?
Equivalence of NFAs and DFAs • How to convert an NFA to a DFA? • States? • Transitions?
Closure property of regular languages • The class of regular languages is closed under • Union • Concatenation • Star • Intersection • Complementation (to prove this, use DFA or NFA?) • Difference • Reversal
Regular expression • What languages do they describe?
Correspondence of RE and FA • How to convert a DFA to a RE? • Convert a DFA into a GNFA • Convert a GNFA into a RE
Pumping lemma • You cannot control • The Pumping length p • What you need to do – choose w and i
Pumping Lemma • To prove {ww| w can be any string} is not regular, • for the counter example w • Can you choose 0^90^9? • Can you choose 0^p1^p0^2p1^p? • Can you assume x = 0^(p-2), y = 00?
Context-free Grammars • What’s a Context-free grammar? • What’s the language of the grammar? • Design • Recursive structures • Variables as entities • Decompose and union • Ambiguity • CNF (cfg-> cnf won’t show up in the exam)
Pushdown Automaton • What are the components of a PDA? • How to describe a PDA using state diagram? • What’s the meaning of • How does it compute? • How to map a CFG to a PDA? (not in this midterm)