Necessary properties of formal langagues in certain classes that rely on closure against repetition of certain subwords. Make sure your question isn't covered by applying the techniques in https://cs.stackexchange.com/q/1031/755.
Questions tagged [pumping-lemma]
568 questions
36
votes
3 answers
Pumping lemma for simple finite regular languages
Wikipedia has the following definition of the pumping lemma for regular langauges...
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…
Phil Wright
- 943
- 1
- 10
- 13
26
votes
3 answers
Is the language of pairs of words of equal length whose hamming distance is 2 or greater context-free?
Is the following language context free?
$$L = \{ uxvy \mid u,v,x,y \in \{ 0,1 \}^+, |u| = |v|, u \neq v, |x| = |y|, x \neq y\} $$
As pointed out by sdcvvc, a word in this language can also be described as the concatenation of two words of the same…
Robert777
- 747
- 6
- 15
19
votes
3 answers
Example of a non-context free language that nonetheless CAN be pumped?
So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma).
user2329564
- 193
- 1
- 5
19
votes
4 answers
Using Pumping Lemma to prove language $L = \{(01)^m 2^m \mid m \ge0\}$ is not regular
I'm trying to use pumping lemma to prove that $L = \{(01)^m 2^m \mid m \ge0\}$ is not regular.
This is what I have so far: Assume $L$ is regular and let $p$ be the pumping length, so $w = (01)^p 2^p$. Consider any pumping decomposition $w = xyz$…
Momagic
- 191
- 1
- 3
17
votes
5 answers
Is the language of words containing equal number of 001 and 100 regular?
I was wondering when languages which contained the same number of instances of two substrings would be regular. I know that the language containing equal number of 1s and 0s is not regular, but is a language such as $L$, where $L$ = $\{ w \mid$…
Ben Elgar
- 271
- 2
- 7
12
votes
1 answer
How can ws with |w| = |s| and w ≠ s be context-free while w#s is not?
Why does (if so) the seperator $\#$ is making a difference between the two languages ?
Let say:
$L=\{ws : |w|=|s| ,\ w,s\in \{0,1\}^{*}, \ w \neq s \}$
$L_{\#}=\{w\#s : |w|=|s|,\ w,s\in \{0,1\}^{*},\ w \neq s \}$
Here is a proof and a grammer…
limitless
- 286
- 1
- 2
- 9
12
votes
1 answer
A pumping lemma for deterministic context-free languages?
The pumping lemma for regular languages can be used to prove that certain languages are not regular, and the pumping lemma for context-free languages (along with Ogden's lemma) can be used to prove that certain languages are not context-free.
Is…
templatetypedef
- 9,302
- 1
- 32
- 62
11
votes
2 answers
How can I prove this language is not context-free?
I have the following language
$\qquad \{0^i 1^j 2^k \mid 0 \leq i \leq j \leq k\}$
I am trying to determine which Chomsky language class it fits into. I can see how it could be made using a context-sensitive grammar so I know it is atleast…
justausr
- 435
- 5
- 11
11
votes
3 answers
How to feel intuitively that a language is regular
Given a language $ L= \{a^n b^n c^n\}$, how can I say directly, without looking at production rules, that this language is not regular?
I could use pumping lemma but some guys are saying just looking at the grammar that this is not regular one. How…
doniyor
- 243
- 1
- 8
10
votes
1 answer
Intuition behind the condition |xy| ≤ p in pumping lemma for regular languages
When I take a look at the proofs for pumping lemma, I have a feeling that I am often missing the intuition behind the condition |xy| ≤ p.
What exactly is the reason behind this condition? All the literature I have taken a look at are either silent…
Masroor
- 387
- 2
- 13
10
votes
1 answer
What's wrong with my pumping lemma proof?
The language $L = \{0^{2n} \space |\space n \ge 0 \}$ is obviously regular – for example, it matches the regular expression $(00)^*$. But the following pumping lemma argument seems to show it's not regular. What's gone wrong?
I've found a way of…
flashburn
- 1,233
- 1
- 12
- 22
10
votes
4 answers
Regular language not accepted by DFA having at most three states
Describe a regular language that cannot be accepted by any DFA that has only three states.
I'm not really sure where to start on this and was wondering if someone could give me some tips or advice. I understand that the pumping lemma can be used…
zic10
- 201
- 2
- 4
9
votes
3 answers
Physical significance of pumping length in pumping lemma
Would it be possible to explain the physical significance of pumping length $p$ in pumping lemma for regular languages?
Somehow, the physical significance of
pumping length $p$ in pumping lemma for regular languages escapes me.
I have explored a…
Masroor
- 387
- 2
- 13
9
votes
1 answer
Can there be a context-sensitive pumping lemma?
A "pumping" property (words of a certain length imply the existence of loops in the language-defining mechanism) are known to exist for regular and context-free languages and a few more (usually used to disprove a language's membership to a certain…
lukas.coenig
- 773
- 4
- 12
9
votes
1 answer
Are Context-Free languages closed under XOR?
First, let's generalize the notion of XOR on strings over the ${0,1}$ alphabet. For strings of the same length, the XOR is the bitwise XOR. For strings of different lengths, we define $ \text{xor}(w, \epsilon) = \text{xor}(\epsilon, w) = w $, where…
Toobatf
- 93
- 5