DISCRETE MATH • COUNTING AND COMBINATORICS

Permutations and combinations

Systematic methods for counting ordered and unordered selections from finite sets.

Historical Context & Motivation

The art of counting arrangements and selections has fascinated mathematicians for millennia, long before the formal language of combinatorics was established. Ancient civilizations recognized that enumerating possibilities was essential for problems in divination, games of chance, and resource allocation. Indian mathematicians of the Jain tradition explored combinations in the context of philosophical classification as early as the sixth century BCE, while Chinese scholars investigated binomial coefficients centuries before their European counterparts. The intellectual thread connecting these early efforts eventually wove into the rigorous framework we employ today in discrete mathematics, probability theory, and algorithm analysis.

c. 300 BCE
Sushruta Samhita & Jain Enumeration
Indian scholars enumerate combinations of tastes and philosophical categories, recording early instances of choosing r items from n without regard to order.
1068
Bhāskara II & Līlāvatī
Bhāskara II provides explicit formulas for permutations and combinations in his mathematical treatise, including the rule n!/(r!(n−r)!) for choosing subsets.
1654
Pascal–Fermat Correspondence
Blaise Pascal and Pierre de Fermat exchange letters on the problem of points, laying the groundwork for combinatorial probability and formalizing Pascal's triangle.
1713
Bernoulli's Ars Conjectandi
Jakob Bernoulli's posthumous work systematizes the theory of permutations and combinations, connecting them rigorously to probability and the binomial theorem.
1965–present
Modern Combinatorics & Computer Science
With the rise of algorithm design and computational complexity, counting techniques become indispensable tools for analyzing data structures, cryptographic protocols, and optimization problems.

At its core, the theory of permutations and combinations addresses a deceptively simple question: in how many ways can we select or arrange objects from a given collection? The distinction between the two concepts—whether the order of selection matters—turns out to be the fundamental axis around which an enormous body of counting theory rotates. Understanding this distinction is the gateway to probability, statistical inference, algebraic combinatorics, and algorithm analysis.

Core Principles & Definitions

Before diving into formulas, it is essential to establish the foundational counting principles that underpin both permutations and combinations. The entire combinatorial framework rests on a small set of logical axioms about how independent choices compose. These principles are not merely computational shortcuts; they encode deep structural truths about finite sets and functions between them. A clear grasp of these ideas will allow you to decompose complex counting problems into manageable pieces and to recognize when a situation calls for ordered versus unordered enumeration.

1

The Multiplication Principle

If a procedure consists of k sequential stages with n₁, n₂, …, nk choices respectively, the total number of outcomes is n₁ × n₂ × … × nk. This is also called the rule of product.
2

The Addition Principle

If outcomes can be partitioned into k mutually exclusive cases with n₁, n₂, …, nk outcomes respectively, the total count is n₁ + n₂ + … + nk. This is also called the rule of sum.
3

Permutation (Order Matters)

A permutation is an ordered arrangement of objects. Selecting r items from n distinct items where sequence matters yields P(n, r) = n!/(n − r)! distinct arrangements.
4

Combination (Order Irrelevant)

A combination is an unordered selection. Choosing r items from n without regard to order yields C(n, r) = n!/(r!(n − r)!), also written as "n choose r."
5

The Factorial Function

The factorial n! = n × (n − 1) × … × 2 × 1 counts the total number of ways to arrange n distinct objects in a sequence. By convention, 0! = 1.
KEY TAKEAWAY
Think of permutations versus combinations like assigning people to labeled seats at a dinner table versus simply choosing who gets invited. In the seating problem, swapping two guests between seats produces a different arrangement—so order matters (permutation). In the invitation problem, the same group of guests constitutes the same invite list regardless of the order you wrote their names—so order does not matter (combination). Every counting problem begins with this decision: does rearranging the selected items produce a genuinely distinct outcome?

Visual Explanation

The diagram below illustrates the fundamental difference between permutations and combinations by enumerating all ways to select 2 items from the set {A, B, C}. On the left side, every ordered pair is listed—notice that (A, B) and (B, A) count as distinct permutations. On the right side, only unordered subsets appear—{A, B} and {B, A} collapse into a single combination. The factor of r! = 2! = 2 that converts P(n, r) to C(n, r) is visible as the exact ratio between the two counts: 6 permutations versus 3 combinations.

All selections of 2 items from {A, B, C}. The left panel enumerates every ordered pair (permutation), while the right panel collapses order-equivalent pairs into unordered subsets (combinations). Dividing by r! accounts for the redundant orderings.

Observe that the six permutations naturally cluster into three groups of two, where each group consists of the same two letters in opposite order. This visual clustering reveals the algebraic relationship C(n, r) = P(n, r)/r! in a concrete, finite example. As n and r grow, exhaustive listing becomes impractical, but the factorial formulas scale effortlessly—a testament to the power of the multiplication principle applied systematically.

