Winter 2009 Midterm Soln

Winter 2009 Midterm Soln - 1. [5 marks] (a) Determine [x6...

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

View Full Document Right Arrow Icon
1. [5 marks] (a) Determine [ x 6 ] x 2 (1 + 3 x 2 ) - 2 . Solution: [ x 6 ] x 2 (1 + 3 x 2 ) - 2 = [ x 4 ](1 + 3 x 2 ) - 2 = [ x 4 ] X j =0 ± 2 + j - 1 2 - 1 3 j x 2 j = [ x 4 ] X j =0 ( j + 1)3 j x 2 j = 27 . (b) Prove that X even j ± n j 2 j = X odd j ± n j 2 j + ( - 1) n where the summations are over even and odd integers j satisfying 0 j n . (Hint: Consider (1 - 2 x ) n . ) Solution: By the binomial theorem, we know that (1 - 2 x ) n = n X j =0 ( - 2) j x j . Setting x = 1 gives ( - 1) n = n X j =0 ( - 2) j and moving the odd j values to the left hand side gives X odd j 2 j + ( - 1) n = X even j 2 j as required. 2. [4 marks] For each of the following sets, find a decomposition that uniquely creates the elements of that set. (a) The { 0 , 1 } -strings that have no blocks of 1s with length 3 or more, and no blocks of 0s of length 2. Solution: We can start with a block decomposition that creates all { 0 , 1 } -strings, { 1 } * ( { 0 }{ 0 } * { 1 }{ 1 } * ) * { 0 } * and modify it to exclude blocks of 1s with length 3 or more, and blocks of 0s of length 2. This gives us { ², 1 , 11 } ( { 0 , 000 , 0000 ,... }{ 1 , 11 } ) * { ², 0 , 000 , 0000 ,... } .
Background image of page 1

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

View Full DocumentRight Arrow Icon
(b) The set of { 0 , 1 } -strings in which the substring 01110 does not occur. Solution: We start with the block decomposition { 1 } * ( { 0 }{ 0 } * { 1 }{ 1 } * ) * { 0 } * . In the ( { 0 }{ 0 } * { 1 }{ 1 } * ) * part, we can only allow a 111 block if there are no 0’s following it. So we can write { 1 } * ( { 0 }{ 0 } * { 1 , 11 , 1111 , 11111 ,... } ) * ( { 0 }{ 0 } * { 111 } ∪ { 0 } * ) . Alternatively, we could start with the 0-decomposition and in the ( { 0 }{ 1 } * ) part omit the string 0111 unless it occurs at the very end of the string. This gives us { 1 } * ( { 0 }{ ², 1 , 11 , 1111 ,... } ) * ( { ² } ∪ { 0 }{ 111 } ) . 3. [11 marks] (a) For the following decomposition, prove that the strings are not uniquely created (by finding a string that can be created at least two different ways). { 0 } * ( { 10 , 1 }{ 00 , 01 } ) * { 1 } * Solution: e.g. 10 01 = 1 00 1 can be created in two different ways. (b) Let S = { 1 } * ( { 0 }{ 111 } * ) * . Prove that this decomposition creates the elements of S uniquely. Solution: A string σ with k zeroes must come from the { 1 } * ( { 0 }{ 111 } * ) k part of S . Any 1s preceding any zeroes (if there are any) must come from the initial { 1 } * part, and any 1s between the j th and ( j +1)th 0 must come from the { 111 } * in the j th repetition of { 0 }{ 111 } * in the ( { 0 }{ 111 } * ) k part. Thus any string σ S can be created in only one way. Solution:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Winter 2009 Midterm Soln - 1. [5 marks] (a) Determine [x6...

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