1 / 6

Nonregular Languages

CSC 4170 Theory of Computation. Nonregular Languages. Section 1.4. 1.4.a. Pumping Lemma (preliminary version): Suppose L is the language recognized by a DFA with p states, and w is a string in L of length at least p. Then w may be divided into three parts, w = x y z , so that:

montana
Download Presentation

Nonregular Languages

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. CSC 4170 Theory of Computation Nonregular Languages Section 1.4

  2. 1.4.a Pumping Lemma (preliminary version): Suppose L is the language recognized by a DFA with p states, and w is a string in L of length at least p. Then w may be divided into three parts, w = xyz, so that: 1. For each i0, xyizL; 2. |y| > 0; 3. |xy|  p. Pumping Lemma Example: Suppose a DFA with 6 states accepts Villanova. Then Villanova = xyz, e.g., with x = Vi, y = lla, z = nova, V i l l a n o v a so that the DFA also accepts Vinova (xy0z) Villanova (xy1z) Villallanova (xy2z) Villallallanova (xy3z) Villallallallanova (xy4z) … We also have: |lla| > 0, |Villa|  6.

  3. 1.4.b Proof idea l V i v l a o n V i l l an o v a

  4. 1.4.c Pumping Lemma (Theorem 1.70): Suppose L is a regular language. Then there is a number p, called the pumping length, such that any string w from L of length at least p can be divided into three parts, w = xyz, so that: 1. For each i0, xyizL; 2. |y| > 0; 3. |xy|  p. An equivalent formulation of the pumping lemma Proof: Suppose L is a regular language. Then we know that there must be a DFA recognizing L. Take the pumping length p to be the number of states of this DFA. The rest of the theorem is then a repetition of the previous formulation of the pumping lemma.

  5. 1.4.d Example 1.73: Show the nonregularity of B = {0n1n | n0} Using the pumping lemma for proving nonregularity: Example 1 Proof by contradiction: Assume B is regular. Let then p be its pumping length. Select wB with |w| p. By the pumping lemma, w=xyz and y can be pumped, so that we must also have xyyzB. Case 1: y only has 0s. But then xyyz has more 0s than 1s and B. Case 2: y only has 1s. But then xyyz has more 1s than 0s and B. Case 3: y has both 0s and 1s. But then xyyz has a 1 followed by a 0 and B. The assumption that B is regular took us to a contradiction. Hence the assumption was wrong, i.e. B is not regular.

  6. 1.4.e Example 1.75: Show the nonregularity of F = { ww | w {0,1}* } Using the pumping lemma for proving nonregularity: Example 2 Proof by contradiction: Assume F is regular. Let then p be its pumping length. Observe that 0p10p1F. By the pumping lemma, 0p10p1 =xyz and y can be pumped. By Condition 3, |xy|p. Therefore, y is entirely in the first 0p. Pumping y would produce a string that has only 0s is the first half, and two 1s in the second half. Obviously this string cannot be in F, which contradicts with the pumping lemma. The assumption that F is regular took us to a contradiction. Hence the assumption was wrong, i.e. F is not regular.

More Related