0

So I have a basic assignment that ask that if in bit-string that consists of 8 bits in how many ways can we arrange the ones and zeros in order for the string to have at least 2 ones example: 11000000 10010000 10110000 11100011 etc.

I try to solve this by using the Combinations formula C(n, k) in order to find out in how many ways can we arrange the bits in order for the string to have exactly 2, 3, 4, 5, 6, 7, 8 ones like this:

C(8, 2)+C(8, 3)+C(8, 4)+C(8, 5)+C(8, 6)+C(8, 7)+C(8, 8)

However when I solve this I get the number 239 but the answer is 247 ways.

Can anyone help me?

Is the formula correct and if not what is the correct procedure?

Thank you in advance!

  • 3
    That is 247, you must have a made a mistake in the calculation. – Hans Lundmark May 10 '18 at 19:48
  • 1
    Just to say, it is easier to work from the complement. There is only one string with no $1's$ and there are eight with exactly one $1$ so there are only $9$ out of a possible $256$ that fail the test. – lulu May 10 '18 at 19:50
  • 1
    A much easier way of doing the arithmetic is in reverse. There are $2^8=256$ bitstrings of length 8, $\binom{8}{0}=1$ of which have no 1s, and $\binom{8}{1}$ of which have one 1, making the total with at least two 1's as $256-1-8=247$ – JMoravitz May 10 '18 at 19:51
  • Yes I know that there is a different way however I'm trying to figure out weather or not my method is correct. Is it? – David Mathers May 10 '18 at 19:55
  • It is. You made arithmetic errors only. – JMoravitz May 10 '18 at 20:01
  • Okey thank you very much. – David Mathers May 10 '18 at 20:01

0 Answers0