Following context free grammar
S —> aB | bA
A —>b | aS | bAA
B —> b | bS | aBB
generates strings of terminals that have
A. | equal number of a's and b's |
B. | odd number of a's and odd number b's |
C. | even number of a's and even number of b's |
D. | odd number of a's and even number of a's |
Answer : A Explanation : manjureka said: (2:12pm on Friday 12th June 2015)
Option A also wrong..why because the string aB>abs>abbA>abbbAA>abbbbb it may confuse please give me the clear solution for me.....
TJ said: (5:48pm on Wednesday 7th October 2015)
the given answer is incorrect. and for the above answer A, grammer must be A->a|aS|bAA and for S and B same as above. then it will work.
anubhav said: (1:37am on Thursday 30th June 2016)
option A is wrong as this grammar is accepting "bb" in which no. of a's and b's are not equal...
mozhi said: (4:33pm on Thursday 4th May 2017)
Suppose we derive llike S —> bA
|
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |