Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A doubt with question:

What is the grammar that generates the language quoted in the description? $$a^nb^{n+m}c^m\text{ for }n≥0, m≥0$$

I don't understand this.

share|cite|improve this question
Do you know what a grammar is, and what a language is ? – Denis Sep 10 '13 at 23:58

The goal is to find a grammar with rules that generate all the words of the form you describe, one example of theses words is $aabbbbbccc$ for $n=2$ and $m=5$.

The following grammar works, with initial symbol $S$ and variables $A,B$:

$\begin{array}{l} S\to AB\\ A\to aAb\\ A\to\epsilon\\ B\to bBc\\ B\to\epsilon \end{array}$

Where $\epsilon$ is the empty word.

For instance to obtain the word above, you can do $S\to AB\to aAbB\to aaAbbB\to aabbB\to aabbbCc\to aabbbbCcc \to aabbbbbCccc \to aabbbbbccc$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.