Statements of theorems
The stars and bars method is often introduced specifically to prove the following two theorems of elementary combinatorics concerning the number of solutions to an equation.Theorem one
For any pair of positive integers and , the number of - tuples of positive integers whose sum is is equal to the number of -element subsets of a set with elements. For example, if and , the theorem gives the number of solutions to (with ) as the binomial coefficient :Theorem two
For any pair of positive integers and , the number of - tuples of non-negative integers whose sum is is equal to the number of multisets of cardinality taken from a set of size , or equivalently, the number of multisets of cardinality taken from a set of size . For example, if and , the theorem gives the number of solutions to (with ) as: : : :Proofs via the method of stars and bars
Theorem one proof
Suppose there are ''n'' objects (represented here by stars) to be placed into ''k'' bins, such that all bins contain at least one object. The bins are distinguishable (say they are numbered 1 to ''k'') but the ''n'' stars are not (so configurations are only distinguished by the ''number of stars'' present in each bin). A configuration is thus represented by a ''k''-tuple of positive integers, as in the statement of the theorem. For example, with and , start by placing the stars in a line: The configuration will be determined once it is known which is the first star going to the second bin, and the first star going to the third bin, etc.. This is indicated by placing bars between the stars. Because no bin is allowed to be empty (all the variables are positive), there is at most one bar between any pair of stars. For example: There are gaps between stars. A configuration is obtained by choosing of these gaps to contain a bar; therefore there are possible combinations.Theorem two proof
In this case, the weakened restriction of non-negativity instead of positivity means that we can place multiple bars between stars, before the first star and after the last star. For example, when and , the tuple (4, 0, 1, 2, 0) may be represented by the following diagram: To see that there are possible arrangements, observe that any arrangement of stars and bars consists of a total of objects, ''n'' of which are stars and of which are bars. Thus, we only need to choose of the positions to be bars (or, equivalently, choose ''n'' of the positions to be stars). Theorem 1 can now be restated in terms of Theorem 2, because the requirement that all the variables are positive is equivalent to pre-assigning each variable a ''1'', and asking for the number of solutions when each variable is non-negative. For example: : with is equivalent to: : withProofs by generating functions
Both cases are very similar, we will look at the case when first. The 'bucket' becomes : This can also be written as : and the exponent of tells us how many balls are placed in the bucket. Each additional bucket is represented by another , and so the final generating function is : As we only have balls, we want the coefficient of (written ) from this : This is a well-known generating function - it generates the diagonals in Pascal's Triangle, and the coefficient of is : For the case when , we need to add into the numerator to indicate that at least one ball is in the bucket. : and the coefficient of is :Examples
Many elementary word problems in combinatorics are resolved by the theorems above.Example 1
If one wishes to count the number of ways to distribute seven indistinguishable one dollar coins among Amber, Ben, and Curtis so that each of them receives at least one dollar, one may observe that distributions are essentially equivalent to tuples of three positive integers whose sum is 7. (Here the first entry in the tuple is the number of coins given to Amber, and so on.) Thus stars and bars theorem 1 applies, with and , and there are ways to distribute the coins.Example 2
If , , and a set of size is then ★, ★★★, , ★ could represent either the multiset or the 4- tuple The representation of any multiset for this example should use SAB2 with , bars to give .Example 3
SAB2 allows for more bars than stars, which isn't permitted in SAB1. So, for example, 10 balls into 7 bins is , while 7 balls into 10 bins is , with 6 balls into 11 bins asExample 4
If we have the infinite power series : we can use this method to compute the Cauchy product of copies of the series. For the th term of the expansion, we are picking powers of from m separate locations. Hence there are ways to form our th power: :Example 5
The graphical method was used by Paul Ehrenfest and Heike Kamerlingh Onnes – with symbol ε (quantum energy element) in place of a star – as a simple derivation of Max Planck's expression of "complexions". Planck called "complexions" the number of possible distributions of energy elements ε over resonators: : The graphical representation would contain times the symbol ε and times the sign , for each possible distribution. In their demonstration, Ehrenfest and Kamerlingh Onnes took and (''i.e.'', combinations). They chose the 4-tuple (4, 2, 0, 1) as the illustrative example for this symbolic representation: εεεε, εε, , εSee also
* Gaussian binomial coefficient * Partition (number theory) * Twelvefold wayReferences
Further reading
* *{{cite web, last=Weisstein, first=Eric W. , title=Multichoose , work=Mathworld -- A Wolfram Web Resource , url=http://mathworld.wolfram.com/Multichoose.html , accessdate=18 November 2012