Counting Principles — Permutations and Combinations

⚡ Key Takeaways

Counting Principles — Permutations and Combinations are systematic methods for counting the number of ways to arrange or select objects without listing every possibility. Key result: order-sensitive selections of rr from nn objects number P(n,r)=n!(n−r)!P(n,r)=\frac{n!}{(n-r)!}; order-blind selections number C(n,r)=n!r!(n−r)!C(n,r)=\frac{n!}{r!(n-r)!}. Where it applies: probability, combinatorics, algebra (binomial theorem), cryptography, scheduling, and statistics. Who/when: roots in ancient Indian and Chinese mathematics; formalized by Pascal, Fermat, and Leibniz in the 17th century.

💡 The Core Insight

Every counting problem reduces to two questions: (1) Does order matter? and (2) Are repetitions allowed? The answers select one of four standard formulas. Behind all of them lies a single device — the multiplication principle — which says that independent sequential choices multiply. Permutations apply this directly; combinations apply it and then divide out the over-counting caused by indistinguishable orderings.

Formal Statement

DefinitionFundamental Counting Principles

The Addition Principle: if one task can be done in mm ways and a second, mutually exclusive, task in nn ways, then one of the two can be done in m+nm+n ways. The Multiplication Principle: if a procedure consists of a sequence of stages, with n1n_1 choices at stage 1, n2n_2 at stage 2, …, nkn_k at stage kk (each independent of earlier outcomes), then the total number of outcomes is

1
N=n1⋅n2⋅n3⋯nk=∏i=1kni\quad N = n_1 \cdot n_2 \cdot n_3 \cdots n_k = \prod_{i=1}^{k} n_i

Derivation hint: build outcomes as a tree — each stage multiplies the number of branches.

DefinitionFactorial

For a non-negative integer nn, the factorial n!n! is the number of ways to arrange nn distinct objects in a row:

2
n!=n⋅(n−1)⋅(n−2)⋯2⋅1,0!=1\quad n! = n\cdot(n-1)\cdot(n-2)\cdots 2 \cdot 1, \qquad 0! = 1

Derivation hint: apply the multiplication principle — nn choices for the first slot, n−1n-1 for the second, and so on; the empty arrangement gives 0!=10!=1. Here nn is a non-negative integer; the convention 0!=10!=1 makes later formulas consistent (there is exactly one way to arrange nothing).

DefinitionPermutations

A permutation of rr objects chosen from nn distinct objects (no repetition, order matters) is denoted P(n,r)P(n,r), nPr^nP_r, or (n)r(n)_r, and equals

3
P(n,r)=n!(n−r)!=n(n−1)(n−2)⋯(n−r+1)\quad P(n,r) = \frac{n!}{(n-r)!} = n(n-1)(n-2)\cdots(n-r+1)

Derivation hint: nn choices for the first position, n−1n-1 for the second, …, n−r+1n-r+1 for the rrth — a product of rr falling factors. Symbols: nn = total distinct objects available; rr = number selected and arranged, with 0≤r≤n0 \le r \le n.

DefinitionCombinations

A combination of rr objects chosen from nn distinct objects (no repetition, order does not matter) is denoted C(n,r)C(n,r), nCr^nC_r, or (nr)\binom{n}{r}, and equals

4
C(n,r)=(nr)=n!r! (n−r)!=P(n,r)r!\quad C(n,r) = \binom{n}{r} = \frac{n!}{r!\,(n-r)!} = \frac{P(n,r)}{r!}

Derivation hint: each unordered set of rr objects can be ordered in r!r! ways, so divide the permutation count by r!r!. Symbols: as above, with 0≤r≤n0\le r\le n. The quantity (nr)\binom{n}{r} is called a binomial coefficient.

TheoremPermutations with Repetition and Multiset Permutations

If repetition is allowed and order matters, the count of length-rr sequences from nn symbols is

