Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that the answer is C(8,2), but I don't get, why. Can anyone, please, explain it?

share|cite|improve this question

migrated from Jan 25 '11 at 12:22

This question came from our site for professional and enthusiast programmers.

$C(m,n)$ is usually notated $\binom{m}{n}$ (binomial coefficient) – Raphael Jan 25 '11 at 13:34

C(8, 2) means "8 choose 2", which in this case should be interpreted as "how many ways can you choose 2 items out of 8 possible". Here the 8 items are the bits, and the 2 comes from the bits you "select to be 1". That is, there are just as many bytes with exactly two 1s as there are ways to select 2 bits from 8 possible.

share|cite|improve this answer
Got it!!! Thank you! The problem is that i read the task as "how many bytes are in two 1's". ps: I am not a native English-speaker. ) – Nika Jan 22 '11 at 20:35

C(8,2) is kinda self explanatory:
you have 8 bits, and each time you choose 2 of them to be ones.

share|cite|improve this answer
1 seems pretty straightforward to me. – Paul Nathan Jan 21 '11 at 23:43

$C[8, 2] = 8!/((8-2)!2!) = (8!/6!)/2! = (8*7)/2 = 28$. Think of it this way. The 8 is the choice of the first bit, and the 7 is the choice of the second bit (it's only 7 because there are only 7 bits available after the first bit is decided). The 2 represents the number of permutations of the chosen bits. We divide by 2 because we don't want to count each ordering of the chosen bits separatetly.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.