Professional Documents
Culture Documents
Assignment 2014
Assignment 2014
Question 2: Let L be the language with alphabet {0, 1, 2} consisting of strings that don’t have any three
consecutive 0, any three consecutive 1 or any three consecutive 2. Prove that L is regular.
Question 3: Find the grammar for if, if….else, if..elseif…else statement .Derive a valid string from the
grammar using leftmost derivation and rightmost derivation.
Question 4: (a) Explain deterministic and nondeterministic PDA. Also explain the acceptance methods
with an example.
(b) Design the PDA to recognize balancing of parenthesis. Also write the grammar. Simulate the working
of PDA with an example.