This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 360 Introduction to the Theory of Computing Spring 2008 Assignment 2 Solutions 1. Prove that the following languages are not regular: 1. A = { x { , 1 } * : the length of x is odd, and its middle symbol is 1 } Solution: We will use the pumping lemma to show A is nonregular. Assume A is regular. Then there exists a pumping length n 1 such that every string w A , with  w  n , can be written as w = xyz , where  xy  n ,  y  > , and xy i z A for all i . Let w = 0 n 10 n ,  w  = 2 n + 1 > n . Since w has odd length, and its middle symbol is 1, its in A . Then consider the decomposition of w as described in the pumping lemma: y is a nonempty susbstring of the first n characters of w . Since w starts with n zeroes, we are guaranteed that y = 0 k for some 1 k n . Then xy z = xz = 0 n k 10 n must be in A . However, n > n k (since k > ), and therefore, the middle symbol of the string is not 1 (or, if k = 1 , then the string is not of the odd length), so x / A ....
View
Full
Document
This note was uploaded on 09/22/2011 for the course CS 360 taught by Professor Johnwatrous during the Spring '08 term at Waterloo.
 Spring '08
 JohnWatrous

Click to edit the document details