{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

final exam solutions

# final exam solutions - CS 360 nal exam questions from...

This preview shows pages 1–2. Sign up to view the full content.

CS 360 final exam questions from Spring 2007 The following questions appeared on the CS 360 final exam for Spring 2007. (The usual exam cover sheet, formatting, and point values have been removed.) 1. Define a language A ⊆ { 0, 1 } as follows: A = { w ∈ { 0, 1 } : w contains the substring 000, but does not contain the substring 0000 } . Give the state transition diagram of a DFA that recognizes A . 2. Consider the following NFA N : q 1 q 2 1 0 0, 1 (a) Give the state transition diagram of a DFA that recognizes the language L ( N ) . (b) Give an NFA with two states that recognizes L ( N ) . 3. Consider the following language over the alphabet { 0 } : B = { 0 n : either n is odd or n = 2 k for some integer k 1 } . Prove that B is not regular. 4. Let C be the following language: C = { x ∈ { 0, 1 } : x does not contain either of the substrings 011101 or 1100 } . Prove that C is a context-free language. 5. Prove that the following language over the alphabet { 0, 1, # } is context-free: braceleftBig x # y # z : x , y , z ∈ { 0, 1 } and parenleftBig x = y R or y = z R or z = x R parenrightBigbracerightBig .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}