[Math] Using Pumping Lemma prove that the language $L = \{a^ib^j \mid i,j \in N \}$ is Not Regular.

computer sciencepumping-lemmaregular-language

Using Pumping Lemma prove that the language $L = \{a^ib^j \mid i,j \in N \}$ is Not Regular.

Proof:

Assume that $L$ is Regular.
Pumping Length = $P$.
We choose $w = a^{P-2}b^{P+2} \in L$

We divide $w$ in $xyz$.
$x= a, y = a^{P-3}bb, z = b^P$

Now we Pump with $i = 2$. $xy^iz = xy^2z$ = $aa^{P-3}bba^{P-3}bbb^P$ = $a^{P-2}bba^{P-3}b^{P+2} \notin L$. QED

Did I do it right?

Best Answer

Let's suppose that $w$ is regular.

We can take the string $s = a^ib^i$. Like s $\in w$ and $|s| \ge p$, the pumping lemma states that we can separate $s$ in 3 parts that are: $xyz$. With $n \gt 0, xy^iz \in w$. Because one of the lemma condition says that $|xy| \le p$, $y$ must consist only of $0s$ otherwise $|xy| \ge p$.

If we take the string $xyyz$ (which is supposed to be regular), we notice that we have more $0s$ than $1s$. So it's a contradiction.

Related Question