5
Nrep=nr\quad N_{\text{rep}} = n^{r}

Derivation hint: each of the rr positions independently has nn choices, so multiply nn by itself rr times. If we arrange all nn objects but they fall into groups of identical items of sizes n1,n2,…,nkn_1, n_2, \dots, n_k (with n1+⋯+nk=nn_1+\cdots+n_k=n), the number of distinct arrangements is the multinomial coefficient

6
n!n1! n2!⋯nk!\quad \frac{n!}{n_1!\,n_2!\cdots n_k!}

Derivation hint: start from n!n! arrangements, then divide by ni!n_i! for each block of identical items, since permuting identical items changes nothing.

TheoremCombinations with Repetition — Stars and Bars

The number of ways to choose rr objects from nn types with repetition allowed and order irrelevant (a multiset of size rr) is

7
(n+r−1r)=(n+r−1n−1)\quad \binom{n+r-1}{r} = \binom{n+r-1}{n-1}

Derivation hint: represent a selection as rr stars separated into nn groups by n−1n-1 bars; arrange r+(n−1)r+(n-1) symbols and choose positions for the bars.

Why It Holds / Derivation

ProofDeriving P(n,r) and C(n,r) from the Multiplication Principle

Step 1. Count ordered selections. To fill rr ordered positions from nn distinct objects, the first position has nn candidates. Having used one, the second has n−1n-1, the third n−2n-2, and so on down to n−r+1n-r+1 candidates for the rrth position.

Step 2. By the multiplication principle [1], the number of ordered selections is

P(n,r)=n(n−1)⋯(n−r+1).P(n,r) = n(n-1)\cdots(n-r+1).

Step 3. Multiply and divide by (n−r)!(n-r)! to compactify:

P(n,r)=n(n−1)⋯(n−r+1)⋅(n−r)!(n−r)!=n!(n−r)!,P(n,r) = \frac{n(n-1)\cdots(n-r+1)\cdot (n-r)!}{(n-r)!} = \frac{n!}{(n-r)!},

establishing [3].

Step 4. Now remove ordering. Group all ordered selections that use the same set of rr objects. Each such set can be arranged in r!r! orders (by [2]), so every unordered selection corresponds to exactly r!r! ordered ones.

Step 5. Therefore the number of unordered selections is

C(n,r)=P(n,r)r!=n!r! (n−r)!,C(n,r) = \frac{P(n,r)}{r!} = \frac{n!}{r!\,(n-r)!},

which is [4]. ■\blacksquare

∎
ProofPascal's Rule

We show (nr)=(n−1r−1)+(n−1r)\binom{n}{r} = \binom{n-1}{r-1} + \binom{n-1}{r}.

Step 1. Fix one distinguished object, say xx, among the nn.

Step 2. Partition all rr-subsets into two classes: those that contain xx and those that do not.

Step 3. Subsets containing xx are formed by choosing the remaining r−1r-1 members from the other n−1n-1 objects: (n−1r−1)\binom{n-1}{r-1} ways.

Step 4. Subsets excluding xx are formed by choosing all rr members from the other n−1n-1 objects: (n−1r)\binom{n-1}{r} ways.

Step 5. By the addition principle these classes are disjoint and exhaustive, so summing gives the result. ■\blacksquare

∎
mathematician · Blaise Pascal | 1623–1662

The French mathematician, physicist, and philosopher Blaise Pascal systematized the arithmetic triangle of binomial coefficients in his Traité du triangle arithmétique (published 1665). Corresponding with Pierre de Fermat in 1654 over a gambling problem (the "problem of points"), Pascal helped lay the foundations of probability theory — and combinatorial counting is its backbone. Pascal's recursive construction of the triangle (each entry the sum of the two above it) is precisely Pascal's rule, and the triangle now bears his name in the Western tradition, though it was known centuries earlier in India, Persia, and China.

Building Intuition

🧠 Intuition

