Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 2670 Introduction to Theory of Computing

Similar presentations


Presentation on theme: "CSCI 2670 Introduction to Theory of Computing"— Presentation transcript:

1 CSCI 2670 Introduction to Theory of Computing
September 1, 2004

2 Agenda Last class Today Tomorrow 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

3 Announcement Quiz tomorrow (9/2)
DFA’s (informal description, formal definition, creation of, combining) NFA’s (inform description, formal definition)

4 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

5 Example q1 q4 q3 q2 Q = {q1, q2, q3, q4} = {a, b, c} q0 = q1
a, c b, c ε q1 q4 q3 q2 Q = {q1, q2, q3, q4} = {a, b, c} q0 = q1 F = {q2, q3, q4}

6 Example (cont.) a b c ε q1  {q2,q2,q3} q2 {q2} q3 {q3} q4 {q4} q1 q4
a, c b, c ε q1 q4 q3 q2

7 Group project For each NFA Informally describe the behavior of the NFA
Try to construct a DFA accepting the same language

8 Group 1 1 1 ε ε 1 1 All strings containing an even number of 0’s or an even number of 1’s

9 Group 2 All prefixes of the string 0110
0,ε 0,ε 0,ε 0,ε 1 1 All prefixes of the string 0110 Proper prefixes may be followed by a 0

10 Group 3 All strings with a zero count divisible by 0 or 1 1 1 ε 1 ε 1
ε 1 ε 1 1 All strings with a zero count divisible by 0 or 1

11 Group 4 0,1 1 0,1 0,1 All strings of length at least three whose third to last symbol is a 1

12 Group 5 All strings with alternating 0’s and 1’s that start with a 0 1
1 All strings with alternating 0’s and 1’s that start with a 0

13 Group 6 All strings containing either zero 1’s or three or more 1’s 1
1 ε 1 1 All strings containing either zero 1’s or three or more 1’s

14 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

15 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)


Download ppt "CSCI 2670 Introduction to Theory of Computing"

Similar presentations


Ads by Google