Folioby Interconnected
Log InSign Up

Fundamentals of Counting: The Addition Principle, Multiplication Principle, Permutations, and Combinations

Starting from the addition and multiplication principles, we define and prove the formulas for permutations P(n,r), combinations C(n,r), permutations with repetition, and combinations with repetition H(n,r). We conclude with the enumeration of injections and surjections.

FO
Folio Official
March 1, 2026

1 The Addition and Multiplication Principles

Definition 1 (Addition principle).
Let A1​,A2​,…,Ak​ be finite sets that are pairwise disjoint (Ai​∩Aj​=∅ for i=j). Then
∣A1​⊔A2​⊔⋯⊔Ak​∣=∣A1​∣+∣A2​∣+⋯+∣Ak​∣.
This is called the addition principle (rule of sum).
Definition 2 (Multiplication principle).
For finite sets A1​,A2​,…,Ak​,
∣A1​×A2​×⋯×Ak​∣=∣A1​∣⋅∣A2​∣⋯∣Ak​∣.
This is called the multiplication principle (rule of product).
Remark 3.
The addition principle concerns the cardinality of a disjoint union, while the multiplication principle concerns the cardinality of a Cartesian product. The vast majority of counting arguments in combinatorics reduce to repeated applications of these two principles.

2 Permutations

Definition 4 (Permutation).
The number of ways to choose r elements from a set of n distinct elements and arrange them in a row is called the number of permutations, denoted P(n,r).
Theorem 5.
P(n,r)=n(n−1)(n−2)⋯(n−r+1)=(n−r)!n!​
Proof.
By the multiplication principle: there are n choices for the first position, n−1 for the second, and so on, down to n−r+1 choices for the r-th position. Hence P(n,r)=n(n−1)⋯(n−r+1). □
Definition 6 (Permutation with repetition).
The number of ways to choose r elements from n types with repetition allowed and arrange them in a row is nr.

3 Combinations

Definition 7 (Combination).
The number of ways to choose r elements from a set of n distinct elements without regard to order is called the number of combinations, denoted (rn​) or C(n,r).
Theorem 8.
(rn​)=r!(n−r)!n!​
Proof.
The number of ways to choose r elements and then arrange them is P(n,r). Since the same set of r elements corresponds to r! different arrangements, we have (rn​)=P(n,r)/r!=n!/(r!(n−r)!). □

4 Combinations with Repetition

Definition 9 (Combination with repetition).
The number of ways to choose r elements from n types, with repetition allowed and without regard to order, is called the number of combinations with repetition, denoted H(n,r).
Theorem 10.
H(n,r)=(rn+r−1​)
Proof.
Label the n types x1​,x2​,…,xn​, and let ai​ denote the number of times xi​ is chosen. The problem amounts to counting the number of nonneg\/ative integer solutions to a1​+a2​+⋯+an​=r. This is equivalent to the classical "stars and bars" problem: arrange r stars and n−1 bars in a row, where the bars serve as dividers. The total number of positions is r+(n−1)=n+r−1, and we must choose n−1 of them for the bars, giving (n−1n+r−1​)=(rn+r−1​). □

5 Counting Injections and Surjections

Theorem 11 (Number of injections).
Let ∣A∣=r and ∣B∣=n with r≤n. The number of injections from A to B is P(n,r)=n!/(n−r)!.
Proof.
An injection f:A→B assigns distinct elements of B to the elements of A. By the multiplication principle, this can be done in P(n,r) ways. □
Theorem 12 (Number of surjections).
Let ∣A∣=n and ∣B∣=k with n≥k. The number of surjections from A onto B is
j=0∑k​(−1)j(jk​)(k−j)n.
Proof.
We use the inclusion–exclusion principle. Write B={b1​,…,bk​} and define Si​={f:A→B∣bi​∈/Im(f)}. The set of non-surjective maps is S1​∪⋯∪Sk​. Since ∣Si1​​∩⋯∩Sij​​∣=(k−j)n, inclusion–exclusion gives the number of surjections as kn−∣S1​∪⋯∪Sk​∣=∑j=0k​(−1)j(jk​)(k−j)n. □
Example 13.
When A={1,2,3,4} and B={a,b}, the number of surjections is ∑j=02​(−1)j(j2​)(2−j)4=24−2⋅14+0=14.
CombinatoricsDiscrete MathematicsTextbookCountingPermutationsCombinations
FO
Folio Official

Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.

1 followers·107 articles
Combinatorics TextbookPart 2 of 13
Previous
Combinatorics: A Complete Summary of Definitions, Theorems, and Proofs
Next
Binomial Coefficients and the Binomial Theorem: From Pascal's Triangle to the Multinomial Theorem

Share your expertise with the world

Write articles with LaTeX support, build your audience, and earn from your knowledge.

Start Writing — It's Free

More from Folio Official

Folio Official·March 1, 2026

Recurrence Relations and Counting: Solving Linear Recurrences

We present the method of characteristic equations for solving linear recurrences with constant coefficients, treat the case of repeated roots, discuss nonhomogeneous recurrences, establish the equivalence with generating functions, and introduce matrix exponentiation and the Kitamasa method.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

The Inclusion--Exclusion Principle: Counting by Alternating Sums

We prove the inclusion--exclusion principle and apply it to derive the formula for the number of derangements D_n, Euler's totient function, the relationship between surjections and Stirling numbers of the second kind, and the M\"{o}bius inversion formula.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

Combinatorial Designs and Latin Squares: Balanced Arrangements

We define Latin squares and prove their existence, introduce mutually orthogonal Latin squares (MOLS), develop the theory of balanced incomplete block designs (BIBDs), prove Fisher's inequality, and discuss the connection with finite projective planes.

CombinatoricsDiscrete MathematicsTextbook
Folio Official·March 1, 2026

Burnside's Lemma and P\'olya Enumeration: Counting Under Symmetry

Starting from the definitions of group actions, orbits, and stabilizers, we prove Burnside's lemma (the Cauchy--Frobenius theorem), introduce the cycle index of a permutation group, and derive P\'olya's enumeration theorem. Applications to necklace and bracelet counting are given.

CombinatoricsDiscrete MathematicsTextbook