Exercise 20 in the book "generatingfunctionology"

137 Views Asked by At

This will be a quick one:

In the book "generatingfunctionology" there is an exercise that is formulated as follows:

"Let $f(n,m,k)$ be the number of strings of $n$ $0$’s and $1$’s that contain exactly $m$ $1$’s, no $k$ of which are consecutive".

Now, I might just be slightly mathematically illiterate (or maybe he just wrote it in a clunky way), but I have a hard time understanding exactly what he means. Is it:

We got a string that in total contain $n$ $0$'s and $1$'s, $m$ of which are $1$'s (so $n-m$ are $0$'s and $f(n,m,k)=0$ for $n<m$) and of those $m$ $1$'s we do not want $k$ of them to be in succession so $(f,m,0)$ and $f(n,m,1)$ are both equal to $0$ when $m$ is not equal to $0$ (since otherwise we cannot even have one $1$ next to anything?) I am not sure how to read "no $k$ of which are consecutive" otherwise.

So for example $f(3,2,2) = 1$ as we got $1\,0\,1$ and $f(3,2,3) = 3$ as we got $1\,1\,0$, $\,0\,1\,1$, and $1\,0\,1$.

I just need to make sure before I start the exercise for real. Thanks.

1

There are 1 best solutions below

0
On

Yes, that is the correct interpretation. You cannot have $k$ consecutive $1$s.