I have troubles in solving/proving this problem. Any ideas please?
相关问题
- Swedish SSN Regular expression reject users under
- NPDA with exactly 2 states that might need 3 trans
- is a* the same as (a*)*?
- No \p{L} for JavaScript Regex ? Use Unicode in JS
- Why does Regexp have a timeout method, while in th
相关文章
- Why does Regexp have a timeout method, while in th
- Minimum pumping length for a regular language
- substring match faster with regular expression?
- Regular languages vs. non-regular ones [closed]
- Representing identifiers using Regular Expression
- Why can't I specify the storage class for form
- DFA based regular expression matching - how to get
- LR(1) Item DFA - Computing Lookaheads
Yes, the problem is tricky at first few try and deserve vote-up.
Pumping Lemma a necessary property of regular language is tool for formal proof that language is not regular language.
Formal definition: Pumping lemma for regular languages
Suppose, if you choose string W = an bm where
(n + m) ≥ p
andn > m + 1
. Choice of W is valid but this choice you are not able to show that language is not regular language. Because with thisW
you always have at-least one choice ofy=a
to pump new strings in language by repeatinga
for all values ofi
(for i =0 and i > 1).Before I writing my solution to proof the language is not regular. Please understand following points and notice: I made bold
every string w
andall i
in formal definition of pumping lemma above.read: what pumping lemma formal definition says
Proof: using pumping lemma
Step (1): Choose string W = an bm where
(n + m) ≥ p
andn = m + 1
.Is this choice of
W
is valid according to pumping lemma?
Yes, such W is in language because number of
a
= n > number ofb
=m . W is in language and sufficiently large >=p
.Step (2): Now chose a
y
to generate new string for alli >= 0
.And no choice is possible for
y
this time! Why?First, it is essay to understand that we can't have
b
symbol in y because it will either generate new strings out of pattern or in resultant string total number ofb
will be more than total number ofa
symbols.Second, we can't chose y = some a's because with
i=0
you would get a new string in which number ofa
s will be less then numberb
s that is not possible in language.(remember number ofa
in W was just one more thenb
so removing any a means in resultant string N(a)=N(b) that is not acceptable because n>m)So in we could find some W those are sufficiently large but using that we can't generate new string in language that contradict with pumping lemma property of regular language hence then language {an bm | n > m} is not a regular language indeed.