{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm-sol

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

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

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 won’t be this long and will have a little more emphasize on decidability. Problem 1. [20 points] Decide if the following statements about languages over { 0 , 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 = { 0 n 1 n | n 0 } 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.

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

View Full Document
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). Solution: Consider the following homomorphism: h ( a ) = a, h ( b ) = b, h ( c ) = b . The image of L is h ( L ) = { a n b n | n 1 } which is non-regular. Therefore L has to be non-regular.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern