Logic

The graph that coin tosses always make

Take infinitely many vertices and toss a coin for every pair to decide whether they are joined. The result is random in every detail — and, with probability one, it is always the same graph. The same graph can be written down without any coins, by joining two numbers when one binary digit of the larger is a one.

Worth reading first: Two lists that are one order · Nearly always, or nearly never.

Two lists that are one order found that the countable orders which are dense and have no ends are all one order, relabelled, by matching two lists in a zigzag that kept every comparison. The zigzag used exactly one property of dense orders: whatever finite part had been matched, any new element could be answered on the other side, in the right gap. That property is not special to orders. This essay finds it in a graph, and the graph turns out to be the one that randomness produces.

Take the whole numbers as vertices, and for every pair of them toss a fair coin: heads they are joined, tails they are not. Infinitely many independent coin tosses, a graph that is random in every detail. Do it again with fresh coins and every edge may come out differently. And yet, as Paul Erdős and Alfréd Rényi proved in 1963, the two graphs are, with probability one, isomorphic — the same graph, with the vertices relabelled.

The graph they always make can also be written down with no coins at all. The figure below is the start of it: join two whole numbers i<ji < j when the ii-th binary digit of jj is a one. So 3=1123 = 11_2 is joined to 00 and 11; 12=1100212 = 1100_2 is joined to 22 and 33. Wilhelm Ackermann used this relation in 1937 to code finite sets as numbers, and Richard Rado showed in 1964 that it defines a graph with a remarkable property. It is called Rado’s graph, or simply the random graph.

The first 16 vertices of Rado's graph, joined by binary digits. Adjacency table and circular drawing of the Rado graph on vertices 0 to 15, where i < j are adjacent when bit i of j is 1; 32 edges.
Fig. 1 The first sixteen whole numbers, with i joined to j whenever the i-th binary digit of j is one — the start of Rado’s graph.

The one property that matters

The property is the graph’s version of density.

For any two finite disjoint sets of vertices UU and VV, there is a vertex joined to every vertex of UU and to no vertex of VV. Call a vertex like that a witness for the request (U,V)(U, V).

In Rado’s graph a witness can be written down. Let mm be the largest number in UU or VV, and take

z=2m+1+∑u∈U2u.z = 2^{m+1} + \sum_{u \in U} 2^u.

Its binary digits are ones exactly at the positions in UU and at position m+1m + 1, and zeros at every position in VV. Since zz is larger than everything in UU and VV, whether it is joined to each of them is read off its own digits — joined to UU, not to VV.

A vertex joined to exactly the ones required, for every finite request. Witnesses for the extension property of the Rado graph: U={0}, V={1}: 5 (smallest 5); U={1,2}, V={0}: 14 (smallest 6); U={0,3}, V={1,2}: 25 (smallest 9); U={2}, V={0,1,3}: 20 (smallest 4); U={0,1,2}, V={4}: 39 (smallest 7).
Fig. 2 Requests “a vertex joined to all of U and none of V” in Rado’s graph, with the witness the rule supplies — its binary digits are ones exactly at U — and the smallest witness, found by search. Each is checked edge by edge.

The figure checks five requests and the witnesses the formula gives, and also finds the smallest witness for each by search: usually far smaller than the formula’s, since smaller numbers can satisfy the request through the digits of the larger vertices in UU and VV. What matters is not the size of the witness but that one always exists.

Why coin tosses produce it

Now the coins. Fix a request: a set UU of aa vertices to be joined to and a set VV of bb vertices to avoid. For any other vertex zz, the chance that zz is joined to all of UU and none of VV is 2−(a+b)2^{-(a+b)}, and these events are independent for different zz. So the chance that none of the next nn vertices is a witness is (1−2−(a+b))n(1 - 2^{-(a+b)})^n, which goes to nought.

