Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Assignment 3 push down automata final
1. Assignment 3 (Pushdown Automata)
(i) Define PDA. Draw the graphical representation for PDA.
(ii) Compare PDA with FA.
(iii) Differentiate between Deterministic PDA and Non-Deterministic PDA. Illustrate with an
example of each.
(iv) What is Instantaneous Description in PDA?
(v) Convert the PDA P= ({p,q}, {0,1}, {x,z0}, δ, q,z0) where δ is given as follows:
δ (q,1,z0) = {(q, xz0)}
(vi) Design a PDA which accepts set of balanced paranthesis ( { { } } ).
(vii) Construct a PDA from the following CFG.
1. S → XS | ε , A → aXb | Ab | ab
2. S→ aAA, A→bS|aS|a , Also check whether the string abaaaa is in N(M) or not.
3. S→ aABB | aAA, A→ aBB | a , B→ bBB | A
4. Draw PDA for the CFG given: S→ aSb | a | b | ε
(viii) Obtain PDA to accept all strings generated by following languages:
1. L= {an
bm
cn
| n, m>=1}
2. L= {x ∈ {a,b}* | x has equal number of a’s and b’s.
3. L= {ai
bj
ck
|i=j or j=k}
4. L= {ai
bj
ck
|i≠j or j≠k} ≠
5. L= {wwr
| w ∈ (0,1)*}
6. L= {wcwr
| w ∈ (0,1)*}
7. L= {0n
1n
| n > 0}
8. L= {am
bm
cn
| n, m>=1}
(ix) Show that the language L = { an
bn
| n ≥ 1 } ᴜ { an
b2n
| n ≥ 1 } is a CFL that is not
accepted by DPDA.
(x) Construct a PDA by empty stack which accepts the following L= {am
bm
cn
| n, m>=1}.
Also convert this PDA to equivalent CFG.
(xi) Consider the given PDA:
PDA M= ({q0}, {0,1}, {a,b,z0}, δ, q0,z0, ϕ) where δ is defined as follows:
δ (q0,0,z0) = {(q0, az0)}
δ (q0,1,z0) = {(q0, bz0)}
δ (q0,0,a) = {(q0, aa)}
δ (q0,1,b) = {(q0, bb)}
δ (q0,0,b) = {(q0, ε )}
δ (q0,1,a) = {(q0, ε)}
δ (q0, ε , a) = {(q0, ε)}
Convert the given PDA M to the corresponding CFG.
(xii) Consider the given PDA:
PDA M= ({q0, q1, q2}, {a,b}, {A,z0}, δ, q0,Z0, ϕ) where δ is defined as follows:
δ (q0, a, Z0) = {(q0, AZ0)}
2. δ (q0, a, A) = {(q0, AA)}
δ (q0, b, A) = {(q1, A)}
δ (q1, a, A) = {(q1, ε)}
δ (q1, ε, Z0) = {(q2, ε)}
Convert the given PDA M to the corresponding CFG.
(xiii) Prove that the PDA that accepts strings through empty stack and final state mechanisms
are equivalent.