Hubbry Logo
Composition (combinatorics)Composition (combinatorics)Main
Open search
Composition (combinatorics)
Community hub
Composition (combinatorics)
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Composition (combinatorics)
Composition (combinatorics)
from Wikipedia

In mathematics, a composition of an integer n is a way of writing n as the sum of a sequence of positive integers. Two sequences that differ in the order of their terms define different compositions of their sum, while they are considered to define the same integer partition of that number. Every integer has finitely many distinct compositions. Negative numbers do not have any compositions, but 0 has one composition, the empty sequence. Each positive integer n has 2n−1 distinct compositions.

Bijection between 3 bit binary numbers and compositions of 4

A weak composition of an integer n is similar to a composition of n, but allowing terms of the sequence to be zero: it is a way of writing n as the sum of a sequence of non-negative integers. As a consequence every positive integer admits infinitely many weak compositions (if their length is not bounded). Adding a number of terms 0 to the end of a weak composition is usually not considered to define a different weak composition; in other words, weak compositions are assumed to be implicitly extended indefinitely by terms 0.

To further generalize, an A-restricted composition of an integer n, for a subset A of the (nonnegative or positive) integers, is an ordered collection of one or more elements in A whose sum is n.[1]

Examples

[edit]
The 32 compositions of 6

1 + 1 + 1 + 1 + 1 + 1
2 + 1 + 1 + 1 + 1
1 + 2 + 1 + 1 + 1
. . .
1 + 5
6
The 11 partitions of 6

1 + 1 + 1 + 1 + 1 + 1
2 + 1 + 1 + 1 + 1
3 + 1 + 1 + 1
. . .
3 + 3
6

The sixteen compositions of 5 are:

  • 5
  • 4 + 1
  • 3 + 2
  • 3 + 1 + 1
  • 2 + 3
  • 2 + 2 + 1
  • 2 + 1 + 2
  • 2 + 1 + 1 + 1
  • 1 + 4
  • 1 + 3 + 1
  • 1 + 2 + 2
  • 1 + 2 + 1 + 1
  • 1 + 1 + 3
  • 1 + 1 + 2 + 1
  • 1 + 1 + 1 + 2
  • 1 + 1 + 1 + 1 + 1.

Compare this with the seven partitions of 5:

  • 5
  • 4 + 1
  • 3 + 2
  • 3 + 1 + 1
  • 2 + 2 + 1
  • 2 + 1 + 1 + 1
  • 1 + 1 + 1 + 1 + 1.

It is possible to put constraints on the parts of the compositions. For example the five compositions of 5 into distinct terms are:

  • 5
  • 4 + 1
  • 3 + 2
  • 2 + 3
  • 1 + 4.

Number of compositions

[edit]
The numbers of compositions of n +1 into k +1 ordered partitions form Pascal's triangle
Using the Fibonacci sequence to count the {1, 2}-restricted compositions of n, for example, the number of ways one can ascend a staircase of length n, taking one or two steps at a time

Conventionally the empty composition is counted as the sole composition of 0, and there are no compositions of negative integers. There are 2n−1 compositions of n ≥ 1; here is a proof:

Placing either a plus sign or a comma in each of the n − 1 boxes of the array

produces a unique composition of n. Conversely, every composition of n determines an assignment of pluses and commas. Since there are n − 1 binary choices, the result follows. The same argument shows that the number of compositions of n into exactly k parts (a k-composition) is given by the binomial coefficient . Note that by summing over all possible numbers of parts we recover 2n−1 as the total number of compositions of n:

For weak compositions, the number is , since each k-composition of n + k corresponds to a weak one of n by the rule

It follows from this formula that the number of weak compositions of n into exactly k parts equals the number of weak compositions of k − 1 into exactly n + 1 parts.

For A-restricted compositions, the number of compositions of n into exactly k parts is given by the extended binomial (or polynomial) coefficient , where the square brackets indicate the extraction of the coefficient of in the polynomial that follows it.[2]

Homogeneous polynomials

[edit]

The dimension of the vector space of homogeneous polynomial of degree d in n variables over the field K is the number of weak compositions of d into n parts. In fact, a basis for the space is given by the set of monomials such that . Since the exponents are allowed to be zero, then the number of such monomials is exactly the number of weak compositions of d.

See also

