Having the grammar G = (V,P,S) with variable V = {S,A} over the alphabet {a,b} with the rules:S->aA A->Sbb|bHow can i recognize which kind of grammar is this? I think that's not regular expression because in the second rule there are 2 letters (bb) instead of one, so i think it's a context free grammar. Am i right?
Which grammar is this?
regular languages;context free;regular expressions
Technically it is a linear grammar, where every production is of the form $A\to uBv$ where $A,B$ are variables, and $u,v$ are terminal strings. The linear languages are in between the regular and context-free languages. The power of these grammars is reduced because in every string (sentential from) derived there is (at most) one variable. They are more powerful than right-linear grammars because the terminal strings that are generated during the derivation can appear both left end right from the variable. An example of a linear language that is not regular is $\{a^nb^n \mid n\ge 1\}$.An example of a language that is context-free, but not linear, is $\{ w\in\{a,b\}^* \mid w \text{ contains the same number of $a$ and $b$}\}$.