midterm-sol

midterm-sol - CS 154 - Introduction to Automata and...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 154 - Introduction to Automata and Complexity Theory Solutions to Sample Midterm The questions below are from previous exams in CS154. They should give you some idea of what kinds of questions to expect and what we want for solutions. The actual midterm wont be this long and will have a little more emphasize on decidability. Problem 1. [20 points] Decide if the following statements about languages over { , 1 } are TRUE or FALSE, and circle the right answer using the boxes provided on the side. You must also give a brief explanation of your answer to receive full credit. F (a). If a DFA M has a loop then the language L ( M ) is infinite. FALSE The loop might not be reachable from the initial state, or might not be possible to reach a final state from it. F (b). There is a regular language L for which there is exactly one regular expression R with L ( R ) = L . FALSE For every regular expression R , R + R accepts the same language. F (c). Let L be a language and h a homomorphism. If h ( L ) is regular, then L must be regular. FALSE Consider L = { n 1 n | n } and the homomorphism h (0) = , h (1) = . T (d). Let L be a regular language, and L R its reverse. The language L L R is regular. TRUE If L is regular then so is L R (to see this consider a DFA for L , reverse all transitions, add a new initial state with an -transition to all previous final states, and make the previous intial state final.) The concatenation of two regular languages is another regular. Problem 2. [30 points] a). [15 points] Consider the following language over the alphabet = { a, b, c } . L = { a n b p ( c + b ) n- p | 1 n and 1 p n } . Here, ( c + b ) n- p means a sequence of n p symbols from the set { c, b } . Show that L is non-regular using closure properties. Do not use the pumping lemma, but you can use any language proven in the book to be non-regular (or regular)....
View Full Document

This note was uploaded on 01/12/2010 for the course CS 154 at Stanford.

Page1 / 6

midterm-sol - CS 154 - Introduction to Automata and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online