Mathematical Framework

We now formalize the counting arguments from the previous sections into precise formulas. Each formula can be derived directly from the multiplication principle by reasoning about how many choices remain at each stage of a sequential selection process. The key insight is that permutation counts are obtained by forming a falling factorial product, and combination counts are obtained by dividing out the internal orderings of each selected subset.

FACTORIAL
n! = n × (n − 1) × (n − 2) × … × 2 × 1, with 0! = 1
The factorial of a non-negative integer n counts the total number of ways to arrange n distinct objects in a sequence. The convention 0! = 1 ensures the formulas below remain valid at boundary cases.
PERMUTATIONS (WITHOUT REPETITION)
P(n, r) = n! / (n − r)! = n × (n − 1) × … × (n − r + 1)
n = total number of distinct objects; r = number of objects chosen and arranged. The product has exactly r descending factors, reflecting r sequential choices without replacement.
COMBINATIONS (BINOMIAL COEFFICIENT)
C(n, r) = (n choose r) = n! / (r! × (n − r)!)
Dividing P(n, r) by r! removes the r! internal orderings of each selected subset. Equivalently, C(n, r) equals the number of r-element subsets of an n-element set. Symmetry property: C(n, r) = C(n, n − r).
PERMUTATIONS WITH REPETITION
n! / (n₁! × n₂! × … × n_k!) where n₁ + n₂ + … + n_k = n
When n objects include groups of identical items of sizes n₁, n₂, …, nk, the number of distinguishable arrangements is the multinomial coefficient. This generalizes both the permutation and combination formulas.
📐 Derivation Sketch
To derive P(n, r): the first position can be filled in n ways, the second in (n − 1) ways (one item used), and so on through (n − r + 1) ways for the r-th position. By the multiplication principle, the total is n(n − 1)…(n − r + 1) = n!/(n − r)!. For C(n, r), note that every r-element subset generates exactly r! permutations (one for each internal ordering). Thus C(n, r) × r! = P(n, r), yielding C(n, r) = P(n, r)/r!.

Classification of Counting Problems

Every counting problem involving selection from a set can be classified along two binary axes: whether order matters and whether repetition is allowed. These two independent choices produce a 2 × 2 taxonomy of four fundamental problem types, each with its own formula. The diagram below organizes these four cases, providing formulas and intuitive examples for each quadrant. Mastering this classification is perhaps the single most valuable skill in elementary combinatorics, because correctly identifying the problem type immediately determines which formula to apply.

A 2 × 2 taxonomy of counting problems. The rows distinguish whether order matters; the columns distinguish whether repetition is allowed. Each cell shows the formula and a concrete example with n = 5, r = 3.
Summary of the four counting scenarios
ScenarioOrder?Repetition?Formula
PermutationYesNon!/(n−r)!
r-tuple (sampling with replacement)YesYes
CombinationNoNon!/(r!(n−r)!)
Multiset (stars & bars)NoYesC(n+r−1, r)

Worked Example

Consider a university club with 12 members that must form a 5-person committee. We will compute the number of possible committees in two scenarios: (a) when specific officer roles are assigned to the selected members, and (b) when no roles are distinguished. This example crystallizes the permutation-versus-combination distinction in a single real-world setting.

Committee Selection from a 12-Member Club
1
Step 1 — Identify the Problem Type (Part a: Officers)In part (a), the 5 selected members are assigned distinct roles (President, Vice-President, Secretary, Treasurer, Liaison). Because swapping two people between different roles produces a distinct outcome, order matters. This is a permutation problem with n = 12 and r = 5.
2
Step 2 — Apply the Permutation FormulaP(12, 5) = 12!/(12 − 5)! = 12!/7!. Expanding the falling factorial: 12 × 11 × 10 × 9 × 8.
P(12, 5) = 95,040
3
Step 3 — Identify the Problem Type (Part b: Unranked Committee)In part (b), the committee has no officer positions—any set of the same 5 people is considered the same committee regardless of the order in which they were chosen. Order is irrelevant, so this is a combination problem.
4
Step 4 — Apply the Combination FormulaC(12, 5) = 12!/(5! × 7!). We can compute this as P(12, 5)/5! = 95,040/120.
C(12, 5) = 792
5
Step 5 — Verify the RelationshipAs expected, P(12, 5) = C(12, 5) × 5!. That is, 95,040 = 792 × 120. The factor of 5! = 120 corresponds to the 120 ways to assign 5 distinct officer roles among the 5 chosen members. This confirms the general identity P(n, r) = C(n, r) × r! and illustrates how combinations can be viewed as permutations with order "factored out."
95,040 = 792 × 120 ✓ Verified

Permutations vs. Combinations — When to Use Each

