Followup - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Followup

Description:

If we put n objects (pigeons) into m boxes (holes), and if n m, then at least ... What are the pigeons? What are the pigeon holes? ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 20
Provided by: daveh5
Category:
Tags: followup | pigeon

less

Transcript and Presenter's Notes

Title: Followup


1
Followup
  • We know that if L1 and L2 are regular, then L1L2
    is regular.
  • Let L L1L2 be a regular. Does this imply that
    L1 and L2 are regular?
  • Consider L1aibi i?0, L2?

2
HW 4.1.17
  • M(tail(L)) given M(L)
  • Add new starting state
  • Add transitions from new starting state to all
    other states on l

3
HW 4.1.25
  • What the heck does min(L) mean?
  • Consider L ab, abc
  • min(L) ab
  • Consider L(abcd)
  • min(L) abc, not ac!
  • Answer Sheet Take the transition graph of a dfa
    for L and delete all edges going out of any final
    state. Note that this works only if we start
    with a dfa.

4
5a Decision Problems for Regular Languages
4.2,4.3
  • Decision Procedure for Regular Language
  • Membership Tests for Empty, Finite, Infinite
    Language
  • Equality of Regular Languages
  • Pigeonhole Principle
  • A Non-Regular Language
  • The Pumping Lemma for Regular Languages
  • The Language made up of All Possible Regular
    Expressions is NOT Regular (not in text)

5
Theorem 4.5 page 112
  • Membership in Regular Language?
  • To be a valid "Decision Procedure," it must end
    in finite length of time
  • Feed word to dfa...
  • This result is not so obvious for other classes
    of languages

6
Theorem 4.6 page 112
  • Regular Language Empty?
  • Reduce dfa to minimal number of states
  • see if you can get from initial state to final
  • Regular Language Finite?
  • Minimal dfa
  • see if any path from initial to final state
    includes a cycle

7
Theorem 4.7 page 112-3
  • Equality of Regular Languages
  • One proof in text
  • Another would be to build minimal dfa for each.
  • If the languages were equal, the dfa's would be
    identical (except for renaming of states).

8
Pigeonhole Principle
  • If we put n objects (pigeons) into m boxes
    (holes), and if n gt m, then at least one box must
    have more than one object in it.

9
Proof on Non-Regularity
  • Example 4.6 page 114
  • anbn n?0 is not regular based on Pigeonhole
    Principle
  • If it were regular (i.e. assume it is regular),
    it would be accepted by a "finite" state machine.
    This machine must therefore have a finite number
    of states. (duh!)
  • Call that number m. Consider ambm.
  • am must visit to m1 states (but only m in
    machine). Why?
  • What are the pigeons? What are the pigeon holes?
  • Therefore, at least one state is visited more
    than once in path from start to final state.
  • We could repeat this loop or even eliminate it
    and still accept resulting word with more (or
    fewer) as than bs
  • Contradiction!

10
Pumping Lemma for Regular Languages
  • Theorem 4.8 pages 115-116
  • Let L be an infinite regular language. Then there
    exists some positive integer m such that any w ?
    L with w ? m can be decomposed as
  • w xyz,
  • with
  • xy ? m,
  • and
  • y ? 1,
  • such that
  • wi xyiz
  • is also in L for all i 0, 1, 2, ...

11
Illustrations of "Pumping"
  • Consider a machines accepting
  • abc
  • How many states?
  • what are good choices for x, y, z?
  • (aa)ba(bbaa)
  • more possible w's, more choices for x, y, z

12
Proof of Pumping Lemma
  • Consider dfa accepting word. It has a finite
    number of states, call this m.
  • Consider a word w of length at least m.
  • Machine accepting w must pass through w1
    states
  • Apply Pigeonhole Principle
  • Must pass through at least one state at least
    twice

13
About the Pumping Lemma
  • Why its called a lemma
  • Used to prove that languages are NOT regular, not
    to illustrate that they are regular.
  • The joke We are working with the value of m,
    but if the language is not regular, no such m
    exists!

14
Selecting a Good w
  • Consider L yyR y ? a,b
  • w abba, w2 abbaabba, etc.
  • doesn't work because w lt m
  • How do we know this???
  • w a2m am am, can be pumped, but doesn't prove
    anything
  • should have tried ambmbmam, or ambbam

15
Pumping Lemma Proof for anbn
  • ASS U ME that L is accepted by a dfa
  • The dfa has some finite of states, call it m
  • Consider w ambm. It can be decomposed into xyz,
    where y must ak for some kgt0, since xym.
    (i.e. xam-k-j, yak, zajbm for some j0)
  • By P.L., all words of the form am(i-1)kbm
    i0 will also be accepted.
  • Since am-kbm (i0 above) will be accepted, and is
    not in L, CONTRADICTION! (? assumption is false)

16
Applying the Pumping Lemma
  • Exercise 4.3.3 page 122
  • Let w (of pumping lemma) ambm
  • What about L?
  • Exercise 4.3.5(a)
  • Let wap, where p is prime and pgtm1
  • yak, for some kgt0, then xz ap-k.
  • Consider xy(p-k)z y(p-k)xz ak(p-k)ap-k
    a(k1)(p-k)
  • contains (k1)(p-k) a's which is a composite
    number
  • Exercise 4.3.9(f)

17
Language of all Legal Regular Expressions is
not Regular
  • Note that picking many words doesn't get us very
    far
  • a?a?(a?b)?acan be raised to mth power and pumped
  • Pick w (ma)m
  • go through formal proof by trying to pick all
    possible x's, y's and z's
  • What if parentheses were not part of Regular
    Expressions?
  • nfa on next slide

18
nfa to accept Language of Regular Expressions
(less parentheses)

,?
a,b,?,?
a,b,?,?
NOTE ? and ? represent actual symbols of the
alphabet, not the empty word and empty set.
19
In-Class ExerciseExercise 4.3.10 page 123
  • Work in groups of 2 or 3
  • First 2 groups finished, put on board
  • Answer on next slide (no peeking)
Write a Comment
User Comments (0)
About PowerShow.com