Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE CS Mock 2018 | Set 2 | Question 26

  • Last Updated : 08 Mar, 2018

Which of following statement(s) is/are not correct?
(I) Languages generated by the grammar S→aSa ∣ aa is not regular.
(II) Languages generated by the grammar S→aSb ∣ aa is not regular.
(III) Languages generated by the grammar S→S1|S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ is {a^nb^mc^k | k = |n – m|, n≥0, m≥0, k≥0}.
(IV) Languages generated by the grammar S→S1S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ is {a^nb^mc^k | k = |n – m|, n≥0, m≥0, k≥0}.

(A) Only (II), (IV)
(B) Only (I), (III), (IV)
(C) Only (I), (II), (III)
(D) All of the above


Answer: (B)

Explanation: (I) Grammar S→aSa ∣ aa generates langausge (aa)+ which is regular.
(II) Grammar S→aSb ∣ aa generates langausge a^n(aa)b^n which is not regular.
(III) Production rule of S3 doesn’t follow Language L, as it generates at least one word which is not in L: abcb.
(IV) Grammar generates the word acab which is not in L

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

Therefore, only statements (I), (III), (IV) are not correct.
Option (B) is correct.


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!