This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: MATH 239 ASSIGNMENT 4 Sample Solutions 1. 12 marks For each of the following sets, write down a decomposition that uniquely creates the elements of that set. (a) The { , 1 }strings that have no substring of 1s with length 3, and no substrings of 0s of length 2. Solution: Since we want to modify both the allowed lengths of strings of 1 and strings of 0s, let us start with the block decomposition { } * ( { 1 }{ 1 } * { }{ } * ) * { 1 } * = { ², , 00 ,... } ( { 1 , 11 , 111 ,... }{ , 00 , 000 ,..., } ) * { ², 1 , 11 , 111 ,... } and remove all strings of 1s of length 3 or more, and remove all strings of 0s of length 2 or more. This leaves us with { ², } ( { 1 , 11 }{ } ) * { ², 1 , 11 } . One could also have started with the other block decomposition and arrived at { ², 1 , 11 } ( { }{ 1 , 11 } ) * { ², . (b) The { , 1 }strings that have no blocks of 0s of size 2, and no blocks of 1s of size 3. Solution: Since we want to modify both the allowed lengths of blocks of 1 and blocks of 0s, let us start with the block decomposition { } * ( { 1 }{ 1 } * { }{ } * ) * { 1 } * = { ², , 00 ,... } ( { 1 , 11 , 111 ,... }{ , 00 , 000 ,..., } ) * { ², 1 , 11 , 111 ,... } and remove all the blocks of 1s of length 3, and remove all blocks of 0s of length 2. This leaves us with { ², , 000 ,... } ( { 1 , 11 , 1111 ,... }{ , 000 ,..., } ) * { ², 1 , 11 , 1111 ,... } which can also be rewritten more compactly as ( { } * \{ 00 } )(( { 1 }{ 1 } * \{ 111 } )( { }{ } * \{ 00 } )) * ( { 1 } * \{ 111 } ) . A similar solution is possible starting with the other block decomposition. (c) The set of { , 1 }strings in which the substring 0111 does not occur. Solution: We start with the block decomposition where in the middle section the 0blocks precede the 1blocks (i.e. { 1 } * ( { }{ } * { 1 }{ 1 } * ) * { } * ) and omit the 1blocks of length 3 or more. This gives us { 1 } * ( { }{ } * { 1 , 11 } ) * { } * . Alternatively, we could start with the 0decomposition and remove all strings of 1s of length 3 or more that follow a 0. This gives us { 1 } * ( { }{ ², 1 , 11 } ) * . 1 (d) The set of { , 1 }strings in which the substring 0110 does not occur....
View
Full
Document
This note was uploaded on 08/09/2009 for the course MATH 239 taught by Professor M.pei during the Spring '09 term at Waterloo.
 Spring '09
 M.PEI
 Combinatorics, Sets

Click to edit the document details