  The distribution of a given sequence in the set of all sequences with n ones
and m = M - n zeros are found by relating the problem to the partitions of a
natural number in m natural summands, taking into account the order. The
formulas obtained have many applications both in Physics and Mathematics.
Examples discussed in the present paper are: non Markovian chains, partition
functions of binary alloys and Ising magnets, generalized Kaplansky lemma,
generalized Fibonacci numbers and a general expansion of \sum_{h=0}^{m} h^{r}
{\binom{m}{h}}^{2} in terms of the Stirling numbers of second kind.
