Let the language $K$ be the languages of words $\{a,b\}^*$ where at least the $1/3$ of the letters are $a's$
In other words: $$K = \{w\ part \ of\ \{a,b\}^* : (numbers\ of\ a\ in\ w)\ \geq |w|/3\}$$
Example :
ababbabb is valid. aabbbbb is not valid.
So i start my proof, i assume K is regular so a length of $$P > 0$$ exist. Where all words w can be pumped if $$|w| \geq P$$.
To confirm the line above, i need to find a $w$ which is in $K$ and is at least of length P.
My problem is that i am stuck there, i need to find a $w$ expressed in terms of $P$ but i am struggling. It seems less easy than a proof where u have something like : $a^nb^n$ where you can just say $a^pb^p$ (unless i just don't click.)
I really struggle with the pumping lemma so if someone could explain me how they think to solve a problem like that it would be greatly appreciated. Thank you.
The trick here is to realize that you want to start with a word such that pumping it up will add $b$s but not $a$s: then you can pump it up to the point at which fewer than a third of its letters are $a$s.
Take $w=b^{2p}a^p$; a third of the the $3p$ letters in $w$ are $a$s, so $w\in K$. If $K$ were regular, we could break up $w$ as $w=xyz$, where $|xy|\le p$, $|y|\ge 1$, and $xy^kz\in K$ for every $k\ge 0$. Since $|xy|\le p$, $xy$ is contained entirely within the first $p$ letters of $w$, so it consists entirely of $b$s: there are $r$ and $s$ such that $x=b^r$, $y=b^s$, $r+s\le p$, and $s\ge 1$. And $z$ is the rest of $w$, so $z=b^{2p-r-s}a^p$. Thus, for any $k\ge 0$ we have
$$xy^kz=b^r(b^s)^kb^{2p-r-s}a^p=b^{r+ks+2p-r-s}a^p\,.$$
In particular, if $k=2$, we have
$$xy^2z=b^{r+2s+2p-r-s}a^p=b^{2p+s}a^p\,.$$
Thus, $|xy^2z|=3p+s>3p$, since $s\ge 1$, but $a$ occurs only $p$ times in $xy^2z$, so fewer than a third of the letters in $xy^2z$ are $a$s, and therefore $xy^2z\notin K$. This would be impossible if $K$ were regular, so $K$ is not regular.