150 likes | 173 Views
CSCI 2670 Introduction to Theory of Computing. August 30, 2005. Announcements. Homework due next Tues, Sept 6 1.7b, 1.8a, 1.10a, 1.15, 1.17a&b, 1.31, 1.32 Old Text 1.5b, 1.6a, 1.8a, 1.24, 1.25 (1.15 & 1.17 are not in old text) Office hours with TA Ryan Foster Monday 2:30 – 3:30
E N D
CSCI 2670Introduction to Theory of Computing August 30, 2005
Announcements • Homework due next Tues, Sept 6 • 1.7b, 1.8a, 1.10a, 1.15, 1.17a&b, 1.31, 1.32 • Old Text 1.5b, 1.6a, 1.8a, 1.24, 1.25 (1.15 & 1.17 are not in old text) • Office hours with TA Ryan Foster • Monday 2:30 – 3:30 • Friday 10:00 – 11:00 • Room 301 B (knock if locked) • Change in syllabus • First midterm exam Tues, September 27
Agenda • Last class • Combined regular languages • Introduced non-determinism • This week • Section 1.2 • Start Section 1.3
0,1 0 0 0 0 1 q1’ q1’ q2’ q2’ q3’ q3’ q1 q2 q3 1 1 0 0 0 0 1 1 1 1 1 M1 M2 0,1 1 q1 q2 q3 0 0 ε 1 Example Find M such that L(M) = L(M1) L(M2) Can jump to q1’ non-deterministically
Computing on an NFA • For each symbol of the string, keep track of all possible transitions in parallel • When input ends, there may be several possible ending states • If at least one of the possibilities is an accepting state, then the NFA accepts the string
q1, q3 Yes Example 0,1 • Does this NFA accept the string 001? 0 1 q1 q2 ε q3 0 1 1
0,1 1 1 ε 0 1 0,1 Example Any string containing two 1’s separated by at most one 0
Example b a a Zero or more concatenations of the strings aba and ab
a, b, c ε a, b, d ε ε a, c, d ε b, c, d Example Strings of any length containing at most three of the symbols in = {a, b, c, d}
a, c a, b a, b, c b ε c c a, b a a ε a, c b a ε c a b a b,c b, c c c c b b DFA NFA The power of non-determinism Strings of any length containing at most two of the symbols in = {a, b, c}
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)
Defining M2 • 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)