math239_f16_a5_sln

# math239_f16_a5_sln - Math 239 Fall 2016 Assignment 5...

This preview shows pages 1–2. Sign up to view the full content.

Math 239 Fall 2016 Assignment 5 Solutions 1. { 5 marks } Let S be the set of all binary strings where the number of 0’s is congruent to 1 modulo 3 (there can be any number of 1’s). Give a recursive definition of S , and justify your definition. Use your recursive definition to determine the generating series of S with respect to the lengths of the strings. (Hint: Partition the string after the third occurrence of 0.) Solution. A string σ in S has at least one 0. If it has exactly one 0, then it is a string in { 1 } * { 0 }{ 1 } * . Otherwise, it has at least four 0’s. We look for the third 0 from the left, and split the string just after that. The first part consists of strings with exactly three 0’s, ending with a 0, so it can be expressed as { 1 } * { 0 }{ 1 } * { 0 }{ 1 } * { 0 } . The second part is another string in S since the number of 0’s in σ is congruent to 1 modulo 3, taking away three 0’s, the number of remaining 0’s is still congruent to 1 modulo 3. Therefore, S = { 1 } * { 0 }{ 1 } * ∪ { 1 } * { 0 }{ 1 } * { 0 }{ 1 } * { 0 } S. This gives us the following equation: Φ S ( x ) = x (1 - x ) 2 + x 3 (1 - x ) 3 Φ S ( x ) . Solving this gives Φ S ( x ) = x - x 2 1 - 3 x + 3 x 2 - 2 x 3 . 2. Let S be the set of binary strings which do not have 0010010010 as a substring. Let T be the set of binary strings that have exactly one copy of 0010010010 at the right end. Two (incomplete) recursive relations between the two sets are { ε } ∪ S { 0 , 1 } = S T S { 0010010010 } = . . . . . . . . .

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern