Winter 2009 Assignment4 Soln

Winter 2009 Assignment4 Soln - MATH 239 ASSIGNMENT 4 Sample...

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: 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 0-blocks precede the 1-blocks (i.e. { 1 } * ( { }{ } * { 1 }{ 1 } * ) * { } * ) and omit the 1-blocks of length 3 or more. This gives us { 1 } * ( { }{ } * { 1 , 11 } ) * { } * . Alternatively, we could start with the 0-decomposition 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

Page1 / 5

Winter 2009 Assignment4 Soln - MATH 239 ASSIGNMENT 4 Sample...

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