Students often struggle not with the formulas themselves but with deciding which formula applies to a given situation. The table below provides a diagnostic framework: for each problem trait, it lists whether you should reach for a permutation formula or a combination formula. The critical question always reduces to whether two arrangements that differ only in the ordering of the same elements count as distinct outcomes in the problem's context.

Decision guide for selecting permutation vs. combination formulas
FeaturePermutation (P)Combination (C)
Order sensitivityRearranging elements produces a new outcomeRearranging elements does not produce a new outcome
Keywords"arrange," "rank," "schedule," "assign roles," "password""choose," "select," "committee," "subset," "hand (cards)"
FormulaP(n,r) = n!/(n−r)!C(n,r) = n!/(r!(n−r)!)
Relative sizeAlways ≥ C(n,r) (larger by a factor of r!)Always ≤ P(n,r)
ExampleChoosing and ordering 3 runners for gold, silver, bronze from 10 athletesChoosing 3 members for a jury panel from 10 candidates
KEY TAKEAWAY
A useful litmus test: after you select your items, ask "would shuffling them change anything?" If you are filling labeled slots (positions on a podium, characters in a string, roles on a team), shuffling matters—use a permutation. If you are filling an unlabeled bag (a hand of cards, a subset for analysis, a sample of test subjects), shuffling changes nothing—use a combination. This "slots vs. bag" heuristic resolves the majority of introductory counting problems.

Connections to Advanced Theory

Permutations and combinations are the entry point to a vast landscape of combinatorial identities and algebraic structures. The binomial theorem, which states (x + y)n = Σ C(n, k) xk yn−k, directly expresses the expansion coefficients as combinations. Beyond the binomial theorem, the same counting principles underpin Pascal's identity C(n, r) = C(n − 1, r − 1) + C(n − 1, r), the Vandermonde identity, and connections to generating functions and group theory via the symmetric group Sn.

How elementary counting concepts extend into advanced combinatorics and algebra
Elementary ConceptAdvanced Extension
P(n, r) — permutations of distinct objectsSymmetric group Sn, cycle notation, Burnside's lemma
C(n, r) — binomial coefficientsBinomial theorem, generating functions, Pascal's triangle identities
Multinomial coefficientMultinomial theorem, partition theory, Young tableaux
Multiset (stars & bars)Integer partitions, Pólya enumeration, lattice path counting
Inclusion-exclusion with combinationsMöbius inversion on partially ordered sets, derangements, Euler's totient

In probability theory, combinations are essential for computing probabilities in finite sample spaces (e.g., poker hands, lottery draws, hypergeometric distributions). In computer science, permutation counts appear in the analysis of sorting algorithms (the number of possible input orderings is n!), while combinations underlie combinatorial optimization and error-correcting codes. As you advance through discrete mathematics and abstract algebra, you will find that the humble formula n!/(r!(n − r)!) serves as the foundation for structures of remarkable depth and beauty.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why C(n, r) is always a positive integer, even though the formula n!/(r!(n − r)!) involves division. Your explanation should appeal to a combinatorial argument rather than algebraic manipulation.
PROBLEM 2BASIC CALCULATION
A standard combination lock has 3 dials, each with digits 0 through 9. The code is an ordered sequence of 3 digits where repetition is allowed. How many distinct codes are possible? Is this a permutation, combination, or neither in the strict sense?
PROBLEM 3INTERMEDIATE
From a standard 52-card deck, how many 5-card poker hands contain exactly 3 hearts and 2 spades?
PROBLEM 4APPLIED
A software team of 10 engineers must form a sub-team of 4 to tackle a critical bug, where one member serves as team lead, one as code reviewer, and the remaining two are general developers (interchangeable). How many ways can the sub-team be configured?
PROBLEM 5CRITICAL THINKING
Prove the Vandermonde identity combinatorially: C(m + n, r) = Σk=0r C(m, k) × C(n, r − k). Your proof should describe a concrete counting scenario counted in two different ways.

Summary & Key Concepts

Permutations and combinations provide the foundational toolkit for counting structured selections from finite sets. The multiplication principle and addition principle underpin all counting arguments. A permutation counts ordered arrangements: P(n, r) = n!/(n − r)!, while a combination counts unordered selections: C(n, r) = n!/(r!(n − r)!). The relationship P(n, r) = C(n, r) × r! captures the fact that each unordered subset can be internally arranged in r! ways. The factorial function n! is the backbone of both formulas, and the convention 0! = 1 ensures consistency at boundary cases.

Beyond the two basic formulas, the four-quadrant classification—distinguishing order vs. no order and repetition vs. no repetition—organizes all elementary counting problems into permutations, r-tuples, combinations, and multisets. These ideas extend naturally into the binomial theorem, Pascal's identity, generating functions, and the symmetric group. Mastery of permutations and combinations is essential for probability, algorithm analysis, and every subsequent topic in combinatorics.

Varsity Tutors • Discrete Math • Permutations and combinations