Introduction to Sets
Combinatorics: A Comprehensive Study Guide
Sets: The Foundation of Organization
In mathematics, a set is a collection of distinct objects, called elements, grouped together. Sets are fundamental to understanding how items are organized. A set is often compared to a bag: the bag is the set, and the items inside are the elements.
Key characteristics of sets:
Orderless – The order of elements does not matter. For example, {1, 2, 3} is the same as {3, 1, 2}.
Unbounded – A set can have any number of elements, even infinitely many.
Distinct – No duplicates are allowed. A set either contains an element or it does not; repetition is irrelevant.
Well-defined – It must be clear exactly which elements belong and which do not. A set of "tall people" is vague, but a set of "people over 6 ft" is well-defined.
Sets provide the building blocks for more advanced combinatorial ideas.
Basic Counting Principles: Sum and Product Rules
The product rule and sum rule are the simplest counting tools.
Product rule (AND): If a task consists of two independent sequential choices, and there are m ways for the first and n ways for the second, then there are m×n ways overall. For example, choosing one toast (10 options) AND one drink (15 options) gives 10×15=150 possible lunches.
Sum rule (OR): If a task can be done in either one of two mutually exclusive ways, with m ways for the first and n for the second, then there are m+n total ways. For example, choosing a toast OR a drink (but not both) gives 10+15=25 options.
These rules extend to multiple choices: use multiplication for sequential "and" choices, addition for alternative "or" options.
Permutations: Arranging All Items in Order
A permutation is an ordered arrangement of all elements in a set. For n distinct items, the number of permutations is:
where n! (read "n factorial") is the product of all integers from n down to 1: n!=n×(n−1)×⋯×1. For example, arranging 10 distinct cards in a line yields 10!=3,628,800 ways.
The factorial grows quickly: 0!=1 by definition (there is exactly one way to arrange nothing).
Key idea: Permutations care about the order of every element.
Variations: Arranging Some Items in Order
A variation (or partial permutation) counts the number of ordered arrangements of p items chosen from n distinct items (p≤n). The formula is:
For instance, drawing 4 cards in order from 10 gives 10×9×8×7=5,040 ways, which equals 6!10!.
When p=n, variation becomes a full permutation: V(n,n)=0!n!=n!.
Combinations: Selecting Items Without Order
A combination counts the number of ways to choose p items from n distinct items without regard to order. The formula is:
Read as "n choose p". For example, choosing 3 pizza toppings from 10 (order does not matter) gives (310)=120 possibilities.
Why p! in the denominator? In a variation, the p chosen items can be rearranged in p! ways, but since order does not matter, we divide by p! to avoid overcounting.
Combinatorial identities:
Symmetry: (pn)=(n−pn) — choosing p items is the same as not choosing n−p items.
Pascal's identity: (pn)=(pn−1)+(p−1n−1). This is the foundation for Pascal's triangle.
Pascal's Triangle and the Binomial Theorem
Pascal's triangle is a triangular array of binomial coefficients where each entry (except the first row) is the sum of the two entries directly above it. The rows correspond to n and the columns to p (starting from 0).
Row sums: ∑p=0n(pn)=2n. This is because the sum of all combinations of any size from n items equals the number of subsets, which is 2n.
Binomial Theorem: For any real numbers a and b and non‑negative integer n:
The coefficients (pn) are called binomial coefficients and match the entries of Pascal's triangle. For example, (a+b)2=a2+2ab+b2; the coefficients 1, 2, 1 are the third row of Pascal's triangle.
Generalized Permutations and Combinations
Generalized permutations handle identical items. If we have n objects with some identical (e.g., letters in "CONSENSUS": 3 S's, 2 N's, etc.), the number of distinct permutations is:
where n1,n2,…,nk are the frequencies of each distinct type. For "CONSENSUS" (9 letters): 3!2!9!=30,240.
Generalized combinations (multinomial coefficients) count ways to partition n distinct items into k groups of fixed sizes c1,c2,…,ck (sum = n). The formula is:
For example, splitting 10 candies among 3 friends (3, 3, 4) gives 3!3!4!10!=16,800 ways. This is equivalent to the generalized permutation formula because assigning items to groups is equivalent to arranging them with group labels.
Multinomial Theorem: The expansion of (x1+x2+⋯+xk)n is:
The coefficient c1!⋯ck!n! is the multinomial coefficient. For instance, the coefficient of a3b2c6d4 in (a+b+c+d)15 is 3!2!6!4!15!=6,306,300.
Repeatable (With Repetition) Counting
When items are allowed to be repeated (infinite supply), formulas change:
Repeatable permutations (order matters, all items used): nn (choose any of n items for each of n positions).
Repeatable variations (order matters, p picks): np (each pick independent).
Repeatable combinations (order does not matter, p picks from n types): Also called combinations with repetition. The number of ways to choose p items (allow repeats) from n types is:
This can be visualized using the stars and bars method: place p indistinguishable stars (items) and n−1 bars (dividers between types). The number of arrangements of stars and bars is (n−1p+n−1). For example, ordering 12 ice creams from 5 flavors: (5−112+5−1)=(416)=1820 ways.
The Pigeonhole Principle
If kn+1 pigeons are placed into n holes, then at least one hole contains at least k+1 pigeons.
This simple principle is powerful for existence proofs.
Example: In New York City (~8.5 million people), each person has between 0 and 150,000 hairs. Since 150,000×56+1=8,400,001 < 8.5 million, by the principle at least 57 people share the same number of hairs.
Example (friendship): In any group of 6 people, there must be either 3 mutual acquaintances or 3 mutual strangers. This can be proven using the pigeonhole principle on one person’s relationships (5 others → at least 3 same category) and analyzing the subgraph.
Principle of Inclusion-Exclusion (PIE)
PIE corrects for overcounting when counting elements in the union of multiple sets.
For two sets A and B:
For three sets A,B,C:
Pattern: add sizes of single sets, subtract pairwise intersections, add triple intersections, subtract quadruple, etc., alternating signs.
Example: At a summer camp with Photography (30), Robotics (25), Drama (20), with overlaps: Photo&Robo 12, Photo&Drama 8, Robo&Drama 6, all three 4. Total students = 30+25+20−12−8−6+4=53.
Derangements
A derangement is a permutation where no element appears in its original position. For n items, the number of derangements, denoted !n (subfactorial), is:
This is derived using PIE: count all permutations, subtract those with at least one fixed element, add back those with at least two fixed, etc.
The infinite series 1−1/1!+1/2!−1/3!+… converges to e−1≈0.3679. For n>5, the approximation !n≈n!/e is over 99% accurate.
Thus, the probability that a random permutation is a derangement is about 1/e≈36.8%, essentially independent of n for large n. This means if you randomly match questions to answers, there is about a 36.8% chance that none are correct.
These core concepts — sets, counting rules, permutations, combinations, binomial theorem, pigeonhole principle, inclusion-exclusion, and derangements — form the backbone of combinatorics. Each connects to the next, building from simple counting to powerful problem-solving tools.

Ask anything
We've read this whole study set, so questions about it get the best answers.