CSC 320: Lecture 10 DFAs and Regular Expressions - PowerPoint PPT Presentation

About This Presentation
Title:

CSC 320: Lecture 10 DFAs and Regular Expressions

Description:

Proofs by construction are nice because they don't just tell ... For a set S of states, E(S) = Uq S E(q) Transition function for new DFA: d(P, s) = E(Q) where ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 15
Provided by: wendym71
Category:

less

Transcript and Presenter's Notes

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

2
Announcements
  • 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.

3
Two 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.
4
E(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 ?
5
Convert this NDFA to a DFA
6
Start state is s, t, x, y states reachable
from s by traversing 0 or more e-transitions.
7
Read a from s, t, x, y and the next state can
be s, u, v.
8
Then follow zero or more e-transitions from s,
u, v, The next state is s, t, u, v, x, y.
9
Read b from s, t, x, y and the next state can
be x, y.
10
Then follow zero or more e-transitions from x,
y, The next state is x, y.
11
The 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.
12
Convert this NDFA to a DFA
13
Which states should be final states? Original
machine only final state was s.
14
Which states should be final states? Answer new
states whose subsets contain a state which was a
final state originally.
Write a Comment
User Comments (0)
About PowerShow.com