Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE-CS-2004 | Question 87

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

The language {am bn Cm+n | m, n ≥ 1} is

(A) regular
(B) context-free but not regular
(C) context sensitive but not context free
(D) type-0 but not context sensitive


Answer: (B)

Explanation:
We construct a PDA for the given language.

PUSH Z0 in the stack initially.
PUSH X in the stack for each occurrence of ‘a’ .
PUSH Y in the stack for each occurrence of ‘b’.
POP X and Y from the stack for each occurrence of ‘c’.

If after popping all X and Y from the stack , no input element is left in the string and we get Z0 on the top of the stack then the string is accepted.

 
Thus, option (B) is correct.

 
Please comment below if you find anything wrong in the above post.


Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!