Ask your own question, for FREE!
Mathematics 18 Online
OpenStudy (anonymous):

The number of strings of length five consisting of 0's and 1's with no consecutive 1's are ?

terenzreignz (terenzreignz):

Oh counting problems... Let me think...

OpenStudy (anonymous):

yup sure

terenzreignz (terenzreignz):

How are you supposed to do this, though? Recurrence relations?

OpenStudy (anonymous):

I was thinking to do this through permutations and combinations !

terenzreignz (terenzreignz):

Silly me... recalculating :3

terenzreignz (terenzreignz):

Okay, so, obviously, the total number of strings if you do not add restrictions is \(\large 2^n\) right?

terenzreignz (terenzreignz):

err.. \(\large 2^5 = 32\) to be specific..

OpenStudy (anonymous):

yup

terenzreignz (terenzreignz):

Maybe there's a way to count all 'forbidden' strings? The ones which contain consecutive 1's.

OpenStudy (anonymous):

yeah i was thinking to do like that, around the way by subtracting the total no. of strings consisting of consecutive 1's frm the 2^5 strings, but cudnt start how to do tht !

terenzreignz (terenzreignz):

Yeah, it's tricky... wrong methods result in double counting... hmmn...

terenzreignz (terenzreignz):

Brute force, then?

OpenStudy (anonymous):

can we do it like taking number of string numbers as 4 with 11 taken as only one place

terenzreignz (terenzreignz):

After all, it's only a string of length 5...

OpenStudy (anonymous):

2^5-2^4 is that the correct way ?

terenzreignz (terenzreignz):

See, that's the problem, moli1993 (name pls lol) You could certainly try placing a fixed 11 on one of the four possible places you could put it... however say you do this... count 11??? ?11?? ??11? ???11 You'll be counting the combination 1111 *twice* which will screw up your calculations XD

terenzreignz (terenzreignz):

11110*

OpenStudy (anonymous):

LOL name is Mallika :p my bad

terenzreignz (terenzreignz):

TJ. Pleasure :) Anyway, at least let's arrive at the correct answer before we try anything fancy. Take cases. Obviously, we cannot allow strings with 4 or 5 1's in it, there's no way to arrange them without having consecutive 1's If there's only one 1, how many length-5 strings are allowable?

OpenStudy (anonymous):

ummm , I didnt get u actually how the cases are repeated if i considr it as 4 place string with consecutive 1 i.e 11 taken as a single place

terenzreignz (terenzreignz):

Okay, let's do that ^_^ We arrange a 11, 0's and 1's on four places, yeah? So, that means we permute the 0's and 1's first, and then place the 11 on one of the four possible places to put it... Effectively rendering the number \(\large 2^3 \cdot 4 \) or \(\large 2^4\)

terenzreignz (terenzreignz):

or wait, sorry, \(\Large 2^3 \cdot 4 = 2^5\) Well then.. :3

terenzreignz (terenzreignz):

So we arrive at \(\large 2^5\) the total number of arrangements when there are no restrictions... so either there's no way to arrange a string of 5 bits (0's and 1's) without having consecutive 1's... OR we counted some stuff twice ;)

OpenStudy (anonymous):

ohk got it (Y) then

terenzreignz (terenzreignz):

Bear with me... no fancy counting methods until we know what we're actually shooting for :) If there's only one 1, how many string of 5 bits are possible?

OpenStudy (anonymous):

one only

terenzreignz (terenzreignz):

nope. There are 5. 10000 01000 00100 00010 00001

OpenStudy (anonymous):

ohh i thought u were saying when we have only 1 option that is only 1 is the digit to fill all the 5 places, my bad , ya 5 ways !

terenzreignz (terenzreignz):

Okay, what if there are two 1's? How many possible (and allowable!) five-bit strings do we get? Think on it now...

OpenStudy (anonymous):

ohk wait , lemme think

OpenStudy (anonymous):

by allowable u mean , no 2 consecutive 1's ?

terenzreignz (terenzreignz):

Yup.

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

10100 10010 10001 01001 01010 00101 6 ways ?

terenzreignz (terenzreignz):

6 ways, yes. Now what about with three 1's?

OpenStudy (anonymous):

10101 only 1 way?

terenzreignz (terenzreignz):

that's right, lol And that's all of them... riiiight? :D

OpenStudy (anonymous):

isn't there a formula to calculate this, this is getting lenghty !

terenzreignz (terenzreignz):

There is a way, but the only way I could think of is using recurrence relations... and you shunned those right away XD

OpenStudy (anonymous):

5+6+1= answer ?

terenzreignz (terenzreignz):

Yes... because there are no allowable strings with four or five 1's, yes?

OpenStudy (zarkon):

00000

OpenStudy (anonymous):

yeah coz consecutive 1's wud be allowed in that case which we dont want :)

OpenStudy (anonymous):

so 6+5+1+1 ? including 00000

terenzreignz (terenzreignz):

oops... good thing there's someone else watching this o.O My bad Zarkon <head scratch>

OpenStudy (zarkon):

