Formula for combinations not adding up

43 Views Asked by At

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!