How to prove using pumping lemma that language generated by a(b*)c(d*)e is regular?
up vote
6
down vote
favorite
I am studying pumping lemma from Introduction to theory of computation by Michael Sipser. I wanted to check if the language generated by regular expression
a(b*)c(d*)e
can be proved to be regular using pumping lemma. The string generated by this expression are of the form.
abcde
abbcdde...
We can not write these string in the form of $xy^iz$. We can only write it in the form $vx_1^iyx_2^jz$.
So, how can I prove using pumping lemma that the language generated by the expression is regular?
regular-languages finite-automata regular-expressions pumping-lemma
add a comment |
up vote
6
down vote
favorite
I am studying pumping lemma from Introduction to theory of computation by Michael Sipser. I wanted to check if the language generated by regular expression
a(b*)c(d*)e
can be proved to be regular using pumping lemma. The string generated by this expression are of the form.
abcde
abbcdde...
We can not write these string in the form of $xy^iz$. We can only write it in the form $vx_1^iyx_2^jz$.
So, how can I prove using pumping lemma that the language generated by the expression is regular?
regular-languages finite-automata regular-expressions pumping-lemma
15
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
1
Similar to Isa*b*
regular?
– Grijesh Chauhan
Aug 24 at 7:44
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I am studying pumping lemma from Introduction to theory of computation by Michael Sipser. I wanted to check if the language generated by regular expression
a(b*)c(d*)e
can be proved to be regular using pumping lemma. The string generated by this expression are of the form.
abcde
abbcdde...
We can not write these string in the form of $xy^iz$. We can only write it in the form $vx_1^iyx_2^jz$.
So, how can I prove using pumping lemma that the language generated by the expression is regular?
regular-languages finite-automata regular-expressions pumping-lemma
I am studying pumping lemma from Introduction to theory of computation by Michael Sipser. I wanted to check if the language generated by regular expression
a(b*)c(d*)e
can be proved to be regular using pumping lemma. The string generated by this expression are of the form.
abcde
abbcdde...
We can not write these string in the form of $xy^iz$. We can only write it in the form $vx_1^iyx_2^jz$.
So, how can I prove using pumping lemma that the language generated by the expression is regular?
regular-languages finite-automata regular-expressions pumping-lemma
regular-languages finite-automata regular-expressions pumping-lemma
edited Aug 24 at 6:28
xskxzr
3,2971730
3,2971730
asked Aug 23 at 14:05
V K
1385
1385
15
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
1
Similar to Isa*b*
regular?
– Grijesh Chauhan
Aug 24 at 7:44
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29
add a comment |
15
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
1
Similar to Isa*b*
regular?
– Grijesh Chauhan
Aug 24 at 7:44
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29
15
15
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
1
1
Similar to Is
a*b*
regular?– Grijesh Chauhan
Aug 24 at 7:44
Similar to Is
a*b*
regular?– Grijesh Chauhan
Aug 24 at 7:44
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29
add a comment |
3 Answers
3
active
oldest
votes
up vote
16
down vote
accepted
The pumping lemma states a proprety of regular languages:
If $L$ is a regular language then there exists an integer $p$ such that if $w in L$ has length at least $p$ then it can be written as $w = xyz$, where $|xy| leq p$, $y neq epsilon$, and $xy^iz in L$ for all $i geq 0$.
Unfortunately, this property doesn't characterize regular languages. That is, there exist non-regular languages which also satisfy the property stated in the lemma. An example is $a^i b^j^2 : i,j geq 0 cup b^k : k geq 0 $.
Your language satisfies the pumping lemma with $p = 4$. If $w in ab^*cd^*e$ has length at least 4, then it must contain $b$s or $d$s. You can check that if it contains $b$s then you can take $y = b$, and if it contains no $b$s then you can take $y = d$.
As stated above, this doesn't prove that the language is regular. The simplest way to show that $ab^*cd^*e$ is regular is to use the fact that all languages given by regular expressions are regular. It is also not hard to construct a DFA that accepts your language.
The language you gave as an example of a non-regular language is regular with regex:(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
add a comment |
up vote
18
down vote
You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) might have defined them as any of
- languages described by regular expressions;
- languages accepted by deterministic finite automata (DFAs);
- languages accepted by nondeterministic finite automata (NFAs).
If, additionally, you've proven that some or all of these definitions are equivalent, you can use any of the appropriate ones.
In this case, your language is defined by a regular expression. If that's your definition of regular languages, you're already done.
Our reference question has more information.
add a comment |
up vote
3
down vote
You already got your answer, this is just to make it clear that the problem you are facing is actually a logical one.
The pumping lemma is an implication: „If $L$ is regular then XYZ“. It states a necessary condition for a language to be regular (not a sufficient one). Note how the implication does not say anything about what happens if XYZ is true.
BUT you can use the contraposition of the implication, i.e. „if XYZ is not true“ to prove that a language is not regular (because we know that all regular languages do satisfy XYZ)
As already noted by the others you can show that $L$ is regular by showing that you can generate $L$ while adhering to whatever rules you have defined as being valid for regular languages (e.g. can be generated by a DFA, regular grammar, etc.). Note how OTOH you can‘t use this to show that some language is not regular, since you would need to show that no such DFA exists - but how can you know that it really doesn‘t exist and it is not simply your disability to find it? Well, here is where you can use the pumping lemma.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
16
down vote
accepted
The pumping lemma states a proprety of regular languages:
If $L$ is a regular language then there exists an integer $p$ such that if $w in L$ has length at least $p$ then it can be written as $w = xyz$, where $|xy| leq p$, $y neq epsilon$, and $xy^iz in L$ for all $i geq 0$.
Unfortunately, this property doesn't characterize regular languages. That is, there exist non-regular languages which also satisfy the property stated in the lemma. An example is $a^i b^j^2 : i,j geq 0 cup b^k : k geq 0 $.
Your language satisfies the pumping lemma with $p = 4$. If $w in ab^*cd^*e$ has length at least 4, then it must contain $b$s or $d$s. You can check that if it contains $b$s then you can take $y = b$, and if it contains no $b$s then you can take $y = d$.
As stated above, this doesn't prove that the language is regular. The simplest way to show that $ab^*cd^*e$ is regular is to use the fact that all languages given by regular expressions are regular. It is also not hard to construct a DFA that accepts your language.
The language you gave as an example of a non-regular language is regular with regex:(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
add a comment |
up vote
16
down vote
accepted
The pumping lemma states a proprety of regular languages:
If $L$ is a regular language then there exists an integer $p$ such that if $w in L$ has length at least $p$ then it can be written as $w = xyz$, where $|xy| leq p$, $y neq epsilon$, and $xy^iz in L$ for all $i geq 0$.
Unfortunately, this property doesn't characterize regular languages. That is, there exist non-regular languages which also satisfy the property stated in the lemma. An example is $a^i b^j^2 : i,j geq 0 cup b^k : k geq 0 $.
Your language satisfies the pumping lemma with $p = 4$. If $w in ab^*cd^*e$ has length at least 4, then it must contain $b$s or $d$s. You can check that if it contains $b$s then you can take $y = b$, and if it contains no $b$s then you can take $y = d$.
As stated above, this doesn't prove that the language is regular. The simplest way to show that $ab^*cd^*e$ is regular is to use the fact that all languages given by regular expressions are regular. It is also not hard to construct a DFA that accepts your language.
The language you gave as an example of a non-regular language is regular with regex:(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
add a comment |
up vote
16
down vote
accepted
up vote
16
down vote
accepted
The pumping lemma states a proprety of regular languages:
If $L$ is a regular language then there exists an integer $p$ such that if $w in L$ has length at least $p$ then it can be written as $w = xyz$, where $|xy| leq p$, $y neq epsilon$, and $xy^iz in L$ for all $i geq 0$.
Unfortunately, this property doesn't characterize regular languages. That is, there exist non-regular languages which also satisfy the property stated in the lemma. An example is $a^i b^j^2 : i,j geq 0 cup b^k : k geq 0 $.
Your language satisfies the pumping lemma with $p = 4$. If $w in ab^*cd^*e$ has length at least 4, then it must contain $b$s or $d$s. You can check that if it contains $b$s then you can take $y = b$, and if it contains no $b$s then you can take $y = d$.
As stated above, this doesn't prove that the language is regular. The simplest way to show that $ab^*cd^*e$ is regular is to use the fact that all languages given by regular expressions are regular. It is also not hard to construct a DFA that accepts your language.
The pumping lemma states a proprety of regular languages:
If $L$ is a regular language then there exists an integer $p$ such that if $w in L$ has length at least $p$ then it can be written as $w = xyz$, where $|xy| leq p$, $y neq epsilon$, and $xy^iz in L$ for all $i geq 0$.
Unfortunately, this property doesn't characterize regular languages. That is, there exist non-regular languages which also satisfy the property stated in the lemma. An example is $a^i b^j^2 : i,j geq 0 cup b^k : k geq 0 $.
Your language satisfies the pumping lemma with $p = 4$. If $w in ab^*cd^*e$ has length at least 4, then it must contain $b$s or $d$s. You can check that if it contains $b$s then you can take $y = b$, and if it contains no $b$s then you can take $y = d$.
As stated above, this doesn't prove that the language is regular. The simplest way to show that $ab^*cd^*e$ is regular is to use the fact that all languages given by regular expressions are regular. It is also not hard to construct a DFA that accepts your language.
answered Aug 23 at 14:42
Yuval Filmus
188k12177339
188k12177339
The language you gave as an example of a non-regular language is regular with regex:(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
add a comment |
The language you gave as an example of a non-regular language is regular with regex:(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
The language you gave as an example of a non-regular language is regular with regex:
(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
The language you gave as an example of a non-regular language is regular with regex:
(a*(bb)*)|b*
– ratchet freak
Aug 24 at 12:26
5
5
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
@ratchetfreak That example contained $b^j^2$, the regex you supplied replaces that with $b^2j$
– Robin
Aug 24 at 14:04
add a comment |
up vote
18
down vote
You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) might have defined them as any of
- languages described by regular expressions;
- languages accepted by deterministic finite automata (DFAs);
- languages accepted by nondeterministic finite automata (NFAs).
If, additionally, you've proven that some or all of these definitions are equivalent, you can use any of the appropriate ones.
In this case, your language is defined by a regular expression. If that's your definition of regular languages, you're already done.
Our reference question has more information.
add a comment |
up vote
18
down vote
You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) might have defined them as any of
- languages described by regular expressions;
- languages accepted by deterministic finite automata (DFAs);
- languages accepted by nondeterministic finite automata (NFAs).
If, additionally, you've proven that some or all of these definitions are equivalent, you can use any of the appropriate ones.
In this case, your language is defined by a regular expression. If that's your definition of regular languages, you're already done.
Our reference question has more information.
add a comment |
up vote
18
down vote
up vote
18
down vote
You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) might have defined them as any of
- languages described by regular expressions;
- languages accepted by deterministic finite automata (DFAs);
- languages accepted by nondeterministic finite automata (NFAs).
If, additionally, you've proven that some or all of these definitions are equivalent, you can use any of the appropriate ones.
In this case, your language is defined by a regular expression. If that's your definition of regular languages, you're already done.
Our reference question has more information.
You can't. The pumping lemma can only be used to prove that a language is non-regular. How to prove that it is regular depends on how you've defined regular languages. You (or your course or textbook) might have defined them as any of
- languages described by regular expressions;
- languages accepted by deterministic finite automata (DFAs);
- languages accepted by nondeterministic finite automata (NFAs).
If, additionally, you've proven that some or all of these definitions are equivalent, you can use any of the appropriate ones.
In this case, your language is defined by a regular expression. If that's your definition of regular languages, you're already done.
Our reference question has more information.
answered Aug 23 at 14:45
David Richerby
65k1597186
65k1597186
add a comment |
add a comment |
up vote
3
down vote
You already got your answer, this is just to make it clear that the problem you are facing is actually a logical one.
The pumping lemma is an implication: „If $L$ is regular then XYZ“. It states a necessary condition for a language to be regular (not a sufficient one). Note how the implication does not say anything about what happens if XYZ is true.
BUT you can use the contraposition of the implication, i.e. „if XYZ is not true“ to prove that a language is not regular (because we know that all regular languages do satisfy XYZ)
As already noted by the others you can show that $L$ is regular by showing that you can generate $L$ while adhering to whatever rules you have defined as being valid for regular languages (e.g. can be generated by a DFA, regular grammar, etc.). Note how OTOH you can‘t use this to show that some language is not regular, since you would need to show that no such DFA exists - but how can you know that it really doesn‘t exist and it is not simply your disability to find it? Well, here is where you can use the pumping lemma.
add a comment |
up vote
3
down vote
You already got your answer, this is just to make it clear that the problem you are facing is actually a logical one.
The pumping lemma is an implication: „If $L$ is regular then XYZ“. It states a necessary condition for a language to be regular (not a sufficient one). Note how the implication does not say anything about what happens if XYZ is true.
BUT you can use the contraposition of the implication, i.e. „if XYZ is not true“ to prove that a language is not regular (because we know that all regular languages do satisfy XYZ)
As already noted by the others you can show that $L$ is regular by showing that you can generate $L$ while adhering to whatever rules you have defined as being valid for regular languages (e.g. can be generated by a DFA, regular grammar, etc.). Note how OTOH you can‘t use this to show that some language is not regular, since you would need to show that no such DFA exists - but how can you know that it really doesn‘t exist and it is not simply your disability to find it? Well, here is where you can use the pumping lemma.
add a comment |
up vote
3
down vote
up vote
3
down vote
You already got your answer, this is just to make it clear that the problem you are facing is actually a logical one.
The pumping lemma is an implication: „If $L$ is regular then XYZ“. It states a necessary condition for a language to be regular (not a sufficient one). Note how the implication does not say anything about what happens if XYZ is true.
BUT you can use the contraposition of the implication, i.e. „if XYZ is not true“ to prove that a language is not regular (because we know that all regular languages do satisfy XYZ)
As already noted by the others you can show that $L$ is regular by showing that you can generate $L$ while adhering to whatever rules you have defined as being valid for regular languages (e.g. can be generated by a DFA, regular grammar, etc.). Note how OTOH you can‘t use this to show that some language is not regular, since you would need to show that no such DFA exists - but how can you know that it really doesn‘t exist and it is not simply your disability to find it? Well, here is where you can use the pumping lemma.
You already got your answer, this is just to make it clear that the problem you are facing is actually a logical one.
The pumping lemma is an implication: „If $L$ is regular then XYZ“. It states a necessary condition for a language to be regular (not a sufficient one). Note how the implication does not say anything about what happens if XYZ is true.
BUT you can use the contraposition of the implication, i.e. „if XYZ is not true“ to prove that a language is not regular (because we know that all regular languages do satisfy XYZ)
As already noted by the others you can show that $L$ is regular by showing that you can generate $L$ while adhering to whatever rules you have defined as being valid for regular languages (e.g. can be generated by a DFA, regular grammar, etc.). Note how OTOH you can‘t use this to show that some language is not regular, since you would need to show that no such DFA exists - but how can you know that it really doesn‘t exist and it is not simply your disability to find it? Well, here is where you can use the pumping lemma.
edited Aug 25 at 18:58
answered Aug 24 at 19:33
dingalapadum
1613
1613
add a comment |
add a comment |
Thanks for contributing an answer to Computer Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96551%2fhow-to-prove-using-pumping-lemma-that-language-generated-by-abcde-is-regul%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
15
You cannot use the pumping lemma to prove that a language is regular, since some non-regular languages also satisfy it.
– Yuval Filmus
Aug 23 at 14:33
1
Similar to Is
a*b*
regular?– Grijesh Chauhan
Aug 24 at 7:44
The language described by a regular expression is, by definition, a regular language. Either that, or you want to prove that your regular expression is equivalent to some (non)deterministic finite automata.
– chepner
Aug 24 at 19:29