3,171 views
0 votes
0 votes
S->aSb { S.c=S.c+2 }

S->bSa { S.c=S.c+2 }

S->epsilon {S.c=0 }

 

1. Equal no of a's and b's .

2. No of a's or no of b's in a given string .

3. No of a's and no of b's in a given string ..

4. None of these .

 

According to me , it should be total no of a's and no of b's .

3 Answers

Best answer
3 votes
3 votes

Option d) none of these

  • String baab is not genrated in given grammer so option a is false.
  • Given Grammer is produced null string.So there is no number of a's and number of b's is present . So both option c and d is false.
selected by
0 votes
0 votes

S.c = no. of terminals in a string generated by S. S generates (a|b)* followed by its complement (i.e., flip each character from reverse), So, 'in a given string' is absolutely Incorrect. Therefore, Ans = (D)

Related questions

0 votes
0 votes
3 answers
2
0 votes
0 votes
2 answers
3
Subhadeeppathak asked Nov 28, 2022
458 views
Attributes are said to be of two type, synthesised and inherited. What actually is an attribute? Why an attribute exist, how to define it?