[edit]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
In , a composition of a positive nn is a way of writing nn as an ordered sum of positive integers, where the order of the summands matters. For example, the compositions of 4 are 44, 3+13+1, 1+31+3, 2+22+2, 2+1+12+1+1, 1+2+11+2+1, 1+1+21+1+2, and 1+1+1+11+1+1+1. The total number of compositions of nn is 2n12^{n-1} for n1n \geq 1, which arises from a with the of the n1n-1 gaps between nn indistinguishable units, where each indicates positions for separators. Compositions differ from integer partitions, which represent the same sums but consider different orders of summands as identical. For instance, while 3+13+1 and 1+31+3 are distinct compositions of 4, they correspond to the same partition {3,1}\{3,1\}. The ordinary for the sequence of the number of compositions is n=12n1xn=x12x\sum_{n=1}^{\infty} 2^{n-1} x^n = \frac{x}{1-2x}, reflecting the structure due to the recursive nature of compositions. Beyond unrestricted compositions, the theory extends to restricted variants, such as those with parts from a specific set (e.g., odd parts or parts at most kk), which connect to numbers, tiling problems, and other sequences in . These generalizations have applications in modeling ordered structures like binary sequences and lattice paths. Compositions also arise in algebraic contexts, such as functional composition and inversion in combinatorics, linking to tree enumerations and polynomial identities.

Definition and Basics

Formal Definition

A composition of a positive integer nn is an ordered tuple of positive integers that sum to nn, where the order matters, so that distinct permutations of the summands are regarded as different compositions. For instance, both (1,2)(1,2) and (2,1)(2,1) are compositions of 3, but they are distinct. Such a composition is typically denoted by the equation n=a1+a2++akn = a_1 + a_2 + \dots + a_k, where each aia_i is a positive (ai1a_i \geq 1) and k1k \geq 1 is the number of parts (or length) of the composition. The standard definition restricts parts to positive integers; an extension permitting non-negative integers (including zeros) is termed a weak composition.

Distinction from Partitions

In , the primary distinction between compositions and partitions of a positive nn lies in the treatment of order among the summands. A composition of nn is an ordered of positive integers that sum to nn, meaning that different permutations of the same parts are considered distinct. In contrast, a partition of nn is an unordered of positive integers summing to nn, where the order of parts does not matter, and parts are typically listed in non-increasing order for uniqueness. For instance, the sequences 1+2 and 2+1 both represent compositions of 3 but correspond to the same partition {2,1}. This ordered structure in compositions lends itself to a natural bijection with placements of separators among units, often illustrated via a variant of the stars and bars theorem. Specifically, each composition of nn can be visualized by lining up nn stars (representing the units) and placing bars in the n1n-1 gaps between them to separate the parts; the positions of the bars determine the lengths of the ordered summands. For example, for n=3n=3, the stars are *** , and possible bar placements yield: *** (no bars, composition 3), |* (one bar after first star, 1+2), *| (1+2 wait, | is 2+1), and || (two bars, 1+1+1). This combinatorial representation underscores how compositions inherently encode sequential divisions, differing from partitions which abstract away such ordering. The implications of this distinction are significant: compositions enumerate more structures than partitions for n>1n > 1, as multiple ordered arrangements map to each unordered one. For n=3n=3, there are four compositions (3, 2+1, 1+2, 1+1+1) but only three partitions (3, 2+1, 1+1+1). This multiplicity arises directly from permutations of parts, leading to compositions being studied separately when order conveys meaningful structure, such as in modeling sequences of events or divisions. Compositions are thus motivated for applications where sequential order is essential, such as representing run lengths in binary strings, decompositions of words in on words, or step sizes in lattice paths, whereas partitions suit scenarios involving unordered collections like distributions or sums. This separation allows for tailored analytic tools and identities unique to each, reflecting their distinct roles in enumerative problems.

Examples and Illustrations

Integer Examples

