At first I thought the language would be context sensitive because it seems that it can be shown with the pumping lemma for regular languages, that it's not a regular language and analogously with the pumping lemma for context free languages, that it is not context free. But it upon further pondering I came up with a pushdown automaton that would match this language. So I'm a bit at loss as to what type of language it is. I hope someone can help.
Asked
Active
Viewed 159 times
2 Answers
1
The language is context-free. You can use the pumping lemma for regular languages to show that it is not regular. However, you can construct a context-free grammar to show that the language is context free. For example, the following CFG grammar would generate it
$S \to A\ |\ aS $
$A \to \epsilon\ |b A cc $
0
If the language required twice as many c's as a's, the equivalent grammar should look like
S -> aScc | bB | epsilon
B -> bB | epsilon
Mathmon
- 1
- 1