Math 2.0

Combinatorics Proof

Proof of the number of compositions by partial sums

Builds on Composition of an integerBijective iff it has a two-sided inverseBijection principleNumber of subsets of a finite set

Proof

We give a bijection between compositions of nn and subsets of {1,…,n−1}\set{1, \dots, n-1}.

  1. Let n≥1n \ge 1. Let 𝒞\mathcal{C} be the set of compositions of nn, and let 𝒮\mathcal{S} be the set of subsets of {1,…,n−1}\set{1, \dots, n - 1}.
  2. Let (a1,…,ak)∈𝒞(a_1, \dots, a_k) \in \mathcal{C}. Then k≥1k \ge 1, because the empty sequence has sum 0≠n0 \ne n.
  3. Put si=a1+⋯+ais_i = a_1 + \dots + a_i for 0≤i≤k0 \le i \le k. Then s0=0s_0 = 0 and sk=ns_k = n.
  4. Since each ai≥1a_i \ge 1, we have s0<s1<⋯<sks_0 < s_1 < \dots < s_k. Hence {s1,…,sk−1}\set{s_1, \dots, s_{k-1}} is a subset of {1,…,n−1}\set{1, \dots, n-1}.
  5. Define Φ(a1,…,ak)={s1,…,sk−1}∈𝒮\Phi(a_1, \dots, a_k) = \set{s_1, \dots, s_{k-1}} \in \mathcal{S}.
  6. Let S∈𝒮S \in \mathcal{S} have elements t1<⋯<tjt_1 < \dots < t_j. Put t0=0t_0 = 0 and tj+1=nt_{j+1} = n, so t0<t1<⋯<tj+1t_0 < t_1 < \dots < t_{j+1}.
  7. Define Ψ(S)=(t1−t0,t2−t1,…,tj+1−tj)\Psi(S) = (t_1 - t_0, t_2 - t_1, \dots, t_{j+1} - t_j). Its entries are positive integers, and they sum to tj+1−t0=nt_{j+1} - t_0 = n. So Ψ(S)∈𝒞\Psi(S) \in \mathcal{C}.
  8. Let (a1,…,ak)∈𝒞(a_1, \dots, a_k) \in \mathcal{C}. The elements of Φ(a1,…,ak)\Phi(a_1, \dots, a_k) in increasing order are s1<⋯<sk−1s_1 < \dots < s_{k-1}, by step 4.
  9. So Ψ(Φ(a1,…,ak))=(s1−s0,…,sk−sk−1)=(a1,…,ak)\Psi(\Phi(a_1, \dots, a_k)) = (s_1 - s_0, \dots, s_k - s_{k-1}) = (a_1, \dots, a_k).
  10. Let S={t1<⋯<tj}∈𝒮S = \set{t_1 < \dots < t_j} \in \mathcal{S}. The partial sums of Ψ(S)\Psi(S) are t1,…,tj+1t_1, \dots, t_{j+1}, because the differences telescope.
  11. So Φ(Ψ(S))={t1,…,tj}=S\Phi(\Psi(S)) = \set{t_1, \dots, t_j} = S.
  12. Thus Φ\Phi and Ψ\Psi are inverse maps, and Φ\Phi is a bijection from 𝒞\mathcal{C} to 𝒮\mathcal{S}.
  13. The set {1,…,n−1}\set{1, \dots, n-1} has n−1n - 1 elements. By the number of subsets of a finite set, ∣𝒮∣=2n−1\abs{\mathcal{S}} = 2^{n-1}.
  14. By the bijection principle, ∣𝒞∣=2n−1\abs{\mathcal{C}} = 2^{n-1}.

Idea

Write nn as a row of nn ones. A composition is the same as a choice of the places where we cut the row. There are n−1n - 1 gaps between the ones, and each gap is cut or not. The cut positions are exactly the partial sums a1+⋯+aia_1 + \dots + a_i with i<ki < k.

Reading path

To understand this page from the ground up, read these 47 pages in order. The foundations come first. The path takes the proofs Proof that a composition of injections is injective, Proof that a function is bijective iff it has a two-sided inverse, Proof of the number of subsets of a finite set by indicator functions, Proof of the rule of product, Proof of the number of functions between finite sets, Proof that a composition of surjections is surjective, Proof of the rule of sum, Proof of the bijection principle.

  1. Cardinality of a finite set definition
  2. Composition of an integer definition
  3. Element definition
  4. Proposition concept
  5. Set definition
  6. Conjunction definition
  7. Implication definition
  8. Predicate definition
  9. Empty set object
  10. Ordered pair definition
  11. Intersection definition
  12. Existential quantifier definition
  13. Universal quantifier definition
  14. Cartesian product definition
  15. Disjoint sets definition
  16. Subset definition
  17. Uniqueness quantifier definition
  18. Binary relation definition
  19. Power set definition
  20. Function definition
  21. Codomain definition
  22. Function composition definition
  23. Identity function definition
  24. Injective function definition
  25. Indicator function definition
  26. Restriction of a function definition
  27. Surjective function definition
  28. Left inverse definition
  29. Right inverse definition
  30. Proof that a composition of injections is injective proof
  31. Proof that a composition of surjections is surjective proof
  32. Bijective function definition
  33. Composition of injections is injective statement
  34. Composition of surjections is surjective statement
  35. Proof of the rule of sum proof
  36. Proof that a function is bijective iff it has a two-sided inverse proof
  37. Rule of sum statement
  38. Bijective iff it has a two-sided inverse statement
  39. Proof of the rule of product proof
  40. Proof of the bijection principle proof
  41. Rule of product statement
  42. Bijection principle statement
  43. Proof of the number of functions between finite sets proof
  44. Number of functions between finite sets statement
  45. Proof of the number of subsets of a finite set by indicator functions proof
  46. Number of subsets of a finite set statement
  47. Proof of the number of compositions by partial sums proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Composition_(combinatorics), Number of compositions
About this page
TagC9H2SC7D3T
URIm2://C9H2SC7D3T
Kindproof
WritingW0 stub
MSC05A17
ProvesNumber of compositions
UsesComposition of an integer, Bijective iff it has a two-sided inverse, Bijection principle, Number of subsets of a finite set
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.