A composition of a positive nn is an ordered of positive integers that sum to nn. For n=1n = 1, there is only one such composition: (1)(1). For n=2n = 2, the compositions are (1,1)(1,1) and (2)(2). For n=3n = 3, the compositions are (1,1,1)(1,1,1), (1,2)(1,2), (2,1)(2,1), and (3)(3); representations involving zero, such as 3+03+0, are invalid since all parts must be positive integers. For n=4n = 4, the compositions are (1,1,1,1)(1,1,1,1), (1,1,2)(1,1,2), (1,2,1)(1,2,1), (2,1,1)(2,1,1), (2,2)(2,2), (1,3)(1,3), (3,1)(3,1), and (4)(4). These cases show the number of compositions growing from 1 for n=1n=1 to 8 for n=4n=4, exhibiting a doubling trend that reflects the combinatorial choices in ordering the parts. Unlike integer partitions, where order is irrelevant and n=3n=3 has only three partitions (33, 2+12+1, 1+1+11+1+1), compositions count permutations as distinct.

Visual and Sequential Representations

One common visual representation of integer compositions employs the stars and bars method, where the integer nn to be composed is depicted as nn stars (or dots) in a horizontal row, and the parts of the composition are formed by inserting bars into the n1n-1 gaps between these stars to separate them into groups. For example, the composition 2+12+1 of n=3n=3 is visualized as **|, where the two stars before the bar represent the part 2, and the single star after represents the part 1; similarly, 1+21+2 appears as | , and 33 as *** with no bars. This approach intuitively illustrates the ordered nature of compositions by showing how the placement of bars divides the fixed sequence of stars into contiguous segments of positive length. A linear sequence view further emphasizes this by interpreting compositions as divisions of a row of nn indistinguishable beads into ordered runs, where each run corresponds to a part whose length is the number of beads in that group. For n=3n=3, the four compositions—1+1+11+1+1, 1+21+2, 2+12+1, and 33—can be seen as: three single beads separated by dividers (• | • | •), a single followed by two together (• | ••), two followed by one (•• | •), or all three undivided (•••). This bead-run analogy highlights the sequential ordering and the requirement that each part is at least one bead, providing an accessible way to enumerate and distinguish compositions without relying on numerical listing alone. Block diagrams offer another graphical method, portraying each part of a composition as a horizontal block (or rectangle) whose width equals the part's value, arranged side by side to sum visually to nn. For the composition 1+21+2 of n=3n=3, this appears as a single-unit block adjacent to a two-unit block: [■] [■■]. Extending to n=4n=4, the composition 2+1+12+1+1 is rendered as [■■] [■] [■], while 44 is a single [■■■■] block; such diagrams make the additive structure immediate and allow easy comparison of different orderings, like 2+1+12+1+1 versus 1+1+21+1+2. These representations aid in building intuition for how permutations of parts yield distinct compositions. Compositions can also be conceptualized as "words" formed over the infinite of positive integers, where the letters are the parts and their "" (numerical value) contributes to the total sum nn. In this linguistic , the composition 2+1+12+1+1 of n=4n=4 is akin to the word "211" in this alphabet, distinct from "121" or "112", underscoring the ordered aspect; for n=3n=3, the words are "111", "12", "21", and "3". This perspective connects compositions to broader combinatorial structures like sequences and strings, facilitating analysis in contexts such as random generation or pattern avoidance.

Enumeration of Compositions

Unrestricted Compositions

A fundamental result in the enumeration of compositions states that the number of unrestricted compositions of a positive nn is 2n12^{n-1}. This count can be understood through a natural with the power set of {1,2,,n1}\{1, 2, \dots, n-1\}, which has 2n12^{n-1}. Imagine nn indistinguishable units (or "stars") aligned in a row, creating n1n-1 possible gaps between them. Each subset of these gaps indicates where to insert a "break" (or "bar"), dividing the row into consecutive groups whose sizes form the parts of the composition; the empty subset yields the single-part composition (n)(n). To verify, consider small values of nn. For n=1n=1, the sole composition is (1)(1), matching 20=12^{0} = 1. For n=2n=2, the compositions are (2)(2) and (1+1)(1+1), totaling 2, as 21=22^{1} = 2. For n=3n=3, they are (3)(3), (2+1)(2+1), (1+2)(1+2), and (1+1+1)(1+1+1), totaling 4, as 22=42^{2} = 4. These examples illustrate the exponential growth: unlike the number of partitions p(n)p(n), which asymptotically behaves as 14n3exp(π2n3)\frac{1}{4n\sqrt{3}} \exp\left( \pi \sqrt{\frac{2n}{3}} \right)
Add your contribution
Related Hubs
User Avatar
No comments yet.