retagged by
1,213 views
12 votes
12 votes
Construct a context free grammar (CFG) to generate the following language:

$L = \{a^nb^mc^{n+m}: \text{n, m are integers, and } n \geq 1, m \geq 1 \}$
retagged by

1 Answer

Best answer
20 votes
20 votes

 Given Context free language is :

$L=\{ a^nb^mc^{n+m} : \text{ n,m are integers,} n \geq 1 m \geq 1\}$ .

For clarity given language can be interpreted  as

$L=\{ a^nb^mc^mc^n : \text{n,m are integers,} n \geq 1 m \geq 1\}$.

Now the given language is clearly DCFL .

And context free grammar (CFG) of the following language:

$S \to aSc \mid aAc$

$A \to bAc \mid bc$

edited by

Related questions

5 votes
5 votes
4 answers
1
go_editor asked May 30, 2016
1,790 views
Construct two nonregular languages $L_1$ and $L_2$ such that $L_1 \cup L_2$ is regular.Prove that the languages $L_1$ and $L_2$ constructed above are nonregular and $L_1 ...
4 votes
4 votes
3 answers
4