120 likes | 140 Views
This text provides announcements, information on DFA design, and details about office hours for the Introduction to Theory of Computing course.
E N D
CSCI 2670Introduction to Theory of Computing August 31, 2005
Announcements • Quiz tomorrow • Definition of DFA’s and designing DFA’s • Office hours with TA Ryan Foster • Monday 2:30 – 3:30 (Rm. 323) • Friday 10:00 – 11:00 (Rm. 524) • Change in homework policy • I give your homework to the TA at 11:00 the day after it’s due • I will accept it until that time
Agenda • Last class • Discussed non-determinism • Equivalence of DFA’s and NFA’s • Today • Further exploration of equivalence of DFA’s and NFA’s • Tomorrow • Closure of regular languages under regular operators • Another method for describing regular languages
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
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)
(r,a) is the set of state reached from r when a is processed R is a set of states from the NFA r is one of the states in R (i.e., a state in the NFA a is a symbol in the alphabet Defining M2 (ignoring jumps) • Determine Q’, q0’, and F’ • Q’ = P(Q) • q0’ = {q0} • F’ = {R Q’ | R F } • i.e., R contains at least one of M1’s accept states • Defining ’ (for now ignore ε jumps)
Example 1 • Q’={,{q1}, {q2}, {q3}, {q1,q2}, {q1,q3}, {q2,q3}, {q1,q2,q3}} q2 0 q1 1 0 q3
Example 1 • q0’={q1} q2 0 q1 1 0 q3
Example 1 • F’={{q3}, {q1,q3}, {q2,q3}, {q1,q2,q3}} q2 0 q1 1 0 q3
{q2,q3} 0 0 1 1 q2 0 0 q1 {q1} 1 0 q3 1 1 0,1 Example
What about ε jumps? • For each R P(Q), define function E(R) E(R) = {q | q can be reach by 0 or more ε jumps from some r R} • Redefine ’(R,a) to include E(R) ’(R,a) = {q | q E((r,a)) for some r R} • Are we done? No! What if there are jumps from q0? q0’ = E({q0})