Converse of Lemma Not True
Note that while the pumping lemma states that all regular languages satisfy the conditions described above, the converse of this statement is not true: a language that satisfies these conditions may still be non-regular. In other words, both the original and the general version of the pumping lemma give a necessary but not sufficient condition for a language to be regular.
For example, consider the following language L: .
In other words, L contains all strings over the alphabet {0,1,2,3} with a substring of length 3 including a duplicate character, as well as all strings over this alphabet where precisely 1/7 of the string's characters are 3's. This language is not regular but can still be "pumped" with p = 5. Suppose some string s has length at least 5. Then, since the alphabet has only four characters, at least two of the five characters in the string must be duplicates. They are separated by at most three characters.
- If the duplicate characters are separated by 0 characters, or 1, pump one of the other two characters in the string, which will not affect the substring containing the duplicates.
- If the duplicate characters are separated by 2 or 3 characters, pump 2 of the characters separating them. Pumping either down or up results in the creation of a substring of size 3 that contains 2 duplicate characters.
- The second condition of L ensures that L is not regular: i.e., there are an infinite number of strings that are in L but cannot be obtained by pumping some smaller string in L.
For a practical test that exactly characterizes regular languages, see the Myhill-Nerode theorem. The typical method for proving that a language is regular is to construct either a finite state machine or a regular expression for the language.
Read more about this topic: Pumping Lemma For Regular Languages
Famous quotes containing the words converse of, converse and/or true:
“There is a plain distinction to be made betwixt pleasure and happiness. For tho there can be no happiness without pleasureyet the converse of the proposition will not hold true.We are so made, that from the common gratifications of our appetites, and the impressions of a thousand objects, we snatch the one, like a transient gleam, without being suffered to taste the other.”
—Laurence Sterne (17131768)
“The eyes of men converse as much as their tongues, with the advantage that the ocular dialect needs no dictionary, but is understood all the world over.”
—Ralph Waldo Emerson (18031882)
“Lucky Man,
its true that shes virtuous
and has a beautiful body.
And its true that I am lacking.
But tell me:
will all these people
who arent like her
have to die?”
—Hla Stavhana (c. 50 A.D.)