Answer the question
In order to leave comments, you need to log in
How to build such a grammar?
It is required to construct a grammar generating the language
L = {2*2-1,2*2*2-1-1,2*2*2*2-1-1-1,....}, here there are one more twos than units, and there is at least one "-" sign, is it possible to convert this grammar to type 3?
My version was like this:
G = ( {S,A,B} , {2,*,1,-}, P, S } )
S -> A2B
A -> A2* | E
B -> -1B | E
I know that the option is wrong, because the minus may not appear + as I was told, we can apply rule B more times (compared to A, then there will be more units)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question