Integer partition Created 2026-09-28 Updated 2026-10-14
An integer partition of a nonnegative integer is a multiset of positive integers whose sum is : repetitions matter, but the order of the summands does not. Equivalently, write its parts in decreasing order, allowing equality:The notation says that is an integer partition of . The partition count counts all integer partitions of , with any number of parts. Zero has one empty integer partition, so . The partition of an integer article develops the same objects in representation theory of the symmetric group.[ref]
Enumerative Combinatorics, Volume 1 (second-edition draft) by Richard Stanley. section 1.7, definitions of partitions and diagrams
Computed example. The seven integer partitions of five are exactlyThus . Sorting each list of positive summands into decreasing order prevents repetitions in this enumeration. Grouping by largest part verifies completeness: largest parts contribute respectively possibilities. For largest part , the remaining is either or ; for largest part , the remaining uses only and , giving or .
All seven integer partitions of five, drawn as Ferrers diagrams: each row has as many dots as its part
. Details. An integer partition keeps sizes without named positions. The compositions of an integer and are different tuples, but sorting either gives the same integer partition . A weak composition of an integer also retains its empty first position; dropping its zero and sorting gives that same integer partition. Conversely, a set partition records which distinct elements belong to each block. For example, the set partitions and differ even though both have the same integer partition of block sizes.
The Ferrers diagram makes an integer partition into a shape. For , the column lengths are : exchanging rows and columns gives its conjugate partition . Exchanging again recovers , so this operation is a bijection. In particular, the three integer partitions of five with at most two parts are , , and ; their conjugate partitions , , and are precisely the three with largest part at most two. This visible symmetry explains the equal counts for these two restrictions. The square-cell version is the existing Young diagram.
Counting by a generating function. An integer partition is determined by its multiplicities , the number of parts equal to . Its size condition is . Consequently its ordinary generating function isProof outline. Choose the term from the th geometric series. The product contributes exactly when those multiplicities describe an integer partition of , once for each such integer partition. As a formal power series, each coefficient is determined by finitely many factors: factors with contribute only their constant term to the coefficient of . For , multiplication through gives up to degree five, independently recovering . Restricting the factors gives the generating function for partitions with bounded parts. This is useful because restrictions on summands become choices of factors, while conjugate partitions turn restrictions on numbers of rows into restrictions on row lengths.[ref]
Enumerative Combinatorics, Volume 1 (second-edition draft) by Richard Stanley. section 1.8, conjugation and partition generating functions
Stars and bars (combinatorics) 2026-10-13
Stars and bars counts tuples of nonnegative integers with a prescribed sum. For integers and , its statement isSuch a tuple is a weak composition of an integer. Think of labelled bins: counts identical objects in the first bin, in the second, and so on. Bin names distinguish positions even when counts agree. Stars and bars counts these count tuples; assigning individually distinct objects requires additional information. [ref]
https://math.mit.edu/~fgotti/docs/Courses/C.%20Combinatorial%20Analysis/6.%20Compositions/Compositions.pdf. Felix Gotti, MIT 18.211, Lecture 6: Compositions, Proposition 1 and Example 3
Computed example. With and , the number of weak compositions of an integer is . The string
••|•|•• encodes : two dots before the first bar, one between the bars, and two after the second. For a fixed first-bin count , the second-bin count can be any integer from to and the third is forced. Thus the direct count is .Stars and bars for five identical objects and three labelled bins: ordinary splits, adjacent bars, and bars at either end
. Details. Adjacent bars encode an empty middle bin:
••||••• gives . A bar at the left end encodes an empty first bin, as in |••|••• for ; a bar at the right end encodes an empty third bin, as in ••|•••| for . These are valid weak compositions of an integer. For every count is zero, and for the unique tuple is , consistent with .Proof outline. Replace each count by that many dots and separate successive groups with bars. Reading the group sizes reverses this construction, so it is a bijection between weak compositions of an integer and strings of dots and bars. Choose the bar positions among positions; the binomial coefficient counts the choices. The beauty is that empty bins need no separate cases: end bars and adjacent bars encode them automatically.
If every bin must be nonempty, the tuples are compositions of an integer, and their count is for ; for there are none. Subtract one from every count, setting . This is a bijection to weak compositions of an integer of , so stars and bars gives . For five objects and three bins, this is , with the six positive tuplesFor instance, shifts to , whose sum is . Sorting the six positive tuples collapses them to just two integer partitions, and . Thus named bins and unordered summands answer different questions.
Stars and bars is useful for allocating identical resources or enumerating integer solutions without listing them individually. Prescribed lower bounds can be subtracted just like the nonempty-bin requirement. Upper bounds require removing forbidden tuples; the existing bounded weak compositions article applies the inclusion-exclusion principle to those violations.
Weak composition of an integer 2026-10-14
A weak composition of an integer into parts is an ordered tuple of nonnegative integers with sum . Zero parts retain their positions: and differ. Fixing the length is essential when applying stars and bars, since inserting extra zero parts creates further tuples. [ref]
https://math.mit.edu/~fgotti/docs/Courses/C.%20Combinatorial%20Analysis/6.%20Compositions/Compositions.pdf. Gotti, Lecture 6, definition and discussion of weak compositions

