I have seen this question which lead me ask this following question.
What is the number of unique possibilities to generate a binary string that has M 0s and N 1s.? For example,
If M=3, N=4, then possible combinations are
0001111
0101010
etc.
I have seen this question which lead me ask this following question.
What is the number of unique possibilities to generate a binary string that has M 0s and N 1s.? For example,
If M=3, N=4, then possible combinations are
0001111
0101010
etc.
I think this is equivalent to say, we have $M+N$ positions from where we choose $N$ positions to fill with $1$. The number of ways is clearly then $$ \binom{M+N}{N} = {(M+N)! \over M! \cdot N!} $$
OK, so you have $n$ digits, of which $r$ are 0 and $s$ are 1. Obviously, $r + s \le n$.
Think of it in the following steps, which are independent:
Pulling all together:
$$\binom{n}{r + s} \cdot \binom{r + s}{r} \cdot 8^{n - (r + s)}$$