A coin-toss graph answering every request, as vertices are added. Share of 960 extension requests answered among the first n vertices of a random graph: 10: 0.0%, 20: 80.7%, 40: 98.9%, 80: 100.0%, 160: 100.0%, 320: 100.0%.
Fig. 3 A graph whose edges were chosen by tossing a fair coin for each pair. Of the 960 requests that name three vertices among the first ten, the share answered by some vertex among the first n, as n grows: every request is answered by the time three hundred and twenty vertices are available.

Each request fails with probability nought, and there are only countably many requests — finite subsets of a countable set — so with probability one every request has a witness. The random graph has the extension property almost surely. The figure watches this happen in a finite piece: requests about three of the first ten vertices, answered by later ones, with the share answered climbing to all of them.

Nothing about a fair coin was used except that the chance of a witness was positive. With a coin that comes up heads one time in a hundred, or ninety-nine times in a hundred, each request’s chance is still positive and the same argument works. The random graph is the same graph for every edge probability strictly between nought and one. A graph with almost every edge present and a graph with almost none, built the same way, are isomorphic — which makes sense only because each has infinitely many vertices, and what an infinite graph “looks like” is decided by its extension property, not by its density.

One zigzag, one graph

The extension property is all the zigzag needs.

The first steps of an isomorphism between Rado's graph and a coin-toss graph. 8 back-and-forth matchings between the Rado graph and a random graph on 3000 vertices: 0↔0, 1↔1, 2↔5, 4↔2, 3↔36, 23↔3, 5↔31, 56↔4, preserving all edges among matched vertices.
Fig. 4 The zigzag between Rado’s bit graph (above) and a coin-toss graph on 3,000 vertices (below). Each new vertex on one side is matched to the first vertex on the other that is joined to exactly the right earlier ones, which the extension property guarantees exists. After eight steps the matched vertices span the same graph on both sides, edge for edge.

Match the two graphs step by step, as the orders were matched. At a forth step take the next unmatched vertex of the first graph; it is joined to some of the already-matched vertices and not to others, so look on the other side for a vertex joined to exactly the partners of the first kind and none of the second — a witness for a finite request, which exists. At a back step do the same the other way. Every finite matching keeps edges and non-edges, which the figure checks pair by pair, and every vertex is eventually matched, so the union is an isomorphism.

So any two countable graphs with the extension property are isomorphic. The coin-toss graph has it with probability one; the bit graph has it outright; so the coin-toss graph is, with probability one, the bit graph. The same argument shows any two coin-toss graphs are isomorphic to each other. Randomness in every detail, and a single outcome. It is one of the few places in mathematics where a random construction produces a specific, nameable object rather than a typical member of a family.

The parallel with dense orders is exact. There, the property was “any finite configuration of matched elements can be extended by one more element in any gap”, and here it is “any finite configuration of vertices can be extended by one more vertex with any pattern of joins”. In both cases a structure with the property is unique among countable ones, and in both cases the uniqueness is proved by the same alternating matching.

Every graph is inside it

The extension property also makes Rado’s graph contain every finite graph, and every countable one.

The Petersen graph, found vertex by vertex inside a coin-toss graph. The Petersen graph drawn with each vertex labelled by the vertex of a random graph it is placed at: 0, 2, 3, 1, 9, 14, 19, 91, 423, 52.
Fig. 5 The Petersen graph found inside a coin-toss graph on 3,000 vertices: its vertices are placed one at a time, each at the first vertex joined to exactly the right earlier ones, and the ten chosen vertices are joined exactly as Petersen’s are, checked pair by pair.

To find a copy of a given graph, place its vertices one at a time. Each new vertex must be joined to some of those already placed and not to the others — a finite request — so a witness can be chosen, and the copy grows without ever getting stuck. The figure places the ten vertices of Petersen’s graph this way and checks that the chosen vertices are joined exactly as Petersen’s are. Continued for ever, the same greedy placement copies any countable graph into Rado’s graph, each vertex’s joins to earlier vertices a finite request.

The figure uses a coin-toss graph rather than the bit graph, for a practical reason worth knowing. In the bit graph the witnesses the rule supplies are powers of two beyond everything chosen so far: a greedy search for Petersen’s graph there picks vertices up to 1,552 within nine steps, the tenth needs a witness beyond fifty million, and the rule’s own witness for it has more than fifteen hundred binary digits. The bit graph is a convenient definition and a terrible place to search. The coin-toss graph on three thousand vertices, which almost surely looks like the bit graph in every finite respect that matters here, has small witnesses everywhere.

A graph no finite damage can hurt

The extension property is about finite requests, and it survives any finite change.

Rado's graph with 6 vertices deleted, still answering every request. Extension-property witnesses in the Rado graph after deleting vertices 0 to 5: U={6}, V={7}: rule 320, smallest 64; U={7,8}, V={6}: rule 896, smallest 384; U={6,9}, V={7,8}: rule 1600, smallest 576; U={10}, V={6,8,9}: rule 3072, smallest 1024.
Fig. 6 Rado’s graph with its first six vertices deleted. Requests about the vertices that remain are still answered by vertices that were never deleted — the rule’s witness is always larger than every vertex named, and the smallest surviving one is found by search.

Delete finitely many vertices: every request about the remaining vertices still has infinitely many witnesses, since the rule produces witnesses beyond any bound, and only finitely many were deleted. So what remains has the extension property and is Rado’s graph again. Add or remove finitely many edges: a request can be spoiled only if its witness touched one of the changed edges, and there are witnesses beyond every changed vertex. Rado’s graph again. Take the complement, joining exactly the pairs that were not joined: the extension property is symmetric in UU and VV, so the complement has it too. Rado’s graph again.

A stronger form holds. Split the vertices of Rado’s graph into two parts, any way at all. At least one of the parts, as a graph on its own, is Rado’s graph. The graph is indivisible: it cannot be cut into two pieces both of which have lost what makes it itself. It shares that property with the rationals, whose any two-part split leaves a part containing a copy of the rationals, and the resemblance is not an accident — both are the unique countable structures that are universal and homogeneous, containing every finite configuration and looking the same around every one.

Sets written in binary

Ackermann’s reason for the binary rule had nothing to do with graphs. He wanted to show that the finite part of set theory — the sets built from the empty set by collecting finitely many sets already built — could be coded by whole numbers, and the binary digits record the membership. The number 00 stands for the empty set; the number jj stands for the set whose members are the numbers ii at whose positions jj has a binary one. So 11 stands for {0}\{0\}, 22 for {1}\{1\}, 33 for {0,1}\{0, 1\}, and every finite set of finite sets gets exactly one number.

Under this coding, “ii is a member of jj” is “the ii-th digit of jj is one”, and Rado’s graph is membership with its direction forgotten: two hereditarily finite sets are joined when one is a member of the other. The extension property is then a statement a set theorist would find obvious. Given finite collections UU and VV of sets, the set U∪{U∪V}U \cup \{U \cup V\} contains every member of UU and nothing from VV — a witness, built by the axioms of pairing and union. The random graph and the finite part of the set theory whose countable models were met earlier are the same object seen from two directions.

The same trick for other structures

The pattern of the rationals and this graph — a countable structure characterised by being able to answer every finite request, unique by a zigzag, containing every finite piece of its kind — is general, and Roland Fraïssé described it in 1954. Start with a class of finite structures that is closed under taking substructures and in which any two structures sharing a common part can be glued along it. Then there is exactly one countable structure that contains every member of the class and in which every isomorphism between finite parts extends to a symmetry of the whole: the class’s limit.

