LanguageL1isdefinedbythegrammar: S1→aS1b|ε LanguageL2isdefinedbythegrammar: S2→abS2|ε ConsiderthefollowingisTRUE? P:L1isregular Q:L2isregular Which one of the following is TRUE?
A
Both P and Q are false
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
P is true and Q is false
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
P is false and Q is true
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
Both P and Q are true
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is C P is false and Q is true G1:S1→aS1b|ε G2:S2→abS2|ε L1=L(G1)={anbn|n≥0} L2=L(G2)={(ab)n|n≥0}=(ab)∗ ClearlyL1isregularisFALSEandL2isregularisTRUE So correct answer is (c).