2
$\begingroup$

Among all $n$-bits binary numbers, we count the continuous 1s as a single 1. For example, 10011101 gets three 1s, 111 gets one 1.

$C(n,k)$ is the number of all $n$-bit binary numbers that get $k$ 1s (according to the above specification).

For example, $C(3,1)=6$, and they are: 001,010,100,011,110,111; while 000,101 are not.

Find a simplified form for $C(n,k)$.

3 Answers 3