The finite linear orders have the rationals as their limit. The finite graphs have Rado’s graph. Finite tournaments — graphs with every edge given a direction — have the random tournament; finite partial orders have a generic countable partial order. And finite graphs with no triangle have a limit too, Henson’s graph, which contains every triangle-free graph and has every symmetry the definition asks for — though it is not what tossing coins produces, since a coin-toss graph contains triangles with probability one. Each limit is to its class what the party of six people is to Ramsey’s theorem: the place where every finite pattern the class allows is guaranteed to occur.

The zero-one law, from the other side

This graph has appeared before without its name. Nearly always, or nearly never showed that for a first-order property of graphs — one expressible with quantifiers over vertices and the relation of being joined — the probability that a random graph on nn vertices has it tends to one or to nought as nn grows. The engine of that proof was the extension property in finite form: a large random graph satisfies every request about a fixed small number of vertices, with probability tending to one.

The infinite graph explains the law. A first-order sentence is true in Rado’s graph or false in it. The extension property, written as one axiom for each size of request, is a first-order theory; every countable model of it is Rado’s graph, so by the test that turns categoricity into completeness the theory is complete, and it decides every sentence. Any sentence it proves uses only finitely many of the axioms, finitely many extension requests, and those hold in large finite random graphs with probability tending to one. So a sentence true in Rado’s graph is almost surely true in large finite random graphs, and a false one almost surely false. The limit law for finite graphs is the truth in one infinite graph.

That is also why the law’s exceptions are what they are, and why the finite random graphs of the giant component behave so differently: there the edge probability shrinks as the graph grows, the extension property fails, and the limit is a different object altogether. Properties like “the graph is connected” — whose threshold is an event in its own right at other edge probabilities — or “the number of vertices is even” are not first-order in the language of graphs, and the infinite graph says nothing about them.

Finite graphs that almost satisfy it

No finite graph has the full extension property: a finite graph cannot answer requests of every size. But a finite graph can answer every request with ∣U∣+∣V∣≤k|U| + |V| \le k, and such graphs are useful as small stand-ins for Rado’s graph.

Random graphs do it with probability tending to one once they have more than about k22kk^2 2^k vertices. Explicit ones come from number theory. The Paley graph on a prime q≡1(mod4)q \equiv 1 \pmod 4 joins two residues when their difference is a square modulo qq — the same quadratic residues that built a table of signs with perpendicular rows — and for qq large enough compared with 4k4^k it answers every request of size kk. The squares modulo a prime behave, for this purpose, exactly like coin tosses.

What the figures cannot certify

Every figure is finite: the first sixteen vertices of the bit graph, requests among the first ten vertices of a three-thousand-vertex random graph, eight steps of a zigzag, ten vertices of an embedding. The theorem is about an infinite graph and an infinite matching, and the finite pieces verify that each step of the argument succeeds where it is tried. That every step succeeds for ever is the extension property, which for the bit graph is proved by the witness formula and for the coin-toss graph holds with probability one.

“With probability one” is itself a limitation the figures cannot reach. There are outcomes of the coin tosses — all heads, for instance — that give a graph which is not Rado’s; they have probability nought, and no finite sample can distinguish a probability-nought exception from a probability-one rule. The seeded random graph in the figures is one outcome, which happens to behave as almost every outcome does.

Still open: the smallest graph that answers every small request

Call a finite graph kk-extending if it answers every request with ∣U∣+∣V∣≤k|U| + |V| \le k. Such graphs exist for every kk, by the random construction, and the smallest one for k=2k = 2 is known: nine vertices, the Paley graph on nine elements. For larger kk it is not. The smallest number of vertices a kk-extending graph can have is not known even for k=3k = 3, where it is pinned only between bounds found by computer search and explicit constructions, and for general kk the known bounds differ by a factor that grows with kk.

It is a finite question about a property whose infinite version is the simplest thing about Rado’s graph. The random construction shows such graphs are plentiful at about k22kk^2 2^k vertices; nothing shows they cannot be much smaller; and the best explicit constructions, from quadratic residues and from designs, beat randomness only by constant factors.