0

I was doing this grammar.

The language $L = \{ a^nb^mc^n \mid n,m \geqslant 0 \}$

I wanted to know if it is correct or not.

This is my solution

$S \to aSc\mid B \mid e$

$B \to bB \mid e$

J.-E. Pin
  • 40,163

1 Answers1

0

Your grammar is correct. You could save one rule if you wish:

$S \to aSc + B$

$B \to bB + e$

J.-E. Pin
  • 40,163