Title: CSC 320: Lecture 10 DFAs and Regular Expressions
1- Proof of the Day Prove the following languages
over S 0, 1 are regular by constructing NDFAs
which accept them. - L1 w w starts and ends with 0.
- L2 (000 ? 11 ? 01)
- L1 ? L2
- L1 ? L2
2Announcements
- Assignment 2 had a small typo which has now been
fixed. On Question 4 - ?2 (r0, a, r0), (r0, b, r1), (r1, a, r0), (r1,
b, r2), - (r2, a, r2), (r2, b, rb).
- should have been
- ?2 (r0, a, r0), (r0, b, r1), (r1, a, r0), (r1,
b, r2), - (r2, a, r2), (r2, b, r2).
- Note on question 3, the start state is actually
q1 and not q0. Question 3(b) is hard. - No office hours this Friday Oct. 2.
3Two machines M1 and M2 are equivalent if L(M1)
L(M2). Theorem For any NDFA, there exists an
equivalent DFA. Proof By construction. Proofs by
construction are nice because they dont just
tell us that an object exists- they also give us
an algorithm for constructing the object.
4E(q) p p is reachable from q by following
only transitions on e. Note q is always in
E(q). For a set S of states, E(S) Uq?S
E(q) Transition function for new DFA d(P, s)
E(Q) where Q q for some p in P, (p, s, q) is
in ?
5Convert this NDFA to a DFA
6Start state is s, t, x, y states reachable
from s by traversing 0 or more e-transitions.
7Read a from s, t, x, y and the next state can
be s, u, v.
8Then follow zero or more e-transitions from s,
u, v, The next state is s, t, u, v, x, y.
9Read b from s, t, x, y and the next state can
be x, y.
10Then follow zero or more e-transitions from x,
y, The next state is x, y.
11The number of possible states could be
exponential. But on assignments and exams, only a
small subset of them will ever be pertinent. Only
work out transitions for pertinent states.
12Convert this NDFA to a DFA
13Which states should be final states? Original
machine only final state was s.
14Which states should be final states? Answer new
states whose subsets contain a state which was a
final state originally.