Presentation is loading. Please wait.

Presentation is loading. Please wait.

Deterministic Finite Automata (DFA) - 1 q0q0q0q0 q1q1q1q1 010 1 strings that do not end with "1". Build an automaton to identify strings that end with.

Similar presentations


Presentation on theme: "Deterministic Finite Automata (DFA) - 1 q0q0q0q0 q1q1q1q1 010 1 strings that do not end with "1". Build an automaton to identify strings that end with."— Presentation transcript:

1 Deterministic Finite Automata (DFA) - 1 q0q0q0q0 q1q1q1q1 010 1 strings that do not end with "1". Build an automaton to identify strings that end with "0". q1q1q1q1 q2q2q2q2 010 1 q0q0q0q0 0 1 Σ = {0,1}

2 Deterministic Finite Automata (DFA) - 2 What patterns does this automaton identify (over {a,b,c})? strings that begin and end with the same letter. a A b B c C S a b c A’ b,c B’ a,c C’ a,b b,caa,c b a,b c

3 Deterministic Finite Automata (DFA) - 3 Build an automaton to identify strings over {0,1} that are binary numbers divided by 3. explanation: q i denotes remainder of i. for example, if n=3k+1 (remainder 1) then adding "1" yields 2n+1 = 2(3k+1)+1 = 6k+3 = 3(2k+1)  remainder 0 q0q0q0q0 q1q1q1q1 q2q2q2q201 1 0 0 1

4 Deterministic Finite Automata (DFA) - 4 Given 2 automata A1 and A2, that identify patterns p1 and p2 respectively, describe an automaton that identifies strings with either p1 or p2. solution: states: tuples (q 1,q 2 ) for every q1 from A1 and q2 from A2 transitions: if q 1 –x-> q 1 ' and q 2 –x-> q 2 ' then (q 1,q 2 ) –x-> (q 1 ',q 2 ') start state: (q 1start,q 2start ) when q 1start and q 2start are A1 and A2 starting states accepting states: (q 1,q 2 ) is accepting if q 1 is accepting in A1 or q 2 is accepting in A2.

5 Deterministic Finite Automata (DFA) - 5 Prove no finite automata can identify strings of the form a n b n for unknown n. proof: assume there is such an automaton, with N states. then for a N+1 b N+1 it must repeat the same state s i at least twice (pigeon hole principle). but then it must also accept strings with <N+1 a's, contradiction. a N+1 b N+1 = a a a a a … a a a b b b b b … b b b a a … a a b b b b b … b b b * comment: for any finite known n, there IS such an automaton… delete N+1 <N+1 N+1 sisi sisi


Download ppt "Deterministic Finite Automata (DFA) - 1 q0q0q0q0 q1q1q1q1 010 1 strings that do not end with "1". Build an automaton to identify strings that end with."

Similar presentations


Ads by Google