I have a group with the size of n, and only 2 different elements (1 and 0) with k times 1 and m times 0. For example:
1 1 1 0 1 1 1 where n would be 7, k 6 and m 1. I can arrange this group in Binomial[7,6] = Binomial[7,1] = 7 different ways.
1 1 1 0 1 1 1
1 1 0 1 1 1 1
1 0 1 1 1 1 1
0 1 1 1 1 1 1
1 1 1 1 1 1 0
1 1 1 1 1 0 1
1 1 1 1 0 1 1
And I want to know how often I can find the sequence 1 1 1. In this example it's easy. It doesn't matter how I arrange this group, I always find 1 1 1 so the answer is 7.
But how about
1 1 1 0 0 1 1, n=7, k=5, m=2
There are Binomial[7,5] = Binomial[7,2] = 21 ways of arranging this group, but how many times can I find the sequence 1 1 1? Sure I can write all 21 ways of arranging it down, and count it, but that's not what I am looking for. I'm thinking for hours about it, but I don't find out how I calculate it generally for n, k and m.
Regards