Content deleted Content added
→Theorem one proof: ==Proofs via the method of stars and bars== ===Theorem one proof=== The problem of enumerating ''k''-tuples whose sum is ''n'' is equivalent to the problem of counting configurations of the following kind: let there be ''n'' objects to be placed into ''k'' bins, so that all bins contain at least one object. The bins are distinguished (say they are numbered 1 to ''k'') but the ''n'' objects are not (so configurations are only distinguished by the ''number of objects'' p... Tags: Reverted Mobile edit Mobile web edit |
Will Orrick (talk | contribs) m Reverted 1 edit by 2402:E000:4BC:3535:60C5:63FF:FEE1:3289 (talk) to last revision by TonySt |
||
(16 intermediate revisions by 12 users not shown) | |||
Line 1:
{{short description|Graphical aid for deriving some concepts in combinatorics}}
In [[combinatorics]], '''stars and bars''' (also called "sticks and stones",<ref>{{Cite book|last=Batterson|first=J|title=Competition Math for Middle School|publisher=Art of Problem Solving}}</ref> "balls and bars",<ref>{{cite book|last1=Flajolet|first1=Philippe|last2=Sedgewick|first2=Robert|date=June 26, 2009|title=Analytic Combinatorics|publisher=Cambridge University Press|isbn = 978-0-521-89806-5}}</ref> and "dots and dividers"<ref name=":0">{{Cite web|title=Art of Problem Solving|url=https://artofproblemsolving.com/wiki/index.php/Ball-and-urn|access-date=2021-10-26|website=artofproblemsolving.com}}</ref>) is a graphical aid for deriving certain [[combinatorial]] theorems. It can be used to solve
If, for example, there are two balls and three bins, then the number of ways of placing the balls is <math>\tbinom{2+3-1}{3-1} = \tbinom{4}{2} = 6</math>. The table shows the six possible ways of distributing the two balls, the strings of stars and bars that represent them (with stars indicating balls and bars separating bins from one another), and the subsets that correspond to the strings. As two bars are needed to separate three bins and there are two balls, each string contains two bars and two stars. Each subset indicates which of the four symbols in the corresponding string is a bar.
{| class="wikitable"
|+ Six configurations of two balls in three bins and their star and bar
|-
! Bin 1 !! Bin 2 !! Bin 3 !! String !! Subset of {1,2,3,4}
|-
| 2 || 0 || 0 || ★ ★
|-
| 1 || 1 || 0 || ★
|-
| 1 || 0 || 1 || ★
|-
| 0 || 2 || 0 ||
|-
| 0 || 1 || 1 ||
|-
| 0 || 0 || 2 ||
|}
Line 42:
where the [[Multiset#Counting multisets|multiset coefficient]] <math>\left(\!\!\binom{k}{n}\!\!\right)</math> is the number of multisets of size {{mvar|n}}, with elements taken from a set of size {{mvar|k}}.
This corresponds to [[Composition (combinatorics)|weak compositions]] of an integer. With {{mvar|k}} fixed, the numbers for {{math|''n'' {{=}} 0, 1, 2, 3,
==Proofs via the method of stars and bars==
Line 66:
|align=center
|content=
{{nowrap|{{huge|★ ★ ★ ★
|caption=Fig. 2: These two bars give rise to three bins containing 4, 1, and 2 objects
}}
Line 86:
|align=center
|content=
{{nowrap|{{huge|★ ★ ★ ★
|caption=Fig. 3: These four bars give rise to five bins containing 4, 0, 1, 2, and 0 objects
}}
|