Obtain a grammar for the language
- $L = \{a^m b^n \mid m ≠ n , m > 0 , n > 0 \}$.
Please help me with the solution.
Obtain a grammar for the language
Please help me with the solution.
Hint:
I hope this helps $\ddot\smile$
Am I right in assuming this is homework? If so, please use the homework-tag.
Since $m\neq n$, there are two situations: $m > n$ or $m < n$. Each case can be treated seperately. In the first case, each word must contain $aab$, since $m,n>0$. So start with the string $aab$, and in each step add either both an $a$ and a $b$, or just add an $a$. This information is all you need, so try writing the productions by yourself.