A sample of the random graph G(900, p) with average degree 1.4, drawn with a spring layout: one large tree-like component in black in the middle, surrounded by many isolated vertices and tiny grey components
Unit 11 · Advanced and Advanced + Ramsey Theory · 85 min

Random Graphs

Coin-flip graphs, sharp thresholds, the giant component, and the probabilistic method
Image: Own rendering of a sample of G(900, 1.4/900) with its giant component in black

The probability toolkit from scratch: expectation and its linearity, indicator variables, the union bound, Markov's inequality, and the first moment method. The random graph G(n, p) of Erdős, Rényi, and Gilbert, the threshold at which triangles appear, the connectivity threshold at which the last isolated vertex disappears, and the sudden birth of a giant component when the average degree passes 1, explained by a branching process. The probabilistic method then proves that graphs of any girth and chromatic number exist without describing one, and gives the Caro and Wei bound and a dominating set bound.

Preview: the beginning of the unit

Every graph in the first ten units was given: drawn on the page, defined by a rule, or built by an algorithm. This unit lets chance build the graph. For each pair of vertices a coin is flipped, and the pair becomes an edge when the coin shows heads. The graph that results is random, and yet almost everything about it can be predicted: how many edges and triangles it has, when its first triangle appears, when a single component swallows most of the vertices, and when the last isolated vertex disappears. Each of these events happens suddenly, at a sharply defined value of the probability of heads, and the mathematics behind the suddenness is the subject of the first five sections. The sixth turns the coin into a tool of proof. Some graphs are easy to prove to exist and impossible to draw, and the random graph is the way to reach them.

1 Probability on finite sets

Everything in this unit happens in a finite sample space \(\Omega\), a finite set of outcomes, in which each outcome \(\omega\) has a probability \(\Pr(\omega) \ge 0\) and the probabilities add up to 1. For a fair coin flipped once the outcomes are heads and tails with probability \(1/2\) each; for a coin flipped \(N\) times they are the \(2^N\) sequences of heads and tails, each with probability \(2^{-N}\). An event is a subset \(A \subseteq \Omega\), and its probability \(\Pr(A)\) is the sum of the probabilities of its outcomes. Two events \(A\) and \(B\) are independent when \(\Pr(A \cap B) = \Pr(A)\Pr(B)\), which is what one expects of two coins that do not influence each other. Where a coin shows heads with probability \(p\), the probability that \(N\) independent flips show a given sequence with \(k\) heads is \(p^k (1-p)^{N-k}\), because the flips are independent and each contributes its own factor.

A random variable \(X\) is a function from \(\Omega\) to the real numbers, that is, a number that depends on the outcome, such as the number of heads in \(N\) flips. Its expectation is the weighted average \begin{equation} \mathbb{E}[X] = \sum_{\omega \in \Omega} \Pr(\omega)\, X(\omega) . \label{eq:expectation} \end{equation} The expectation of a sum is the sum of the expectations, \(\mathbb{E}[X + Y] = \mathbb{E}[X] + \mathbb{E}[Y]\), which follows at once from Equation \eqref{eq:expectation} by splitting the sum, and the same holds for any number of summands. This property is called linearity of expectation, and it holds whether or not the summands are independent, a fact that carries most of this unit. The most useful summands are the indicator variables. For an event \(A\), the indicator \(\mathbf{1}_A\) equals 1 when \(A\) happens and 0 when it does not, so its expectation is \(1 \cdot \Pr(A) + 0 \cdot \Pr(\text{not } A) = \Pr(A)\). A count of objects of some kind is a sum of indicators, one per candidate object, and linearity turns its expectation into a sum of probabilities.

To see the method at work before any graph appears, flip a fair coin ten times and count the pairs of consecutive flips that both show heads. There are nine pairs of consecutive positions (the first and second flip, the second and third, and so on up to the ninth and tenth), and each pair shows two heads with probability \(1/4\). Neighbouring pairs share a flip and are far from independent, but linearity does not require independence, so the expected count is \(9/4 = 2.25\).

Two inequalities turn expectations into statements about probabilities. The first says that the probability that at least one of several events happens is at most the sum of their probabilities. This is the union bound, and it is an equality only when the events cannot happen together. The second was found by Andrey Markov (1856-1922) and bounds the probability that a non-negative random variable is large.