← back to discrete math

Additional Topics

Oscar Levin · CC BY-SA 4.0 · Discrete Mathematics: An Open Introduction, Ch. 5

Three tools that punch above their weight. Matching in bipartite graphs solves assignment problems. Ramsey theory guarantees that sufficiently large structures contain unavoidable order. Generating functions encode sequences as polynomials, turning recurrence-solving into algebra.

1 2 3 a b c perfect matching: every vertex matched

Matching in bipartite graphs

A matching is a set of edges with no shared vertices. In a bipartite graph (vertices split into two groups, edges only between groups), Hall's theorem says a perfect matching exists if and only if every subset S of one side has at least |S| neighbors on the other side.

Scheme

Ramsey theory

R(s,t) is the smallest n such that any 2-coloring of K_n's edges contains a red K_s or a blue K_t. R(3,3) = 6: among any 6 people, three are mutual friends or three are mutual strangers. The exact values grow very fast. R(5,5) is still unknown.

Scheme

Generating functions

The generating function of a sequence a_0, a_1, a_2, ... is the formal power series A(x) = a_0 + a_1*x + a_2*x^2 + .... Adding sequences adds their generating functions. Multiplication corresponds to convolution. Solving a recurrence becomes solving an algebraic equation.

Scheme

Notation reference

Math Scheme Python Meaning
R(s,t)lookup tablelookup tableRamsey number
A(x) = sum a_n x^n(a0 a1 a2 ...)[a0, a1, ...]Generating function
A*B(poly-mul a b)np.polymulConvolution / product
Hall's conditionsubset checksubset check|N(S)| ≥ |S| for all S
Neighbors

Other chapter pages

  • Grinstead Ch.10 โ€” generating functions for probability distributions
  • Levin Ch.2 โ€” recurrence relations that generating functions solve
  • Levin Ch.4 โ€” graph theory foundations for matching

Foundations (Wikipedia)

Translation notes

Levin's chapter 5 is a sampler of three deep topics. The matching verification uses Hall's condition but does not implement an augmenting-path algorithm. Ramsey theory is demonstrated by example (R(3,3) = 6) because exact computation of larger Ramsey numbers is intractable. Generating functions are represented as coefficient lists; the formal power series operations (addition, multiplication) are polynomial arithmetic. The connection between convolution and sequence multiplication ties everything together.

← Graph Theory fin ยท 5 of 5