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:
“The American doctrinaire is the converse of the American demagogue, and, in this way, is scarcely less injurious to the public. The first deals in poetry, the last in cant. He is as much a visionary on one side, as the extreme theoretical democrat is a visionary on the other.”
—James Fenimore Cooper (17891851)
“Whilst we converse with what is above us, we do not grow old, but grow young.”
—Ralph Waldo Emerson (18031882)
“Strange that so few ever come to the woods to see how the pine lives and grows and spires, lifting its evergreen arms to the light,to see its perfect success; but most are content to behold it in the shape of many broad boards brought to market, and deem that its true success! But the pine is no more lumber than man is, and to be made into boards and houses is no more its true and highest use than the truest use of a man is to be cut down and made into manure.”
—Henry David Thoreau (18171862)