Question Number 203832 by depressiveshrek last updated on 29/Jan/24
$$\mathrm{How}\:\mathrm{many}\:\mathrm{bit}\:\mathrm{strings}\:\mathrm{of}\:\mathrm{length}\:\mathrm{10}\:\mathrm{do}\:\mathrm{not} \\ $$$$\mathrm{have}\:\mathrm{four}\:\mathrm{consecutive}\:\mathrm{1s}? \\ $$
Answered by nikif99 last updated on 30/Jan/24
$${Total}\:{number}\:{of}\:{bit}\:{strings}\:{of}\:{length}\:\mathrm{10} \\ $$$${is}\:\mathrm{2}^{\mathrm{10}} =\mathrm{1024}\:\left(\mathrm{0}−\mathrm{1023}\right). \\ $$$${Of}\:{them},\:{there}\:{are}\:\mathrm{7}\:{bit}\:{strings}\:{of} \\ $$$${exactly}\:\mathrm{4}\:'\mathrm{1}'{s}\:{at}\:{posihions}\:\mathrm{1}−\mathrm{7}. \\ $$$$\mathrm{00}\underset{} {\underbrace{\mathrm{1111}}0000} \\ $$$${Furthermore},\:{there}\:{are}\:\mathrm{3}\:{bit}\:{strings} \\ $$$${of}\:{more}\:{than}\:{one}\:'\mathrm{1111}': \\ $$$$\mathrm{1111011110} \\ $$$$\mathrm{1111001111} \\ $$$$\mathrm{0111101111} \\ $$$${Answer}:\:\mathrm{1024}−\mathrm{7}−\mathrm{3}=\mathrm{1014} \\ $$
Commented by AST last updated on 30/Jan/24
$${It}\:{seems}\:\mathrm{1011110000},\:\mathrm{1110111100},{etc}\:{should} \\ $$$${also}\:{be}\:{valid}\:{for}\:{those}\:{containing}\:{the}\:{string} \\ $$$$\mathrm{1111} \\ $$
Commented by nikif99 last updated on 30/Jan/24
$${You}\:{are}\:{right}.\:{I}\:{should}\:{re}−{examine}\:{it}. \\ $$$${Thank}\:{you}. \\ $$
Commented by nikif99 last updated on 30/Jan/24
$${Re}−{evaluating}\:{my}\:{computations}: \\ $$$${In}\:{a}\:\mathrm{10}−{bit}\:{string},\:{I}\:{fix}\:{a}\:{series}\:{of} \\ $$$$\mathrm{4}\:{consecutive}\:'\mathrm{1}'{s}\:{ensuring}\:{adjacent} \\ $$$${bits}\:\left({if}\:{exixt}\right)\:{are}\:{set}\:{to}\:\mathrm{0}.\:{Example}: \\ $$$$\mathrm{0011110000}\:{where} \\ $$$${reds}\:{are}\:{set}\:{to}\:\mathrm{1},\:{blues}\:{are}\:{set}\:{to}\:\mathrm{0}\:{to} \\ $$$${prohibit}\:{expansion}\:{of}\:{reds}\:{and}\:{blacks} \\ $$$${derive}\:{a}\:\mathrm{4}−{bit}\:{set}\:{with}\:{values}\:\mathrm{0}\:{to}\:\mathrm{15}. \\ $$$${So},\:{we}\:{have}\:{next}\:{options}. \\ $$$$\left.{a}\right)\:\mathrm{11110}\underset{} {\underbrace{\mathrm{00000}}}\:\left(\mathrm{32}\:{cases}\right) \\ $$$$\left.{b}\right)\:\mathrm{011110}\underset{} {\underbrace{\mathrm{0000}}}\:\left(\mathrm{16}\right) \\ $$$$\left.{c}\right)\:\mathrm{0011110000}\:\left(\mathrm{16}\right) \\ $$$$\left.{d}\right)\:\mathrm{0001111000}\:\left(\mathrm{16}\right) \\ $$$$\left.{e}\right)\:\mathrm{0000111100}\:\left(\mathrm{16}\right) \\ $$$$\left.{f}\right)\:\mathrm{0000011110}\:\left(\mathrm{16}\right) \\ $$$$\left.{g}\right)\:\mathrm{0000001111}\:\left(\mathrm{32}\right) \\ $$$${total}\:\mathrm{32}×\mathrm{2}+\mathrm{16}×\mathrm{5}=\mathrm{144} \\ $$$${minus}\:\mathrm{2}\:{for}\:\mathrm{0111101111}\:{and}\:\mathrm{1111001111} \\ $$$${which}\:{are}\:{double}\:{counted}=\mathrm{142}\:\boldsymbol{{with}}\:\mathrm{4} \\ $$$${concecutive}\:'\mathrm{1}'{s}. \\ $$$$\boldsymbol{{Non}}\:{consecutive}\:{ones}\:{are} \\ $$$$\mathrm{1024}−\mathrm{142}=\mathrm{882} \\ $$
Commented by AST last updated on 31/Jan/24
$${Shouldn}'{t}\:{the}\:{strings}\:{with}\:\geqslant\mathrm{4}\:\mathrm{1}'{s}\:{also}\:{be}\:{valid}? \\ $$$${Since}\:{the}\:\mathrm{4}\:{consecutive}\:\mathrm{1}'{s}\:{is}\:{also}\:{contained}\:{in}\:{it}? \\ $$$${For}\:{example}\:\mathrm{0111111100}\:{or}\:\mathrm{1111110101} \\ $$
Commented by nikif99 last updated on 30/Jan/24
$${The}\:{question}\:{is}\:“{do}\:{not}\:{have}\:\mathrm{4}\: \\ $$$${consecuhive}\:\mathrm{1}{s}'',\:\mathrm{0111111100}\:{has}\:\mathrm{7}, \\ $$$${so}\:{I}\:{consider}\:{is}\:{not}\:{contained}. \\ $$$${That}'{s}\:{why}\:{I}\:{blocked}\:{neighbouring} \\ $$$${places}\:{with}\:\mathrm{0}. \\ $$
Commented by AST last updated on 30/Jan/24
$${It}\:{has}\:\mathrm{7}\:{but}\:{it}\:{still}\:{has}\:\mathrm{4}\:{consecutive}\:\mathrm{1}'{s}\: \\ $$$${contained}\:{in}\:{it} \\ $$
Answered by AST last updated on 31/Jan/24
$${Case}\mathrm{1}:\:\mathrm{1111}\:\_\:\_\:\_\:\_\:\_\:\_\:\Rightarrow\mathrm{2}^{\mathrm{6}} \:{ways} \\ $$$${Case}\:\mathrm{2}:\:\__{\mathrm{1}} \:\mathrm{1111\_}\:\_\:\_\:\_\:\_\:\Rightarrow\mathrm{2}^{\mathrm{5}} ×\mathrm{1}\:{ways}\:{and}\:\__{\mathrm{1}} =\mathrm{0} \\ $$$${Case}\:\mathrm{3}:\:\__{\mathrm{1}} \:\__{\mathrm{2}} \:\mathrm{1111\_}\:\_\:\_\:\_\: \\ $$$${Possible}\:{for}\:\left(\__{\mathrm{1}} ,\__{\mathrm{2}} \right)=\left(\mathrm{1},\mathrm{1}\right),\left(\mathrm{1},\mathrm{0}\right),\left(\mathrm{0},\mathrm{1}\right),\left(\mathrm{0},\mathrm{0}\right)\: \\ $$$${Of}\:{this},\:{only}\:\left(\mathrm{1},\mathrm{0}\right)\wedge\left(\mathrm{0},\mathrm{0}\right)\:{haven}'{t}\:{been}\:{accounted} \\ $$$${for}\:{in}\:{cases}\:\mathrm{1}\:{and}\:\mathrm{2}\Rightarrow#\left({Case}\:\mathrm{3}\right)=\mathrm{2}×\mathrm{2}^{\mathrm{4}} =\mathrm{2}^{\mathrm{5}} \:{ways} \\ $$$${Case}\:\mathrm{4}:\:\__{\mathrm{1}} \:\__{\mathrm{2}} \:\__{\mathrm{3}} \:\mathrm{1111\_}\:\_\:\_ \\ $$$${Possible}:\:\left(\mathrm{0},\mathrm{0},\mathrm{0}\right),\left(\mathrm{0},\mathrm{0},\mathrm{1}\right),\left(\mathrm{0},\mathrm{1},\mathrm{0}\right),\left(\mathrm{1},\mathrm{0},\mathrm{0}\right),\left(\mathrm{0},\mathrm{1},\mathrm{1}\right) \\ $$$$\left(\mathrm{1},\mathrm{0},\mathrm{1}\right),\left(\mathrm{1},\mathrm{1},\mathrm{0}\right) \\ $$$${Similarly},\:{we}\:{get}\:#\left({Case}\:\mathrm{4}\right)=\mathrm{4}×\mathrm{2}^{\mathrm{3}} =\mathrm{2}^{\mathrm{5}} \:{ways} \\ $$$${Case}\:\mathrm{5}:\:\__{\mathrm{1}} \:\__{\mathrm{2}} \:\__{\mathrm{3}} \:\__{\mathrm{4}} \mathrm{1111\_}\:\_\:\Rightarrow\mathrm{2}^{\mathrm{3}} ×\mathrm{2}^{\mathrm{2}} =\mathrm{2}^{\mathrm{5}} \:{ways} \\ $$$${Case}\:\mathrm{6}:\:\__{\mathrm{1}} \:\__{\mathrm{2}} \:\__{\mathrm{3}} \:\__{\mathrm{4}} \:\__{\mathrm{5}} \:\mathrm{1111}\:\_ \\ $$$${Other}\:{than}\:{case}\:\mathrm{1},\:\__{\mathrm{5}} \:{always}\:{contained}\:\mathrm{1} \\ $$$$\Rightarrow#\left({Case}\:\mathrm{6}\right)=\mathrm{2}^{\mathrm{4}} ×\mathrm{2}−\mathrm{2}=\mathrm{30}\:{ways} \\ $$$${Case}\:\mathrm{7}:\:\__{\mathrm{1}} \:\__{\mathrm{2}} \:\__{\mathrm{3}} \:\__{\mathrm{4}} \:\__{\mathrm{5}} \:\__{\mathrm{6}} \mathrm{1111} \\ $$$$\__{\mathrm{6}} =\mathrm{0}\:{and}\:\__{\mathrm{1}} \__{\mathrm{2}} \__{\mathrm{3}} \__{\mathrm{4}} \__{\mathrm{5}\:} {is}\:{such}\:{that}\:{it}\:{contains}\:{no} \\ $$$$\mathrm{4}\:{consecutive}\:\mathrm{1}'{s}\left(\mathrm{11110},\mathrm{01111},\mathrm{11111}\right) \\ $$$$\Rightarrow#\left({Case}\:\mathrm{7}\right)=\:\mathrm{2}^{\mathrm{5}} −\mathrm{3}=\mathrm{29} \\ $$$$\Rightarrow#\left({contains}\:\mathrm{4}\:{consecutive}\:\mathrm{1}'{s}\right)=\mathrm{251} \\ $$$$\Rightarrow#\left({doesn}'{t}\:{contain}\:\mathrm{4}\:{consecutive}\:\mathrm{1}'{s}\right)=\mathrm{1024}−\mathrm{252} \\ $$$$=\mathrm{773} \\ $$
Commented by nikif99 last updated on 31/Jan/24
$${Good}\:{and}\:{clear}\:{explanation}. \\ $$