could someone please help me define grammar for given language (or help me to improve mine): $L = \{a^{n}b^{*}c^{2n+1} | n >= 1\}$
this is what I have so far, but it is not correct: $$S → aSc$$ $$S → BC$$ $$B → bB$$ $$B → ε$$ $$C → cC$$ $$C → ε$$
could someone please help me define grammar for given language (or help me to improve mine): $L = \{a^{n}b^{*}c^{2n+1} | n >= 1\}$
this is what I have so far, but it is not correct: $$S → aSc$$ $$S → BC$$ $$B → bB$$ $$B → ε$$ $$C → cC$$ $$C → ε$$
How about:
$S \rightarrow Ac$
$A \rightarrow aBc^2$
$B \rightarrow aBc^2$
$B \rightarrow \epsilon$
$B \rightarrow Cb$
$C \rightarrow Cb$
$C \rightarrow \epsilon$