Menu Close

How-many-bit-strings-of-length-10-do-not-have-four-consecutive-1s-




Question Number 203832 by depressiveshrek last updated on 29/Jan/24
How many bit strings of length 10 do not  have four consecutive 1s?
Howmanybitstringsoflength10donothavefourconsecutive1s?
Answered by nikif99 last updated on 30/Jan/24
Total number of bit strings of length 10  is 2^(10) =1024 (0−1023).  Of them, there are 7 bit strings of  exactly 4 ′1′s at posihions 1−7.  001111_() 0000  Furthermore, there are 3 bit strings  of more than one ′1111′:  1111011110  1111001111  0111101111  Answer: 1024−7−3=1014
Totalnumberofbitstringsoflength10is210=1024(01023).Ofthem,thereare7bitstringsofexactly41satposihions17.0011110000Furthermore,thereare3bitstringsofmorethanone1111:111101111011110011110111101111Answer:102473=1014
Commented by AST last updated on 30/Jan/24
It seems 1011110000, 1110111100,etc should  also be valid for those containing the string  1111
Itseems1011110000,1110111100,etcshouldalsobevalidforthosecontainingthestring1111
Commented by nikif99 last updated on 30/Jan/24
You are right. I should re−examine it.  Thank you.
Youareright.Ishouldreexamineit.Thankyou.
Commented by nikif99 last updated on 30/Jan/24
Re−evaluating my computations:  In a 10−bit string, I fix a series of  4 consecutive ′1′s ensuring adjacent  bits (if exixt) are set to 0. Example:  0011110000 where  reds are set to 1, blues are set to 0 to  prohibit expansion of reds and blacks  derive a 4−bit set with values 0 to 15.  So, we have next options.  a) 1111000000_()  (32 cases)  b) 0111100000_()  (16)  c) 0011110000 (16)  d) 0001111000 (16)  e) 0000111100 (16)  f) 0000011110 (16)  g) 0000001111 (32)  total 32×2+16×5=144  minus 2 for 0111101111 and 1111001111  which are double counted=142 with 4  concecutive ′1′s.  Non consecutive ones are  1024−142=882
Reevaluatingmycomputations:Ina10bitstring,Ifixaseriesof4consecutive1sensuringadjacentbits(ifexixt)aresetto0.Example:0011110000whereredsaresetto1,bluesaresetto0toprohibitexpansionofredsandblacksderivea4bitsetwithvalues0to15.So,wehavenextoptions.a)1111000000(32cases)b)0111100000(16)c)0011110000(16)d)0001111000(16)e)0000111100(16)f)0000011110(16)g)0000001111(32)total32×2+16×5=144minus2for0111101111and1111001111whicharedoublecounted=142with4concecutive1s.Nonconsecutiveonesare1024142=882
Commented by AST last updated on 31/Jan/24
Shouldn′t the strings with ≥4 1′s also be valid?  Since the 4 consecutive 1′s is also contained in it?  For example 0111111100 or 1111110101
Shouldntthestringswith41salsobevalid?Sincethe4consecutive1sisalsocontainedinit?Forexample0111111100or1111110101
Commented by nikif99 last updated on 30/Jan/24
The question is “do not have 4   consecuhive 1s”, 0111111100 has 7,  so I consider is not contained.  That′s why I blocked neighbouring  places with 0.
Thequestionisdonothave4consecuhive1s,0111111100has7,soIconsiderisnotcontained.ThatswhyIblockedneighbouringplaceswith0.
Commented by AST last updated on 30/Jan/24
It has 7 but it still has 4 consecutive 1′s   contained in it
Ithas7butitstillhas4consecutive1scontainedinit
Answered by AST last updated on 31/Jan/24
Case1: 1111 _ _ _ _ _ _ ⇒2^6  ways  Case 2: __1  1111_ _ _ _ _ ⇒2^5 ×1 ways and __1 =0  Case 3: __1  __2  1111_ _ _ _   Possible for (__1 ,__2 )=(1,1),(1,0),(0,1),(0,0)   Of this, only (1,0)∧(0,0) haven′t been accounted  for in cases 1 and 2⇒#(Case 3)=2×2^4 =2^5  ways  Case 4: __1  __2  __3  1111_ _ _  Possible: (0,0,0),(0,0,1),(0,1,0),(1,0,0),(0,1,1)  (1,0,1),(1,1,0)  Similarly, we get #(Case 4)=4×2^3 =2^5  ways  Case 5: __1  __2  __3  __4 1111_ _ ⇒2^3 ×2^2 =2^5  ways  Case 6: __1  __2  __3  __4  __5  1111 _  Other than case 1, __5  always contained 1  ⇒#(Case 6)=2^4 ×2−2=30 ways  Case 7: __1  __2  __3  __4  __5  __6 1111  __6 =0 and __1 __2 __3 __4 __(5 ) is such that it contains no  4 consecutive 1′s(11110,01111,11111)  ⇒#(Case 7)= 2^5 −3=29  ⇒#(contains 4 consecutive 1′s)=251  ⇒#(doesn′t contain 4 consecutive 1′s)=1024−252  =773
Case1:1111______26waysCase2:_11111_____25×1waysand_1=0Case3:_1_21111____Possiblefor(_1,_2)=(1,1),(1,0),(0,1),(0,0)Ofthis,only(1,0)(0,0)haventbeenaccountedYou can't use 'macro parameter character #' in math modeCase4:_1_2_31111___Possible:(0,0,0),(0,0,1),(0,1,0),(1,0,0),(0,1,1)(1,0,1),(1,1,0)You can't use 'macro parameter character #' in math modeCase5:_1_2_3_41111__23×22=25waysCase6:_1_2_3_4_51111_Otherthancase1,_5alwayscontained1You can't use 'macro parameter character #' in math modeCase7:_1_2_3_4_5_61111_6=0and_1_2_3_4_5issuchthatitcontainsno4consecutive1s(11110,01111,11111)You can't use 'macro parameter character #' in math modeYou can't use 'macro parameter character #' in math modeYou can't use 'macro parameter character #' in math mode=773
Commented by nikif99 last updated on 31/Jan/24
Good and clear explanation.
Goodandclearexplanation.

Leave a Reply

Your email address will not be published. Required fields are marked *