## Task 14/70

An $n$-digit binary number has the cross sum $m$ (where $n$ and $m$ are natural numbers with $1 \leq m \leq n$).

How many such numbers are there for given $n$ and $m$?
In the binary system, there are only the digits 0 and 1. The sum of the digits $m$ is thus formed by the addition of $m$ ones, and the remaining $n-m$ digits of the binary number are zeros. After the first digit (from the left), which must be a one, there follow $m-1$ ones and $n-m$ zeros in any order. The number of permutations of these digits is

$$
P=\frac{(n-1)!}{(m-1)!(n-m)!}=\binom{n-1}{m-1}
$$

This is also the number of $n$-digit binary numbers with the sum of the digits $m$.

Example: $n=10, m=6$. It is $\binom{9}{5}=126$, so there are 126 ten-digit binary numbers with the sum of the digits 6.