*** Welcome to piglix ***

Stars and bars (combinatorics)


In the context of combinatorial mathematics, stars and bars is a graphical aid for deriving certain combinatorial theorems. It was popularized by William Feller in his classic book on probability. It can be used to solve many simple counting problems, such as how many ways there are to put n indistinguishable balls into k distinguishable bins.

The stars and bars method is often introduced specifically to prove the following two theorems of elementary combinatorics.

For any pair of positive integers n and k, the number of k-tuples of positive integers whose sum is n is equal to the number of (k − 1)-element subsets of a set with n − 1 elements.

Both of these numbers are given by the binomial coefficient . For example, when n = 3 and k = 2, the tuples counted by the theorem are (2, 1) and (1, 2), and there are of them.


...
Wikipedia

...