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]

Enumerating compositions

edit

We can enumerate the (k+1)-compositions of an integer n + 1 by first enumerating the k-combinations of the n integers 0 through n - 1. Let be the members of such a combination. Then a composition of n + 1 is given by

where

.[3]

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
  1. ^ Heubach, Silvia; Mansour, Toufik (2004). "Compositions of n with parts in a set". Congressus Numerantium. 168: 33–51. CiteSeerX 10.1.1.484.5148.
  2. ^ Eger, Steffen (2013). "Restricted weighted integer compositions and extended binomial coefficients" (PDF). Journal of Integer Sequences. 16.
  3. ^ Knuth, Donald Ervin (2005). "7.2.1.3: Generating all combinations". The art of computer programming. Upper Saddle River, NJ: Addison-Wesley. pp. 355–356. ISBN 978-0-201-03804-0.
  • Heubach, Silvia; Mansour, Toufik (2009). Combinatorics of Compositions and Words. Discrete Mathematics and its Applications. Boca Raton, Florida: CRC Press. ISBN 978-1-4200-7267-9. Zbl 1184.68373.
edit

📚 Artikel Terkait di Wikipedia

Composition

single function Composition (combinatorics), a way of writing a positive integer as an ordered sum of positive integers Composition algebra, an algebra

Combinatorics

making combinatorics into an independent branch of mathematics in its own right. One of the oldest and most accessible parts of combinatorics is graph

Stars and bars (combinatorics)

In combinatorics, stars and bars (also called sticks and stones, balls and bars, and dots and dividers) is a graphical aid for deriving certain combinatorial

List of partition topics

partition, two ways of viewing the operation of division of integers. Composition (combinatorics) Ewens's sampling formula Ferrers graph Glaisher's theorem Landau's

History of combinatorics

The mathematical field of combinatorics was studied to varying degrees in numerous ancient societies. Its study in Europe dates to the work of Leonardo

Variation

Terence Clarke Variations (Stravinsky), Igor Stravinsky's last orchestral composition written in 1963–64 Variation (Hensoukyoku), album by Akina Nakamori Les

Enumerative combinatorics

Enumerative combinatorics is an area of combinatorics that deals with the number of ways that certain patterns can be formed. Two examples of this type

Combinatorics on words

theoretical computer science. Combinatorics on words became useful in the study of algorithms and coding. Combinatorics on words is considered a relatively