...
Database-Management-System
November 27, 2023
Database-Management-System
November 27, 2023
Database-Management-System
November 27, 2023
Database-Management-System
November 27, 2023

UGC-NET DEC-2019 Part-2

Question 21
Consider the following grammar :
S→0A|0BB
A→00A| λ
B→1B|11C
C→B

Which language does this grammar generate?

A
L(00) * 0+(11)*1)
B
L(0(11)* + 1(00)*)
C
L((00)*0)
D
L(0(11) *1)
Question 21 Explanation: 
Option 1 is incorrect because every string generated by given grammar will contain only 0’s and given option is generating string containing 1’s also.
Option 2 is incorrect because it can’t generate “000”.
Option 3 is correct because it generates string same as given grammar do.
Option 4 is incorrect because every string generated by given grammar will contain only 0’s and given option is generating string containing 1’s also.
Correct Answer: C
Question 21 Explanation: 
Option 1 is incorrect because every string generated by given grammar will contain only 0’s and given option is generating string containing 1’s also.
Option 2 is incorrect because it can’t generate “000”.
Option 3 is correct because it generates string same as given grammar do.
Option 4 is incorrect because every string generated by given grammar will contain only 0’s and given option is generating string containing 1’s also.

Leave a Reply

Your email address will not be published. Required fields are marked *