Question 13006 – Data-Structures
December 6, 2023Question 1585 – Nielit Scientist-B IT 22-07-2017
December 6, 2023Question 8119 – Regular-Language
Language L1 is defined by the grammar: S1 → aS1b|ε
Language L2 is defined by the grammar: S2 → abS2|ε
Consider the following statements:
P: L1is regular
Q: L2is regular
Which one of the following is TRUE?
Correct Answer: C
Question 15 Explanation:
The language L1 generated by the grammar contains equal number of a’s and b’s, but b’s comes after a’s.
So, in order to compare equality between a’s and b’s memory (stack) is required.
Hence, L1 is not regular.
Moreover, L1 = {an bn | n ≥ 0} which is DCFL.
The language L2 generated by grammar contains repetition of “ab” i.e. L2 = (ab)* which is clearly a regular language.
So, in order to compare equality between a’s and b’s memory (stack) is required.
Hence, L1 is not regular.
Moreover, L1 = {an bn | n ≥ 0} which is DCFL.
The language L2 generated by grammar contains repetition of “ab” i.e. L2 = (ab)* which is clearly a regular language.
Both P and Q are true
P is true and Q is false
P is false and Q is true
Both P and Q are false
Subscribe
Login
0 Comments