this about this.... \[\sum_{x=0}^{3}{6-x\choose x}=13\]

OpenStudy (zarkon):

*think

OpenStudy (anonymous):

Oh My God zarkon , how did u come to tht formula ?

OpenStudy (anonymous):

Teren is 5+6+1+1 is the final answer then ?

terenzreignz (terenzreignz):

it's TJ -_- And yes, that's the final answer. Meanwhile, I was trying to find a way to get the answer for any length n of your string. And believe it or not, it follows a Fibonacci sequence :)

OpenStudy (anonymous):

yeah TJ :) thank you so much ! how come fibonacci ??

terenzreignz (terenzreignz):

I'll show you. But bear with me, it involves recurrence relations... Suppose \(\large a_n\) is the number of strings of bits of length n, where there are no consecutive 1's.... Catch me so far?

OpenStudy (anonymous):

yup

terenzreignz (terenzreignz):

Okay, suppose we want to find an expression for \(a_n\) Then let's analyse. \[\Large \text{_ _ _ _ ... ?}\] A string either ends in 1 or 0, right?

OpenStudy (anonymous):

yup

terenzreignz (terenzreignz):

If it ends in 0 \[\Large \text{_ _ _ _ ... _ 0}\] Then the rest of the string is just \(\large a_{n-1}\) Since the rest of the string is just the number of allowable strings of length n-1. If it ends in 1, however, then \[\Large \text{_ _ _ _ ... } \color{red}0 \text{ 1}\] the next-to last bit MUST be a zero, and then the rest, a string of length n-2, can be any such allowable string, or \(\large a_{n-2}\) Since those ARE the only two cases, then we have \[\Large a_n = a_{n-1}+a_{n-2}\]

OpenStudy (anonymous):

ohk got it , then !

terenzreignz (terenzreignz):

Not quite done yet. We "cheat" a little. We know a few certain "intial values" In particular, we know how many allowable strings of length 1 and 2 there are. Those are simply enough calculated. length 1 are just either "0" or "1" so \(a_1 = 2\) length 2 are just "00" "01" or "10" so \(a_2=3\) And the rest follows your standard fibonacci whatnot \[\Large 2,3,5,8,\color{red}{13},21,33\] etc. 13 being the fifth, or our answer :)

terenzreignz (terenzreignz):

Crap, such fails... the last should be 34 gaaah

OpenStudy (anonymous):

huhh !!

OpenStudy (zarkon):

it is 34...you can also use \[\Large N(n)=\sum_{x=0}^{\text{floor}(n/2)+1}{n+1-x\choose x}\] a little work will yield that this follows the Fibonacci sequence

terenzreignz (terenzreignz):

@moli1993 problem? :3

OpenStudy (anonymous):

nope TJ but 34 doesnt comes in fibonacci ! that's the prob as u mentioned earlier !

terenzreignz (terenzreignz):

Yes it does... the sum of 13 and 21...

OpenStudy (anonymous):

@Zarkon can you please explain how to concluded to this formula ? whr did it come frm !

OpenStudy (zarkon):

I used math and derived it

OpenStudy (anonymous):

TJ, my bad , yeah u are correct ! I got it . Thanks a ton !

terenzreignz (terenzreignz):

I am ALWAYS correct. Except when I'm wrong xD LOL this was fun ^_^

OpenStudy (anonymous):

@Zarkon , if time allows can u please explain how u derived it ?

OpenStudy (anonymous):

:)

OpenStudy (zarkon):

you just use a little trick over and over... if you don't want '11' then you put a zero next to a 1 '10' and you treat this as one object...then start counting ;)

OpenStudy (anonymous):

ohk

OpenStudy (anonymous):

btw @terenzreignz , wht is ur real name ?

terenzreignz (terenzreignz):

That's what my 'detailed profile' is for, but if you must know it here, it's Terence Jason :D

OpenStudy (anonymous):

ohh :) thanks a ton Terence for helping me :) I was really stuck at this question

terenzreignz (terenzreignz):

No sweat. Almost got it wrong until Zarkon pointed out the annoyingly 'devious' string 00000 XD

OpenStudy (anonymous):

ha ha , no prob ! detailed profile "IMPRESSIVE" (Y)

terenzreignz (terenzreignz):

;) Well, if you got another counting problem, I want in on it

OpenStudy (anonymous):

ha ha seems addictive ! sure , lemme find one, ! u seem from China or Japan (guessing from ur name) am I correct ?

terenzreignz (terenzreignz):

Nope. And Wong is so not a Japanese surname XD (Does it even SOUND Japanese? lol Don't answer that ;) )

OpenStudy (anonymous):

umm I just thought, maybe m nt that good at guessing nationality of people through their names ! My Bad :p

OpenStudy (anonymous):

u want me to post the ques here or new ques, coz here u wont be able to get the medal , coz the best response is already chosen

terenzreignz (terenzreignz):

I don't care for medals that much, but I do hate lag. The longer this thread gets, the more lag. Though I don't really mind it that much...

OpenStudy (anonymous):

ohk i will start with a new question !

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!