Pattern for Recursive Construction

139 Views Asked by At

Suppose I have this recursive definition of binary strings. Let $K$ be set of binary strings. The empty string $""$ and $1$ are in $K$. If $k$ is a string in $K$, then so is $0k$, $k0$. And if $k$ is a string in $K$, then so is $k01$.

I'm trying to find a property and then prove with structural induction that is satisfied by all the strings in K and I cannot seem to find the invariant, the property that does not change as the strings in K gets more complicated. I have listed some of the strings in K below:

Length 0: $""$

Length 1: $0,1$

Length 2: $00, 01, 10$

Length 3: $000, 001, 010, 100, 101$

Length 4: $0000, 0001, 0010, 0100, 1000, 0101, 1010, 1001$

Can anyone see a pattern?

1

There are 1 best solutions below

2
On

Looks to me all strings that do not have two $1$'s together.