1 / 14

Proofs of Non-Regularity

Proofs of Non-Regularity. Reading: Section 4.3. Are all languages Regular?. No! (L = a n b n : n > 0) How do you prove a language is regular? How do you prove a language is not regular? If a language is finite, is it regular?. The Pigeonhole Principle. “Common Sense” Math Principle.

vanya
Download Presentation

Proofs of Non-Regularity

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proofs of Non-Regularity Reading: Section 4.3

  2. Are all languages Regular? • No! (L = anbn : n > 0) • How do you prove a language is regular? • How do you prove a language is not regular? • If a language is finite, is it regular?

  3. The Pigeonhole Principle • “Common Sense” Math Principle. • If there are n pigeons put in m holes, and n > m, there must be a hole with more than one pigeon in it.

  4. The Pumping Lemma - Intuition • If L is infinite regular language, it must have a DFA. So it is represented by a finite number of states. • Consider a very long string in L, one that is longer than the number of states in the DFA. • Then we must land in the same state more than once while processing the string. • Then, taking out a piece, or putting in another cycle, results in more strings in the language. • L is infinite, its DFA is finite, so there is a cycle in the DFA. The cycle can happen any number of times.

  5. Pumping Lemma • Let L be an infinite reg. lang. • Then, there exists some integer m so that any w in L where |w| >= m can be written as: w = xyz, such that the following hold: • |xy| <= m • |y| > 0 • w’ = xyiz is in L for all i > 0.

  6. Pumping Lemma Picture Y X Z For any w > m in the language, its path MUST look like this!

  7. Proof of the Pumping Lemma • Let L be regular, and its dfa have states qo,q1,…,qn. • Choose w in L such that |w| > n (m is n+1) • The path in the dfa on w is qo,qi,qj,…,qf. • At least one of these states must be repeated (pigeonhole) before the nth state • So the path is q0,qi,qj,…,qr,…,qr,…,qf • So, there must be strings so that • x = the string on q0,qi,qj,…,qr • y = the string on qr,…,qr • z = the string on qr,…,qf • So |xy| <= m, and |y| >0. • The cycle can happen any number of times and must still end in qf.

  8. Using the pumping lemma to prove a language is NOT regular • Assume L is regular, so it satisfies the p.l. • Suppose that someone else picks a number m. • Choose a string w so that |w| >= m. • The opponent picks a decomposition xyz, subject to |xy| <= m, and |y| >0 • Find any i >= 0 such that xyiz is not in L. • Then the language must not have been regular.

  9. Examples: L = {anbn : n >= 0} • Opponent picks m, I pick w = m a’s followed by m b’s. • Opponent picks decomposition, but |xy| <= m, so anything they choose is x = all a’s and y = all a’s. • For any i > 1, new string xyiz has too many a’s and is not in L. • So L is not regular.

  10. Example: na(w) < nb(w) • Opponent chooses m • We choose w = ambm+1 • Opponent chooses xyz, but |xy| <= m, so both must consist of all a’s. (y = ak,k <=m) • Choose i = 2. Then w’ = xm-ky2kbm+1 w’ = am+kbm+1 w’ is not in L, so L is not regular.

  11. L = (ab)nak : n > k, k>=0 • Opponent chooses m, we choose w = (ab)mam-1 • Opponent chooses decomposition xyz, but x and y must be part of the ab part. • If they chose y ends in a, then choose i = 0. • If they chose y = b, then choose i = 0. • If they chose y = (ab)k, then choose i = 0.

  12. L = anbkcn+k: n >= 0, k >= 0 • Apply homomorphism : h(a) = a h(b) = a h(c) = c Then h(L) = akck, k >= 0, which we know is not regular. So L couldn’t have been regular.

  13. What’s wrong with it?Example: L = wwR • Opponent picks any m. • We pick string w = a2m • Opponent picks decomposition xyz, and y is all a’s. • Then w’ is missing a’s in front and is therefore not in L.

  14. Examples: • L = wwR • L = ancbn :n > 0 • L = anbn+scs :n,s > 0

More Related