Think of filling slots. A permutation is like assigning runners to the gold, silver, and bronze medals: the positions are labeled, so swapping two runners gives a genuinely different outcome. A combination is like choosing a committee of three from a club: the chosen people are just a set, and reordering them changes nothing. The bridge between them is the factor r!r! — the number of ways to order the chosen group. Permutations keep those orderings as distinct; combinations collapse them into one. So you can always compute a combination by first counting ordered arrangements and then dividing away the orderings you didn't want. When deciding which tool to use, ask the two diagnostic questions and read off the formula:

Figure
Decision flow: order and repetition select the formula

```svg

Does ORDER matter? YES NO Repetition allowed? Repetition allowed? YES rep n^r NO rep P(n,r)=n!/(n-r)! YES rep C(n+r-1, r) NO rep C(n,r) PERMUTATIONS COMBINATIONS Two questions fix the formula: order? (left=yes) and repetition? (left of each pair=yes)

```

Worked Examples

ExampleForming Passwords — A Permutation Count

Given: A system requires a 4-character password using distinct letters from the 26-letter alphabet (case-insensitive, no letter repeated). How many passwords are possible? Then, how many if repetition is allowed?

Step 1 — No repetition, order matters. This is P(26,4)P(26,4):

P(26,4)=26!22!=26⋅25⋅24⋅23.P(26,4)=\frac{26!}{22!}=26\cdot25\cdot24\cdot23.

Step 2 — Evaluate. 26⋅25=65026\cdot25=650; 650⋅24=15,600650\cdot24=15{,}600; 15,600⋅23=358,80015{,}600\cdot23=358{,}800.

Step 3 — With repetition. By [5], each of 4 slots has 26 choices:

264=456,976.26^4 = 456{,}976.
P(26,4)=358,800 passwords; with repetition 456,976 passwords\boxed{P(26,4)=358{,}800 \text{ passwords; with repetition } 456{,}976 \text{ passwords}}
ExampleChoosing a Committee — A Combination Count

Given: From a club of 12 members, a committee of 5 is to be chosen. (a) How many committees are possible? (b) How many if a specific member, Alice, must serve as one of the five?

Step 1 — (a) Order does not matter. Use C(12,5)C(12,5):

C(12,5)=12!5! 7!=12⋅11⋅10⋅9⋅85!.C(12,5)=\frac{12!}{5!\,7!}=\frac{12\cdot11\cdot10\cdot9\cdot8}{5!}.

Step 2 — Evaluate. Numerator =12⋅11⋅10⋅9⋅8=95,040=12\cdot11\cdot10\cdot9\cdot8=95{,}040; denominator 5!=1205!=120.

C(12,5)=95,040120=792.C(12,5)=\frac{95{,}040}{120}=792.

Step 3 — (b) Fix Alice in, then choose the rest. With Alice guaranteed, choose the remaining 4 from the other 11:

C(11,4)=11⋅10⋅9⋅84!=792024=330.C(11,4)=\frac{11\cdot10\cdot9\cdot8}{4!}=\frac{7920}{24}=330.
(a) 792 committees;(b) 330 committees containing Alice\boxed{\text{(a) } 792 \text{ committees}; \quad \text{(b) } 330 \text{ committees containing Alice}}

Common Misconceptions

⚠️ Common mistake

Mixing up order. The single most common error is using a combination when order matters (or vice versa). Test phrases: "rank," "arrange," "schedule," "first/second/third," "password," "code" → usually permutation. "Select," "choose," "committee," "subset," "team" → usually combination. When in doubt, ask: if I swap two chosen items, do I get a different outcome? If yes, order matters.

Forgetting 0!=10!=1. This convention is not arbitrary — it makes C(n,n)=n!n! 0!=1C(n,n)=\frac{n!}{n!\,0!}=1 (there is exactly one way to choose everything) and C(n,0)=1C(n,0)=1 (one way to choose nothing) come out correctly.

