quiz2-solutions-Spring-2007

quiz2-solutions-Spring-2007 - CS 360: Introduction to the...

Info iconThis preview shows pages 1–2. 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 360: Introduction to the Theory of Computing John Watrous, University of Waterloo Solutions to Quiz 2 1. Consider the following language: Middle = { w { , 1 } * : the length of w is odd, and its middle symbol is 1 } . For example, the strings 1 , 011 , and 1101000 are contained in Middle , while 001 , 1111 , and are not. Use the Pumping Lemma (for regular languages) to prove that Middle is not regular. Solution. Assume toward contradiction that Middle is regular. Then by the Pumping Lemma there exists a pumping length n 1 for Middle , such that, for every w Middle with | w | n , it is possible to write w = xyz for strings x,y,z { , 1 } * satisfying 1. y negationslash = , 2. | xy | n , and 3. xy i z Middle for all i . Let w = 0 n 10 n . Then w Middle and | w | = 2 n + 1 > n , so it is possible to write n 10 n = xyz for strings x , y , and z as above. As | xy | n it must be that y only includes 0s from w that come before the middle 1. Given that y negationslash = , we must therefore have that...
View Full Document

Page1 / 3

quiz2-solutions-Spring-2007 - CS 360: Introduction to the...

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

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