module4-print

module4-print - Module 4 Properties of regular languages...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Module 4 Properties of regular languages Not everything is regular. CS 360: Introduction to the Theory of Computing Daniel G. Brown, modified by Margareta Ackerman, University of Waterloo 4.1 Topics for Module 4 Proving languages non-regular: the pumping lemma Closure rules for regular languages Algorithms for decision problems about finite automata and regular languages. 4.2 1 Non-regular languages Where are we? We’ve given definitions for regular languages, and shown their strong connection to FAs. If we apply certain operations to regular languages, we get a regular language. Are all languages regular? Obviously no: we’re going to have 9 more weeks in the term, and we’re getting to the end of regular languages. Today, we’ll give more thinking about what makes a regular language. 4.3 Non-regular languages Language L is not regular if for every FA M , L 6 = L ( M ) . So if we characterize languages of FAs (that is, regular languages) very carefully, maybe we can characterize those that are not regular. Think about how a DFA M works. Suppose it has n states. Consider a word x in L ( M ) with | x | ≥ n . On its way from q 0 to an accept state, it must repeat a state. (Why? Only n states, and it starts out in one.) Arguments of this form use the pigeonhole principle 4.4 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Divide the word into parts Let’s say that we repeat state r . Then the word x can be divided: x = uvw , where: u = the part from q 0 to the first time we reach r v = the loop from r to itself w = The part from the seconnd time we reach r that leads us to an accept state Note : it’s possible that either u or w is ε . This deconstruction is possible for any word x in L ( M ) with | x | ≥ n . Fact : uvvw is also in L ( M ) . Why? Because vv also takes us from r to itself. Another word in L ( M ) is uw = uv 0 w , and indeed, uv * w L ( M ) . 4.5 More about regular languages We can divide any word x in L ( M ) of length at least n that way. Also, if we choose the first repeated state, then | uv | ≤ n . Why? Again, the machine has n states, so we must have the first repeated state by the n th step.) And | v | ≥ 1, since it’s an FA, with no ε -transitions. Let’s formalize this: Given an FA M with n states, and a word x in L ( M ) , where | x |≥ n , x can be divided as x = uvw , where | uv | ≤ n , | v | ≥ 1, and uv * w L ( M ) . 4.6 Pumping lemma This fact is sometimes called the “ pumping lemma ”: We can pump out many copies of v , and uvvvvvvvvvvvw is still part of L ( M ) . It can be seen as a statement about regular languages. Every regular language L is accepted by a DFA. For a given regular language L , there exists some smallest DFA, M , that accepts L . Let’s say it has n states. So there must be some n such that we can make the claim about M we just had.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/14/2012 for the course CS 360 taught by Professor Johnwatrous during the Winter '08 term at Waterloo.

Page1 / 8

module4-print - Module 4 Properties of regular languages...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online