Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Discrete Mathematics II — Combinatorics

Counting arguments, arrangements, and distributions — the strategy layer above the formulas Discrete Mathematics I introduced, on the way to generating functions and graph enumeration.

Free to read now, no account needed: Readiness: the counting toolkit. Create a free account to open the other chapters, take the quizzes and keep your progress.

1 Counting strategies 🔒

Create a free account to open this chapter.

  • Modeling a counting question ~9 min
  • Distinguishable versus identical objects ~9 min
  • Counting by cases ~9 min
  • Avoiding double counting ~9 min
  • Overcounting and dividing out ~9 min
  • Double counting as a technique ~9 min
  • Counting by bijection ~9 min
  • Constructing the pigeonhole boxes ~9 min
  • Sanity-checking a count ~8 min
  • Assembling a counting argument ~10 min

2 Arrangements, selections, and distributions 🔒

Create a free account to open this chapter.

  • Permutations of a multiset ~9 min
  • Circular arrangements ~8 min
  • Necklaces and reflection symmetry ~9 min
  • Selections with repetition ~9 min
  • Stars and bars with bounds ~9 min
  • Compositions of an integer ~8 min
  • Lattice paths ~8 min
  • Catalan numbers ~9 min
  • The distribution taxonomy ~9 min
  • Choosing an arrangement model ~9 min

3 Binomial and multinomial coefficients 🔒

Create a free account to open this chapter.

  • Pascal's identity revisited ~9 min
  • The binomial theorem generalized ~9 min
  • Vandermonde's identity ~9 min
  • The hockey-stick identity ~8 min
  • Absorption and subset identities ~8 min
  • Combinatorial proof of binomial identities ~9 min
  • Multinomial coefficients revisited ~9 min
  • The multinomial theorem ~9 min
  • Counting multinomial expansion terms ~8 min
  • Symmetric identities from the binomial theorem ~8 min
  • Choosing an identity-proving strategy ~9 min

4 Inclusion-exclusion 🔒

Create a free account to open this chapter.

  • The two-set formula revisited ~8 min
  • Three or more sets ~9 min
  • The general inclusion-exclusion formula ~9 min
  • Proving inclusion-exclusion by counting ~8 min
  • Counting with forbidden positions ~8 min
  • The sieve viewpoint ~7 min
  • Derangements ~9 min
  • Counting surjections by inclusion-exclusion ~8 min
  • Euler's totient by inclusion-exclusion ~8 min
  • Choosing when inclusion-exclusion pays off ~8 min

5 Counting functions and set partitions 🔒

Create a free account to open this chapter.

  • Functions between finite sets, counted ~8 min
  • Counting injective functions ~8 min
  • Counting surjective functions ~9 min
  • Stirling numbers of the second kind ~8 min
  • The recurrence for Stirling numbers ~9 min
  • Set partitions and Stirling numbers ~9 min
  • Bell numbers ~8 min
  • The Bell number recurrence ~9 min
  • Counting equivalence relations ~8 min
  • Choosing among function, partition, and relation counts ~8 min

6 Combinatorial proof 🔒

Create a free account to open this chapter.

  • What a combinatorial proof requires ~8 min
  • Proving Pascal's identity combinatorially ~8 min
  • Proving the hockey-stick identity combinatorially ~8 min
  • Proving a subset-sum identity combinatorially ~8 min
  • Bijective proof as a technique ~8 min
  • Building a bijection between two counted sets ~9 min
  • Algebraic versus combinatorial proof ~8 min
  • When a combinatorial proof is the clearer proof ~8 min
  • Constructing your own combinatorial proof ~9 min

7 Solving recurrence relations 🔒

Create a free account to open this chapter.

  • First-order linear recurrences ~9 min
  • Nonhomogeneous recurrences ~8 min
  • Particular solutions by undetermined coefficients ~9 min
  • The characteristic equation revisited ~9 min
  • Repeated characteristic roots ~8 min
  • Complex characteristic roots, a first look ~8 min
  • Recurrences from counting problems ~9 min
  • Verifying a closed form by induction ~8 min
  • Recurrence versus closed form ~7 min
  • Recursion trees for recurrences ~8 min
  • Choosing a recurrence-solving method ~8 min

8 Divide-and-conquer recurrences 🔒

Create a free account to open this chapter.

  • Divide-and-conquer algorithms as recurrences ~8 min
  • The recursion-tree method ~9 min
  • The iteration/unrolling method ~9 min
  • The master theorem ~9 min
  • Master theorem case 1: leaves dominate ~8 min
  • Master theorem case 2: balanced levels ~8 min
  • Master theorem case 3: the root dominates ~8 min
  • Binary search and merge sort as recurrences ~8 min
  • Comparing recurrence-solving methods ~8 min

9 Generating functions 🔒

Create a free account to open this chapter.

  • Ordinary generating functions defined ~8 min
  • From sequence to generating function ~8 min
  • From generating function to sequence ~8 min
  • The algebra of generating functions ~9 min
  • The generating function for a geometric sequence ~8 min
  • Solving recurrences with generating functions ~9 min
  • The Fibonacci generating function ~9 min
  • Generating functions for counting problems ~9 min
  • The generating function for compositions ~9 min
  • Generating functions and the binomial theorem ~8 min
  • Choosing a technique: recurrence or generating function ~8 min

10 Integer partitions 🔒

Create a free account to open this chapter.

  • What an integer partition is ~8 min
  • Ferrers diagrams ~7 min
  • Conjugate partitions ~8 min
  • The partition function ~8 min
  • Partitions into distinct parts ~8 min
  • Partitions into odd parts ~7 min
  • Generating functions for partitions ~9 min
  • A partition identity proved bijectively ~9 min
  • Restricted partitions ~8 min

11 Graph enumeration and spanning trees 🔒

Create a free account to open this chapter.

  • Counting labeled graphs ~8 min
  • Counting simple graphs by degree ~8 min
  • Regular graphs ~8 min
  • Degree sequences and graphical sequences ~8 min
  • Counting the spanning trees of a small graph ~9 min
  • Cayley's formula, stated ~8 min
  • A bijective flavor of Cayley's formula ~9 min
  • The matrix-tree theorem, stated ~9 min
  • Counting trees versus counting graphs ~8 min
  • Choosing an enumeration approach ~8 min

12 Matchings, coloring, and extremal structure 🔒

Create a free account to open this chapter.

  • Bipartite graphs ~8 min
  • Matchings ~8 min
  • Maximum matchings ~8 min
  • Hall's marriage theorem ~9 min
  • Applications of Hall's theorem ~8 min
  • Graph coloring ~8 min
  • The chromatic number ~9 min
  • Chromatic polynomials ~9 min
  • Counting proper colorings ~8 min
  • Independent sets and cliques ~8 min
  • Extremal counting: how large can a structure be ~9 min