Total number of permutations of zeros and ones

73 Views Asked by At

How many different ways you can arrange zeros and ones such that the total number of ones before any point in the sequence is greater than or equal to the number of zeros before that point. This can also be interpreted like this, how many different ways you can arrange zeros and ones in a sequence such that the sum till whatever point you take in the sequence is non negative. There are 2n ones and zeros. For example consider this sequence of 6 ones and zeros,

111000, 110100, 101010, 111111, 111110 are all permutations that we are looking for. But 011100, 100110, 000000 are permutations that we are not interested in as there is at least one point in the sequence before which the sum is non positive.

Thanks in advance;)