Composition (combinatorics)

For other uses of "Composition", see Composition (disambiguation).

In mathematics, a composition of an integer n is a way of writing n as the sum of a sequence of (strictly) 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 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

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:

Compare this with the seven partitions of 5:

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

Compare this with the three partitions of 5 into distinct terms:

Number of compositions

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 is given by the binomial coefficient . Note that by summing over all possible number 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 [a + b + ... + c = n + k]  [(a  1) + (b  1) + ... + (c  1) = n].

For A-restricted compositions, the number of compositions of n into exactly k parts is given by the extended binomial (or polynomial) coefficient .[2]

See also

References

  1. Heubach, Silvia; Mansour, Toufik (2004). "Compositions of n with parts in a set" (PDF). Congressus Numerantium. 168: 33–51.
  2. Eger, Steffen (2013). "Restricted weighted integer compositions and extended binomial coefficients" (PDF). Journal of Integer Sequences. 16.

External links

This article is issued from Wikipedia - version of the 9/20/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.