Double counting in repetition problems. When repetition is allowed and order does not matter, you must use stars and bars [7], not C(n,r)C(n,r) or nrn^r.

CounterexampleWhy C(n,r)≠P(n,r)C(n,r) \ne P(n,r) for r≥2r\ge 2

Consider choosing 2 letters from {A,B,C}\{A, B, C\}.

Permutations P(3,2)=6P(3,2)=6: AB,BA,AC,CA,BC,CBAB, BA, AC, CA, BC, CB — six ordered pairs.

Combinations C(3,2)=3C(3,2)=3: {A,B},{A,C},{B,C}\{A,B\}, \{A,C\}, \{B,C\} — three unordered sets. The ratio is exactly 2!=22! = 2, because each unordered pair {X,Y}\{X,Y\} corresponds to the two orderings XYXY and YXYX. This concretely shows the division by r!r! in [4]. Treating these as equal would, for instance, double the probability of every two-element event.

Connections

connection

Counting principles are the gateway to several neighbouring areas. They feed directly into Probability, where probabilities of equally likely outcomes are ratios of counts. The combination (nr)\binom{n}{r} is the coefficient in the Binomial Theorem, linking counting to algebra: (a+b)n=∑r=0n(nr)an−rbr(a+b)^n=\sum_{r=0}^n\binom{n}{r}a^{n-r}b^r. The recursive structure of (nr)\binom{n}{r} generates Pascal's Triangle, whose patterns reveal Fibonacci numbers, powers of 2, and the hockey-stick identity. More advanced counting uses the Inclusion-Exclusion Principle to handle overlapping cases, and the multinomial coefficient [6] generalizes to the Multinomial Theorem. The whole subject is the elementary face of Combinatorics.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- c. 300 BCE – 200 CE (India): The Bhagavati Sutra and later writers compute combinations; the prosodist Pingala studies binary-like arrangements of long and short syllables, implicitly tabulating binomial coefficients.
- c. 850 CE: The Jain mathematician Mahāvīra gives an explicit rule equivalent to C(n,r)C(n,r) in his Gaṇita-sāra-saṅgraha.
- c. 1150: Bhāskara II (Līlāvatī) presents combinatorial formulas, including arrangements with repeated digits.
- 11th–13th centuries (China): Jia Xian and later Yang Hui display the arithmetic triangle (now "Yang Hui's triangle") for binomial expansion.
- c. 1320 (Persia): Al-Karaji and successors describe the triangle and the binomial expansion algebraically.
- 1654: Blaise Pascal and Pierre de Fermat exchange letters on the "problem of points," founding probability and formalizing combinatorial counting.
- 1665: Pascal's Traité du triangle arithmétique is published posthumously, systematizing binomial coefficients.
- 1666: Gottfried Wilhelm Leibniz writes Dissertatio de Arte Combinatoria, an early treatise treating combinatorics as a subject in its own right.
- 1713: Jacob Bernoulli's Ars Conjectandi consolidates permutations, combinations, and their use in probability, cementing the modern terminology.

Subtleties & Limits

open-problem

Elementary counting formulas are exact, but counting efficiently in complex settings remains deep. Enumerative combinatorics seeks closed forms or generating functions for counts that resist simple formulas — for example, the number of distinct ways to triangulate a polygon (the Catalan numbers) or to partition an integer (the partition function p(n)p(n), which has no simple closed form). In computational complexity, the problem of counting the number of solutions to a Boolean formula (the class #P) is believed to be strictly harder than merely deciding whether a solution exists, even when the decision problem is easy. Thus while C(n,r)C(n,r) is computed in moments, the general question "how many configurations satisfy these constraints?" can be intractable — a frontier connecting combinatorics, algebra, and theoretical computer science.

See Also

Probability · Binomial Theorem · Pascal's Triangle · Inclusion-Exclusion Principle · Multinomial Theorem · Combinatorics · Sets and Set Notation