DOC PREVIEW
UT CS 341 - CS 341 Midtern Review

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS341 Automata TheoryMidterm 2 ReviewCovered topics include:All material on CFLs: CFGs, PDAs, Chomsky Normal Form, ambiguity of a grammar,closure properties of a CFL,decision procedures for CFLs, pumping lemma for CFLs,conversion of a CFG to a PDA.TMs: definition of semi-decidable/decidable languages, configurations o f a TM, definingrecognizers a nd deciders, defining TM that computes a function on integers.1. For each of the following languages, state whether the language is (I) regular, (II)context-free but not regular, or (III) not context-free. Prove your answer.(a) {0n02n03n|n ≥ 0}(b) {xwxR|x, w ∈ {0, 1}+}(c) {xyz|x, y, z ∈ {0, 1}∗, |x| = |z| > 0 and #0(x) ≥ #0(z)}(d) {1n2|n ≥ 0}(e) L(11(01 ∪ 0)∗(01 ∪ 0) ∪ 10)(f) {w#wR|w ∈ {a, b}∗}(g) {w|w ∈ {a, b}∗, w 6= wR}(h) {aibjck|i < j → k < j}2. Prove that the context-free languages are closed under union and concatenation. (Don’tcopy your class notes - this should be g ood practice for proving a closure pro perty onthe exam).3. Suppose L1, L2are context-free languages. Is it necessarily true that L1−L2is cont ext-free? Prove your answer.4. Convert the following grammar to Chomsky Normal Form. S → A|BA → aA|aCB → bB|bCC → pqrWW → T VT → t|epsilon5. Show that the following CFG is ambiguous:E → E + E|E − E|ExE|(E)|a|b.6. For CFG G and string w, give an algorithm to decide if w ∈ L(G).7. Define a PDA that recognizes {0nw1m|w ∈ {0, 1}∗, #0(w) = #1(w) and m ≥ n}.18. Define a CFG for L = {anbm|n 6= m}.9. Define a recognizer for:(a) L = {anbmcm}(b) L = {w ∈ {0, 1}∗|#0(w) = 2 #1(w)}(c) L = {tat|t ∈ {b, c}∗}10. For the languages in the previous problem, are they: (I) regular, (II) context-free butnot regular, (III) semi-decidable but not context-free? Prove your


View Full Document

UT CS 341 - CS 341 Midtern Review

Documents in this Course
Load more
Download CS 341 Midtern Review
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 341 Midtern Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 341 Midtern Review 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?