ArticleslgStudy

science

Composition (combinatorics)

Composition (combinatorics) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Composition (combinatorics) rather than just read about it. In short: 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.

Composition (combinatorics) — main illustration
Composition (combinatorics) — illustration

Key takeaways

  • Composition (combinatorics) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Composition (combinatorics) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Composition (combinatorics) from memory before moving on to harder problems.

Reference excerpt

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.

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.

Examples

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

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

(1◻1◻…◻1◻1⏞n) 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 (n−1k−1). Note that by summing over all possible numbers of parts we recover 2n−1 as the total number of compositions of n:

∑k=1n(n−1k−1)=2n−1. For weak compositions, the number is (n+k−1k−1)=(n+k−1n), since each k-composition of n + k corresponds to a weak one of n by the rule

a1+a2+…+ak=n+k↦(a1−1)+(a2−1)+…+(ak−1)=n 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 (kn)(1)a∈A=[xn](∑a∈Axa)k, where the square brackets indicate the extraction of the coefficient of xn in the polynomial that follows it.

Enumerating compositions 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 c1<c2<…<ck be the members of such a combination. Then a composition of n + 1 is given by

n+1=pk+…+p1+p0 where

pk=n−ck, pk−1=ck−ck−1, …, p1=c2−c1, p0=c1+1.

Homogeneous polynomials The dimension of the vector space K[x1,…,xn]d 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 x1d1⋯xndn such that d1+…+dn=d. Since the exponents di are allowed to be zero, then the number of such monomials is exactly the number of weak compositions of d.

See also Stars and bars (combinatorics)

References

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.

External links Partition and composition calculator

Illustrations

Composition (combinatorics): Bijection between 3 bit binary numbers and compositions of 4
Bijection between 3 bit binary numbers and compositions of 4
Composition (combinatorics): The 32 compositions of 61 + 1 + 1 + 1 + 1 + 12 + 1 + 1 + 1 + 11 + 2 + 1 + 1 + 1. . .1 + 56
The 32 compositions of 61 + 1 + 1 + 1 + 1 + 12 + 1 + 1 + 1 + 11 + 2 + 1 + 1 + 1. . .1 + 56
Composition (combinatorics): The 11 partitions of 61 + 1 + 1 + 1 + 1 + 12 + 1 + 1 + 1 + 13 + 1 + 1 + 1. . .3 + 36
The 11 partitions of 61 + 1 + 1 + 1 + 1 + 12 + 1 + 1 + 1 + 13 + 1 + 1 + 1. . .3 + 36
Composition (combinatorics): The numbers of compositions of n +1 into k +1 ordered partitions form Pascal's triangle
The numbers of compositions of n +1 into k +1 ordered partitions form Pascal's triangle
Composition (combinatorics): 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
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

Worked examples

Example 1 — a first encounter with Composition (combinatorics)

Start with the simplest possible case. Write down what Composition (combinatorics) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Composition (combinatorics) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Composition (combinatorics) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Composition (combinatorics)

In research
Composition (combinatorics) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Composition (combinatorics) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Composition (combinatorics) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Integer partitions, so understanding it makes those chapters shorter.
In everyday life
Look for Composition (combinatorics) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Composition (combinatorics)” →

How to study Composition (combinatorics) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Composition (combinatorics) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Composition (combinatorics) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Composition (combinatorics) in simple terms?

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.

Why does Composition (combinatorics) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Composition (combinatorics)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Composition (combinatorics).

Tags

  • Integer partitions

Keep exploring