wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

What is the language accepted by the following grammer?

S AB|BA| A |B

AaAa|aAb|bAa|bAb|a

BaBa|aBb|bBa|bBb|b

A
{w|w{a,b}+}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
{w| w is not of form xx, where x {a,b}+}
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
{w | w is form xx or w is an odd length string, when x string x}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
{w | w is a palindrome}
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B {w| w is not of form xx, where x {a,b}+}
The a simple string i.e., generated by the grammer. Let and check if xx is generated by the grammar. The answer if any string say for "x" generated by the grammer to grammer

Hence, option (c) is correct answer.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Construction of CFG Part - 2
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon