I hate the Pumping Lemma
bosker.wordpress.com
I hate the Pumping Lemma
1–10 of 52 posts
Re: I hate the Pumping Lemma
#2(It nerdsniped me by claiming it was difficult.)
Re: I hate the Pumping Lemma
#3Him: Do you know how to check if it's possible to write a regular expression for this?
Me: Either create an automata and then it's demonstrably possible, or apply the pumping lemma to prove it's impossible?
Him: No. Dare Stackoverflow to write it.
Re: I hate the Pumping Lemma
#4As many people on here know, the phrase "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo" is a complete sentence[0]. What many people may not know is that you can add (but not subtract) as many "buffalo" as you want and still have it be a complete sentence.
Why's that?
Well, an easier sentence to look at is "James while John had had had had had had had had had had had a better effect on the teacher"[1]. In this case, it's clear (once you understand the meaning of the sentence) that you can add as many "had" words as you want, as long as you keep above a certain minimum. This is because all but a couple of the "hads" should really be inside quotation marks, as they are simply denoting the words that James (or John) did have at some past time - they convey no semantic meaning within the sentence.
If you envision a DFA[2] (okay, here's where it gets technical), we're basically saying that one node has an edge that goes to itself - a "self loop" - or a previous node that has already been visited. Once you have this loop established, you can traverse it as many times as you want (ie, arbitrarily many), as long as you traverse it a minimum number of times.
All the pumping lemma states is that:
(1) if this loop exists, it can be traveled as many times as you want, and
(2) It must have the same effect each time (since DFAs have no "memory" - they have no stack).
If there is a limit to the number of times it can be traversed, or if it has a different effect depending on the number of iterations[3], then the language cannot be regular.
[0]http://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffalo...
[1] http://en.wikipedia.org/wiki/James_while_John_had_had_had_ha...
[2] http://en.wikipedia.org/wiki/Deterministic_finite_automaton
[3] Okay, to be really pedantic, it can have a different effect each time, as long as there is a finite number of "different" effects it can have, since there must be a finite number of states in a DFA. But that was a bit too clumsy to try and write.
Re: I hate the Pumping Lemma
#5Re: I hate the Pumping Lemma
#6Re: I hate the Pumping Lemma
#7Ironically, this post's explanation caused me understand the pumping lemma for the first time after years of letting my eyes just slide over any time I read across a mention. (It nerdsniped me by claiming it was difficult.)
Re: I hate the Pumping Lemma
#8Ironically, this post's explanation caused me understand the pumping lemma for the first time after years of letting my eyes just slide over any time I read across a mention. (It nerdsniped me by claiming it was difficult.)
Same here. Also, cheers for "nerdsniped." I'd never heard that before.
Re: I hate the Pumping Lemma
#9A conversation I had the other week: Him: Do you know how to check if it's possible to write a regular expression for this? Me: Either create an automata and then it's demonstrably possible, or apply the pumping lemma to prove it's impossible? Him: No. Dare Stackoverflow to write it.
EDIT: Yes this seems to be wrong
Re: I hate the Pumping Lemma
#10A conversation I had the other week: Him: Do you know how to check if it's possible to write a regular expression for this? Me: Either create an automata and then it's demonstrably possible, or apply the pumping lemma to prove it's impossible? Him: No. Dare Stackoverflow to write it.
Some regexp dialects are actually Turing complete from what I've heard. EDIT: Yes this seems to be wrong