Assignment 3 4
Assignment 3 4
1
Assignment - 3 - Push Down Automata
1. Construct a PDA to accept the language L = {an bn cm dm |n, m ≥ 1}, (i) by empty stack, and (ii)
by final state.
2. Construct a PDA to accept the language L = {an b2n |n ≥ 1}, (i) by empty stack, and (ii) by final
state.
3. Construct a PDA and DPDA for the language L = {an bn+m cm |n ≥ 0, m ≥ 1}.
(a) {S → aAB|bBA, A → bS|a, B → aS|b}. Show the derivation for the string abbaaabbbbab.
(b) {S → aB, B → bA|b, A → aB}. Find the ID for the string abab.
5. Construct a CFG for the PDA M = (Q, Σ, Γ, q0 , Z0 , δ, {q2 }) where Q = {q0 , q1 , q2 }, Σ = {a, b},
Γ = {a, b, Z0 } and δ is given by:=
δ(q0 , a, Z0 ) = {(q1 , aZ0 )}
δ(q0 , b, Z0 ) = {(q1 , bZ0 )}
δ(q1 , a, a) = {(q1 , a), (q2 , a)}
δ(q1 , b, a) = {(q1 , a)}
δ(q1 , a, b) = {(q1 , b)}
δ(q1 , b, b) = {(q1 , b), (q2 , b)}.
6. Construct a CFG for the language of the palindromes whose PDA accepts by empty stack.
7. For the PDA of language of palindromes draw the computation tree showing all possible sequence
of moves for the three input strings aabab, aba and abaaba.
8. Show that every regular language can be accepted by a deterministic PDA with only two states
in which there are no -transitions and no symbols are ever removed from the stack.
9. Show that if L is accepted by a PDA in which no symbols are ever removed from the stack, then
L is regular.
10. Suppose M1 and M2 are PDA’s accepting the languages L1 and L2 . Describe a procedure for
constructing a PDA accepting the following languages.
(a) L1 ∪ L2 ,
(b) L1 .L2 , and
(c) L∗1 .
Precisely describe how the stack of the machine works. No relationship is assumed between the
stack alphabets of M1 and M2 .
11. Show by using Pumping Lemma, the following languages are not CFL.