Proving that the language $\{w\in \{a,b\}^* \big|\#_a(w)< \#_b (w)\}$ is non regular using the pumping lemma

494 Views Asked by At

I need to prove that the language $\mathscr L=\{w\in \{a,b\}^* \big|\#_a(w)< \#_b (w)\}$ is non regular using the pumping lemma

My try:

$\{a,b\}^*=\{\epsilon,a,b,aa,ab,ba,bb,aaa,aab,\dots\}$

Suppose that $\mathscr L$ is regular so $\exists$ a word '$x$' with length of at least $n$

$|x|\geq n $ such that

$(1)\,\,\,|uv|\leq n$

$(2)\,\,\,|v|\geq 1$

$(3)\,\,\,uv^iw \in \mathscr L$

Now let as choose the word $\color{blue}{x=b^na^k}$ such that $n>k$ and also $|x|\geq n$ so we can use $(1)-(3)$

$(1):$

$x=\underbrace{bbbbbbbb\dots}_{\text{n times}}\underbrace{aaa\dots}_{\text{k times}}$

$uv$ will contain only '$b$' therfore $u=b^{\psi},\,\,\,v=b^{\varphi}$

$(2):$

$\psi \geq 0,\,\,\,\,1\leq \varphi \leq n$

$(3):$

Let as choose $\color{blue}{i=??}$ so $uv^iw=b^{\psi}(b^{\varphi})^{n+1}w\in \mathscr L$

I'm difficult choosing the word '$\color{blue}x$' and choosing $\color{blue}i$ to come to contradiction with the lemma

1

There are 1 best solutions below

6
On BEST ANSWER

Remember here that the pumping lemma works downwards as well as upwards. The string $b^n a^k$ is of the form $u v b^r a^k$ where $r \geq 0$; the pumping lemma lets us deduce that $u b^r a^k$ is also in the language.

So you just need to pick $k=n-1$, and you get a contradiction straight away.