To make sure: Pumping lemma for infinite regular languages only?
Asked Answered
T

4

14

So this is not about the pumping lemma and how it works, it's about a pre-condition.

Everywhere in the net you can read, that regular languages must pass the pumping lemma, but noweher anybody talks about finite languages, which actually are a part of regular languages.

So we might all aggree, that the following language is a finite language as well as it's a regular one, but it definitely does not pass the pumping lemma:

L = {'abc', 'defghi'}

Please, tell me if simply no one writes about it or why we're wrong - or even not.

Touchandgo answered 6/8, 2012 at 16:36 Comment(0)
F
17

The reason that finite languages work with the pumping lemma is because you can make the pumping length longer than the longest word in the language. The pumping lemma, as stated on Wikipedia (I don't have my theory of computation book with me) is the following:

Let L be a regular language. Then there exists an integer p ≥ 1 depending only on L such that every string w in L of length at least p (p is called the "pumping length") can be written as w = xyz (i.e., w can be divided into three substrings), satisfying the following conditions:

  1. |y| ≥ 1
  2. |xy| ≤ p
  3. for all i ≥ 0, xyizL

Now, consider some finite language L, and let k = maxwL |w| be the length of the longest word in L. Then I claim that the minimal pumping length for L is p = k+1. Since there are no words in L with length at least k+1, it is (vacuously) true that every such word satisfies the three conditions (or, indeed, any other condition you care to specify).

You can see that any finite language is regular, of course (regular languages are closed under finite union, and all languages of one word are regular), but note that this argument doesn't show this; it's important to remember that while any regular language can be pumped, there exist languages that can be pumped but are not regular.

Fredericfrederica answered 6/8, 2012 at 17:14 Comment(0)
S
6

"IN CONTEXT OF PUMPING LEMMA FOR REGULAR LANGUAGES "

Yes we agree, All finite languages are regular language means we can have Finite automata as well as regular expression for any finite language.
Whereas a infinite language may be regular or not. Venn-Diagram is shown below. So we need to only check for infinite language L where its regular of not!

Think about FA:

  • Any automata for a finite language can not contains loop! (also regular expressions for finite language will be without * and +operation).

  • Any automata for a infinite language(regular) will contain the loop. We can't construct an automata for infinite language without loop; where loop may be a self loop of via some other state. {If its self loop then a single symbol repeats any number of time, if via other state a sequence of symbols comes in loop can be repeat any numbers of time}.

Pumping means repeating. In pumping lemma w can be break in three parts x, y, z. The 'y' is in part of w occurs in loop (that's y>=1 ). So pumping lemma is nothing finding looping part y and repeating this looping part any numbers of time.
enter image description here You can see if you repeat loop any number of times and generates new string w' its still in language.

NOTE: Regular Expressions for infinite language can't be without * and +operation!

[answer] There is no loop in an automata for finite language so we can't pump(generate by repeating) new strings in language. And Pumping Lemma is not applicable for finite language.

Although some writers also explain pumping lemma for finite language where i in xyiz can be repeat boundedly (say k ≤ i ≤ m )


enter image description here

In Venn-Diagram Every finite set is regular. Infinite set may be regular or not. Regular-Languages ⊆ Non-Regular Languages


Surakarta answered 24/11, 2012 at 9:8 Comment(1)
VERY OLD QUESTION~~ Although it was answered, I Liked to add my thoughts too!Surakarta
P
0

There's a simplest way to show that some language is infinite. Assume that L is the language for some regular expression E, L(E).

Suppose L(E) is equivalent to {ab^nc | n ≥ 0}.

We know that E is in the form ab*c, and we know this language is probably regular(we can't prove something be regular), since the pumping lemma this conclusion is k = 0, put in another way, xz = ac, and every regular expression has an equivalent automaton.

The conclusion is simple, if the DFA has some state with transition to itself, the language is infinite.

     a   b   c

 q0  q1    
 q1     q1  q2
*q2         

q1 has transition to itself, thus L(E) is infinite.

Peripeteia answered 21/4, 2015 at 15:39 Comment(0)
M
-1

Finite languages are regular languages by definition because you can build a regular expression that satisfies it by just expressing the union of all the words (e.g. (abc)|(defghi) is a regular expression that satisfies your language) and consequently you can have a deterministic finite automaton that satisfies it.

Not being able to pass the pumping lemma does not means that the language is not regular. In fact, to use the pumping lemma your language must have some kind of closure in its definition. If your language is just a set of words there is nothing to "pump" in it.

Macadamia answered 6/8, 2012 at 17:3 Comment(1)
This is backwards: if your language is regular, then you can pump it. Thus, by the contrapositive, if you can't pump your language, then it isn't regular. It is, however, true that if you can pump your language, it might or might not be regular.Fredericfrederica

© 2022 - 2024 — McMap. All rights reserved.