I know this question exists here, I saw some other posts, but the problem, the answer is the same as my teacher.. I need to know why the answer is true
Basically, I have to find the options of sequence of binary numbers without "$11$" with n length.
I tried this:
Let us first use the number $0$:
Then: there are $n-1$ numbers left, which means, for now: $a_n=a_{n-1}$
now, we use the number $1$:
Then: there are two choices:
a) we choose $0$: which means, we get left $n-2$ numbers, for now: $a_n=a_{n-1}+a_{n-2}$
b) we choose $1$: which is a problem, what am I supposed to do here? just "move on" and pass it? I know there are cases I have to subtract options, the question is, why am I not doing here minus $a_{n-2}$ on this option?
Asked
Active
Viewed 31 times
0
-
This is very hard to follow, even the title. Perhaps this is a duplicate. – lulu Aug 10 '22 at 15:44
-
@lulu Hi, its not a duplicate, but thanks. I will edit to make it clearer, sorry, my english is bad. – Aug 10 '22 at 15:46
-
Start by stating a clear question, I was just guessing. – lulu Aug 10 '22 at 15:46
-
@lulu I edited, please check now. – Aug 10 '22 at 15:47
-
I still don't see why it isn't a duplicate of the other question. – lulu Aug 10 '22 at 15:47
-
1The way I see this problem: every good sequence of length at least $2$ ends in $0$ or in $01$. Prior to which ever ending we have we must have a shorter good sequence. The ones that in $0$ are therefore $a_{n-1}$ and the ones that end in $01$ are therefore $a_{n-2}$. – lulu Aug 10 '22 at 15:49
-
@lulu because as I said, I already saw some solutions ( including this ), but I opened this post in deliberate to understand, because I want to understand why I dont need to do what I wrote at the end ( Option b ): _________b) we choose 1: which is a problem, what am I supposed to do here? just "move on" and pass it? I know there are cases I have to subtract options, the question is, why am I not doing here minus an−2 on this option? – Aug 10 '22 at 15:49
-
@lulu yea I know, but I want to understand, the answer I don't need, I have my teacher answer and in internet there are more than a hundread answers for this, but I want to understand it. – Aug 10 '22 at 15:49
-
1But what you write is too hard to follow. Let me try again: if you start with $0$, what follows must be a good string of length $n-1$, hence we get $a_{n-1}$. if you start with $1$ then the next character must be $0$ and what follows must be a good string of length $n-2$, hence $a_{n-2}$. That's all there is to this! – lulu Aug 10 '22 at 15:51
-
@lulu yea, but what do I do if I want to choose 1 and then 1 again? dont I need to subtract some option? because there are questions similliar to this when they are doing minus. Like a question of: write recursion problem for length of series of n with numbers 0,1,2 without the sequence 00 and 12, in this problem I have to subtract $a_{n-2}$ and $a_{n-3}$ – Aug 10 '22 at 15:53
-
1You can't. By definition. A good string can't contain $11$ so, in particular, it can not start $11$. – lulu Aug 10 '22 at 15:53
-
@lulu ohh, okay, I understand. I guess this question and the question I wrote before is different in its solutions, thanks! – Aug 10 '22 at 15:55
-
I suggest looking at some examples with small lengths to see concretely how this counting strategy works. – Karl Aug 10 '22 at 15:56
-
@Karl yea problem is, I cant find a site with exactly those exercises and solutions that are similliar to what we learned, it is usually one exercise in a site and its hard to find those :\ but I will manage somehow hopefully, thanks. – Aug 10 '22 at 15:57
-
What I mean is that you can count these strings yourself. The length-2 strings are 00,01,10. The length-3 strings are 000,001,010,100,101. Now look at the length-4 strings. How can you make one that starts with 0? How can you make one that starts with 1? – Karl Aug 10 '22 at 16:06
-
@Karl Oh I see, good idea for making sure my answer is good – Aug 10 '22 at 16:20