TransWikia.com

Proof that $L={a^ncb^n| n in mathbb{N}}$ is not regular

Computer Science Asked on December 14, 2021

Prove that $L={a^ncb^n| n in mathbb{N}}$ is not regular.

Here is my try, I would really appreciate if someone could tell me if this is a correct proof.

Proof:
Lets assume L is regular. Then we know that L must meet the requirements of the pumping lemma.
So let p the pumping number.

Let $w=a^pcb^p$. $w$ is obviously of the length p and is in L. Therefore it should be possible to split w into three pieces xyz such that $|y|>0,|xy|leq p,xy^iz$ is in L $forall i in N$.
Because $|xy|leq p$ $y $ can only contain the symbol $a$(If $y$ would contain a symbol different from a it would imply that $|xy|>p$, which is not possible). Therefore $y$ must be in the form $y=a^{p-k},0leq k<p$. So the word w equals $w=a^ka^{p-k}cb^p$, if we set i=2 we get $a^ka^{2p-2k}=a^{2p-k},k<p$ and because $ a^{2p-k},k<pneq b^p$ it follows that the pumped $w$ is not in $L$. Which is a contradiction. Therefore $L$ is not regular.

$tag*{$blacksquare$}$

2 Answers

Proof: Lets assume L is regular. Then we know that L must meet the requirements of the pumping lemma. So let p the pumping number.

Let $w=a^pcb^p$. $w$ is obviously of the length p and is in L. Therefore it should be possible to split w into three pieces xyz such that $|y|>0,|xy|leq p,xy^iz$ is in L $forall i in N$. Because $|xy|leq p$ $y $ can only contain the symbol $a$(If $y$ would contain a symbol different from a it would imply that $|xy|>p$, which is not possible). Therefore $y$ must be in the form $y=a^{p-k},0leq k<p$. So the word w equals $w=a^ka^{p-k}cb^p$, if we set i=2 we get $a^ka^{2p-2k}=a^{2p-k},0<=k<p$ and because $ a^{2p-k}neq b^p$ it follows that the pumped $w$ is not in $L$. Which is a contradiction. Therefore $L$ is not regular.

$tag*{$blacksquare$}$

Answered by Frank on December 14, 2021

Assume the language is regular, therefore has a finite state machine. Since the state machine is finite, there are n ≠ m such that $a^nc$ and $a^mc$ arrive in the same state. Therefore $a^nca^n$ and $a^mca^n$ arrive in the same state. But one is in the language, so that state must be accepting, and one is not in the language, so that same state must be non-accepting.

Answered by gnasher729 on December 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP