150 likes | 164 Views
This introduction to the theory of computing covers the topics of non-deterministic finite automaton (NFA), equivalence of DFA and NFA, and closure of regular languages under regular operators. The lecture includes examples and exercises for better understanding.
E N D
CSCI 2670Introduction to Theory of Computing September 1, 2004
Agenda • Last class • Discussed non-determinism • Lots of excellent questions! • Today • Further exploration of NFA’s • Equivalence of DFA’s and NFA’s • Tomorrow • Closure of regular languages under regular operators
Announcement • Quiz tomorrow (9/2) • DFA’s (informal description, formal definition, creation of, combining) • NFA’s (inform description, formal definition)
Non-deterministic finite automaton A non-deterministic finite automaton is a 5-tuple (Q,,,q0,F), where • Q is a finite set of states • is a (finite) alphabet • : Q × ε P(Q) is the transition function • maps to sets of states • q0 is the start state, and • F Q is the set of accept states
q2 a, b q1 q3 ε ε a, c q4 ε b, c Example • Q = {q1, q2, q3, q4} • = {a, b, c} q0 = q1 F = {q2, q3, q4}
a, b ε ε a, c ε q2 b, c q1 q3 q4 Example (cont.)
Group project • For each NFA • Informally describe the behavior of the NFA • Try to construct a DFA accepting the same language
Group 1 0 0 1 1 ε ε 0 0 1 1 All strings containing an even number of 0’s or an even number of 1’s
Group 2 0,ε 0,ε 0,ε 0,ε 0 1 1 0 All prefixes of the string 0110 Proper prefixes may be followed by a 0
Group 3 1 1 0 0 ε 1 0 ε 0 0 1 1 All strings with a zero count divisible by 0 or 1
Group 4 0,1 1 0,1 0,1 All strings of length at least three whose third to last symbol is a 1
Group 5 1 0 1 0 All strings with alternating 0’s and 1’s that start with a 0
Group 6 0 0 1 ε 1 1 0 All strings containing either zero 1’s or three or more 1’s
Equivalence of DFAs and NFAs Theorem: Every non-deterministic finite automaton has an equivalent deterministic finite automaton • Both FAs accept the same language • Proof method • Construction • Similar to method used for calculating strings • Follow all paths in parallel where states represent parallel paths
Proof idea • Given NFA M1={Q,,,q0,F} construct DFA M2={Q’,,’,q0’,F’} with L(M1)=L(M2) • Intuition • Recall :Q×εP(Q) • Our DFA’s transition function will generate paths within P(Q) • ’: P(Q)×P(Q)