# Composition (number theory)

In mathematics, a composition of a positive integer n is a way of writing n as a sum of positive integers. Two sums which differ in the order of their summands are considered to be different compositions, while they would be considered to be the same partition.

 Contents

## 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.

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

• 5
• 4+1
• 3+2.

## Number of compositions

There are 2n-1 compositions of n; conventionally there is one composition of 0, and no compositions of negative integers.

The number of compositions of n into exactly k parts is

[itex]{(n-1)! \over (k-1)!(n-k)!}[itex],

i.e. the combination "n-1 choose k-1".

• Art and Cultures
• Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
• Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
• Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
• United States (http://www.academickids.com/encyclopedia/index.php/United_States)
• World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
• Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
• Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
• Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
• Space and Astronomy
• Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)