Worksheet-pda - push down automata practice problems PDF

Title Worksheet-pda - push down automata practice problems
Author Leena Hai Ha Nguyen
Course Introduction to Theoretical Computer Science
Institution Concordia University
Pages 1
File Size 41.8 KB
File Type PDF
Total Downloads 93
Total Views 132

Summary

push down automata practice problems...


Description

COMP 335 Section E Worksheet 5: Push-Down Automata October 16, 2018 1. Let Σ = {a, b}. Find non-deterministic push-down automata for the following languages: (a) {an b2n | n ≥ 0} (b) {wcwR | w ∈ (a + b)∗ } (c) {wwR | w ∈ (a + b)∗ } (d) {an bm cn+m | n, m ≥ 1} (e) {an bn+m cm | n, m ≥ 1} (f) {an bm | n 6= m} (g) {an bm | n 6= 2m} (h) {an bm | n ≤ m ≤ 3n} (i) {w ∈ (a + b)∗ | na (w) 6= nb (w)} (j) {w ∈ (a + b + c)∗ | na (w) + nb (w) = nc (w)} (k) {w1 cw2 | w1 , w2 ∈ (a + b)∗ , w1 6= wR 2 } (l) {uvwvR | |u| = |w| = 3, u, v, w ∈ (a + b)∗ } (m) {an bm ck | k = |n − m|} 2. Using the CFG-to-NPDA construction, construct an npda that accepts the language generated by the grammar below: S → aABBB | aAA A → aBB | a B → bBB | A 3. Given an NPDA M = {Q, Σ, Γ, δ, q0 , z, F ), let N (M ) = {w ∈ Σ∗ : (q0 , w, z) ⊢∗ (p, λ, λ)} be defined as the language M accepts by empty stack. Show that for every npda M ′ , there exists an npda M such that L(M ′ ) = N (M ). 4. For each of the following languages, say whether or not it is a deterministic cfl: (a) {an bn : n ≥ 1} (b) {an b2n : n ≥ 0} (c) {an bm : n = m or n = 2m} (d) {wwR : w ∈ (a + b)∗ }

1...


Similar Free PDFs