an is the number of strings of length n in which every 0 is immediately followed by at least two consecutive 1's. Example: the string 101111 is allowed, but 01110 is not.
so what the problem asks for is to find a recurrence relation and initial conditions for an. now i had something going where:
if it starts with a 011, that would be an-3starts with a 1, it could be 1011_________ = an-4, or 11011_____ = an-5, .....etc (where ____ could be 0 or 1)

i was just wondering if this is the right approach? and how to also figure in the possibility of another zero appearing somewhere along the string of _____.

Mar 24th 2010, 12:12 PM

Plato

First find the first three.
$\displaystyle A_1:\{1\},~~a_1=1$
$\displaystyle A_2:\{11\},~~a_2=1 $
$\displaystyle A_3:\{011,111\},~~a_3=2 $
Note that no string in $\displaystyle A_n$ can end in a zero.
If you add a 1 to the right end of any string in $\displaystyle A_3$ you have a valid string in $\displaystyle A_4$.
What is the complete list for $\displaystyle A_4$?
That is a way to proceed.

alright so A4 = {1011,0111,1111} = 3, A5 = {10111,01111,11111,11011}...etcbut how would i write this as a recurrance relation for an = ?

Well that is for you to work on.
Here are more hints.
Any valid string must the last three $\displaystyle \cdots 011\text{ or }\cdots 111$.
It is safe to add a 1 to any string in $\displaystyle A_{n-1}$.
BUT that does not get all in $\displaystyle A_n$.
What else does? Be careful do not get repeats.

where each (0.5 * an__) is rounded up. This is because to get lets say a5, you can add 1 to the end of every string in a4, and add also add 1 to the start of the string in a4 that starts with a 10.
so a4 = {0111,1111,1011}, and a5 = {01111,11111,10111,11011}

Actually it should be $\displaystyle a_n=a_{n-1}+a_{n-3}$.
We add 1 to the end of every string in $\displaystyle A_{n-1} $ and add 011 to the end each string in $\displaystyle A_{n-3} $.
You should try that to see why it works with the $\displaystyle A_n$ís we already have.