I know that the answer is $C(8,2)$, but I don't get, why. Can anyone, please, explain it?
How many bytes contain exactly two $1$'s?
-
1$C(m,n)$ is usually notated $\binom{m}{n}$ (binomial coefficient) – 2011-01-25
3 Answers
$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.
-
1Got 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. ) – 2011-01-22
$C(8,2)$ is kinda self explanatory:
you have $8$ bits, and each time you choose $2$ of them to be ones.
-
1http://en.wikipedia.org/wiki/Combination seems pretty straightforward to me. – 2011-01-21
$C[8, 2] = \dfrac{8!}{2!(8-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.