1
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at Permissions beyond the scope of this license may be available at

4
Tracing in NFA Each row is a set of states that we are in at the “same time” – {q1} – {q1,q2,q3} – {q1,q3} – {q1,q2,q3,q4} – {q1,q3,q4} Recall that when we did the union closure proof with DFAs, we were always in a pair of states at the “same time”—same concept What are all the possible unique sets of states? (a) QxQ (b) |Q| 2 (c) P (Q) (d) |Q|! (Fig in your book) Run this NFA on input (e) I don’t understand this at all

6
Thm. 1.39: Every NFA has an equivalent DFA. We also know every DFA is an NFA. Corollary of these two facts: The class of languages recognized by DFAs and the class of languages recognized by NFAs are the same class – The Class of Regular Languages Nondeterminism does not make automata more powerful!

7
REGULAR EXPRESSIONS PATTERN MATCHING Extremely useful

8
From the Reading Quiz Let L be the language of this regular expression: 1*0 Which of the following is NOT in L? a)0 b)10 c)100 d) e)They’re all in L

10
Regular Expressions Let L be the language of this regular expression: ((a U Ø) + b*)* Which of the following is NOT true of L? a)Some strings in L have equal numbers of a’s and b’s b)All strings in L have more b’s than a’s c)L contains “aaaaaa” d)a‘s never follow b’s in any string in L e)None or more than one of the above

11
Regular Expressions Let L be the language of this regular expression: aØb* Which of the following is NOT true of L? a)L is the empty set b)L contains “a” c)aaab is not in L d)None or more than one of the above

18
State Elimination Eliminate state q1. To make an equivalent GNFA, what should go on the edge? – (A, B, C, D are arbitrary regular expressions; this is just a section of a GNFA.) a) AC b) AC U D c) ABC d) AB*C e) AB*C U D

19
To turn a DFA into a Regular Expression Add a new start state and accept state with epsilon-transitions This creates an NFA

20
To turn a DFA into a Regular Expression Eliminate states one-by-one, using the technique shown previously – More details: textbook At the end: a GNFA with 1 start state and 1 accept state. R is the equivalent regular expression.

21
What we have shown Regular languages can be characterized by all three structures: Next class: languages that are not regular NFA Regular Expression DFA