Computation

Half the chance for every silent set

In the lights game where a press toggles only the neighbours, a random network can be lit about 56 times in a hundred when it has an even number of vertices and 44 when odd. The numbers are 0.560562 and 0.439438, they add to one, and they come from a chain: each new vertex raises or lowers the dimension of the silent sets by one, and each dimension halves the chance.

Worth reading first: When a press skips its own light · Every light on, from every light off.

When a press skips its own light changed one rule of the lights game. In the original, pressing a light toggles it and its neighbours; in the variant, it toggles the neighbours only. With that change, the theorem that every network can be lit stops holding, and the essay counted how often it fails. Of the 32,768 labelled networks on six vertices, 18,259 can be taken from all off to all on, a share of 0.5570.557; on seven vertices the share is 0.4360.436; and random networks to forty vertices keep alternating between about 0.560.56 for even sizes and 0.440.44 for odd. It explained the alternation — an adjacency matrix over the two-element field has even rank, so a network with an odd number of vertices always has a silent set — and left open where the two numbers themselves come from.

This essay computes them. The answer has two parts. The first is a chain: as a network grows one vertex at a time, the dimension of its space of silent sets goes up or down by exactly one at each step, with chances that depend only on the dimension, and that chain gives the law of the dimension exactly at every size. The second is a halving: a network with a kk-dimensional space of silent sets can be lit about one time in 2k2^k. Together they predict 0.5605620.560562 and 0.4394380.439438, the exact counts close in on the prediction vertex by vertex, and the two numbers add up to one.

Press everything and the odd degrees light. Pressing every vertex lights exactly the odd-degree vertices; all 1024 all-odd-degree graphs on 6 vertices are litable; overall 18259 of 32768.
Fig. 1 Two networks on six vertices with every vertex pressed once. Each vertex is toggled once per neighbour and ends lit exactly when its degree, written in it, is odd. On the left every degree is 3 and pressing everything lights everything; the same holds for all 1,024 labelled networks on six vertices whose degrees are all odd.

Press everything

Start with the simplest press pattern of all: press every vertex once. A press toggles the pressed vertex’s neighbours, so each vertex is toggled once for each of its neighbours, and it ends lit exactly when its number of neighbours, its degree, is odd. In the language of the matrix, pressing everything is applying the adjacency matrix AA to the all-ones vector, and the result, A1A\mathbf 1, is the vector of degrees taken mod 2.

That gives one class of networks for free. If every degree is odd, pressing everything lights everything, and the network is litable. On six vertices there are 210=1,0242^{10} = 1{,}024 labelled networks with all degrees odd, and every one of them can be lit, against 55.755.7 per cent of networks in general. The right-hand network in the figure has four vertices of degree 2, and pressing everything lights only the two of degree 3, leaving the question of whether the four even-degree vertices can be lit some other way. That is the question in general: since pressing everything always lights the odd-degree vertices, a network is litable exactly when its even-degree vertices can be lit by themselves.

It also gives a class of networks that can never be lit. If every degree is even, then pressing everything changes nothing, A1=0A\mathbf 1 = 0, so the all-ones vector is itself a silent set. On an odd number of vertices it is a silent set of odd size, and the counting argument for silent sets says that is a certificate of failure: every press toggles an even number of lights inside a silent set, so an odd number of them can never all be on. So on seven vertices, every network whose degrees are all even — 32,768 of them, since such networks correspond to networks on six vertices — is unlitable.

Four small networks by hand

The two rules already decide the smallest cases, and working them shows how much the degrees carry. The triangle has three vertices of degree two. Every degree is even and the number of vertices is odd, so the whole triangle is a silent set of odd size — pressing all three corners toggles each corner twice — and all on is unreachable. Indeed any press lights exactly the two other corners, and two presses either cancel or light a single corner and darken another; no combination ever has all three on.

The complete network on four vertices has every degree three, so pressing all four lights everything, at once. The star with one centre and three leaves has degrees three, one, one and one, all odd, so pressing all four vertices lights them all as well: the centre is toggled by each of three leaves and each leaf by the centre. The path on three vertices has degrees one, two and one. Pressing everything lights the two ends and leaves the middle dark, and the middle, of even degree, has to be lit separately: pressing one end toggles only the middle, so pressing all three and then that end again — that is, pressing the middle and the other end — lights the path. Its single silent set is the two ends together, which has an even number of members, as the rule requires.

So the degree parities are a first sorting of every network: all odd and it is certainly litable, all even on an odd number of vertices and it certainly is not, and otherwise the even-degree vertices must be reached by some pattern of presses. The boards on which every light goes out found the same kind of sorting on square grids, where the question was decided by the board’s dimensions; on a general network there is no such shortcut, and the sorting by degrees is where the probability takes over.

The even-degree vertices decide

The next figure groups all the networks on six and seven vertices by how many vertices have odd degree, which is always an even number, since the degrees add up to twice the number of edges.

The fewer even degrees, the likelier the lights. n=6: 0 odd → 0.4248 of 1024, 2 odd → 0.5469 of 15360, 4 odd → 0.5469 of 15360, 6 odd → 1.0000 of 1024; n=7: 0 odd → 0.0000 of 32768, 2 odd → 0.4428 of 688128, 4 odd → 0.4428 of 1146880, 6 odd → 0.4428 of 229376.
Fig. 2 The share of networks that can be lit, among all labelled networks on six and on seven vertices, grouped by the number of odd-degree vertices. On six vertices the share rises to 1.000 when all six degrees are odd; on seven vertices it is 0 when all degrees are even and 0.443 otherwise.

On six vertices, networks with no odd-degree vertex can be lit 0.4250.425 of the time, those with two or four odd-degree vertices 0.5470.547, and those with six, as shown, always. On seven vertices, networks with no odd-degree vertex can never be lit, and those with two, four or six can be lit 0.4430.443 of the time — the same share for all three groups, to every digit of the count. The equalities are exact: 0.4250.425 is 435/1,024435/1{,}024, which is also the share of litable networks on five vertices, and 0.5470.547 is the share on four. Those coincidences say that the families are related by correspondences that move a network between sizes, and the figure records them without supplying the correspondences. What it does establish is that the degree parities carry much of the answer, and that when they carry all of it — all odd, or on an odd number of vertices all even — the answer is certain.

A kernel that moves by one

The rest of the answer is in the space of silent sets: the kernel of AA over the two-element field, the press patterns that change nothing. Its dimension kk is the number of independent silent sets, and 2k2^k is how many there are in all. A network is litable exactly when every one of them has an even number of members.

Build a random network one vertex at a time, each new vertex joined to each old one independently with chance one half — the model of the moment a giant appears at its densest setting, where every network on the given vertices is equally likely. Adding a vertex adds a new row and column to AA, the column being the new vertex’s random set of neighbours. Two things can happen. If that column lies outside the space spanned by the old columns, the rank goes up by two — the new row comes with it — and the kernel dimension drops by one. If the column lies inside that space, the rank does not change, and the kernel dimension rises by one. The second case cannot add one to the rank, which is what would keep kk the same, because AA is alternating: for any vector xx, xTAxx^{\mathsf T} A x counts each edge inside xx twice and so is nought, and that forces the new diagonal entry to be consistent with the old columns. So kk moves by exactly one at every step, never staying put.

The kernel grows or shrinks by one with each vertex. Corank chain k → k − 1 with chance 1 − 2^(−k), k → k + 1 with chance 2^(−k), checked on 33866 vertex additions; limit law even 0: 0.41942, 2: 0.55923, 4: 0.02130, 6: 0.00004; odd 1: 0.83884, 3: 0.15978, 5: 0.00137.
Fig. 3 Top: the kernel dimension as vertices are added. It falls by one unless the new column lands in a subspace of codimension k, which happens with chance 1/2k1/2^k, and then it rises by one. Bottom: the chain’s law at forty and forty-one vertices, with 0.4194 invertible at even size and 0.8388 a single line of silent sets at odd size.

The chances are fixed by the dimension alone. The old column space has codimension kk, so a uniformly random column lies inside it with chance 1/2k1/2^k. So the dimension follows a Markov chain: from kk it moves to k−1k - 1 with chance 1−1/2k1 - 1/2^k and to k+1k + 1 with chance 1/2k1/2^k, starting at k=1k = 1 for a single vertex. The rule was checked directly, not just argued, on every way of adding a vertex to every network of up to five vertices, 33,866 additions, and in every one the dimension moved by exactly one. A chain that rises rarely from large kk and almost always from k=0k = 0 settles quickly into a law that alternates with the parity of the size, as the time spent and the share held described for chains in general: at forty vertices the matrix is invertible with chance 0.41940.4194 and has a two-dimensional kernel with chance 0.55920.5592, and at forty-one the kernel is a single line with chance 0.83880.8388.

The chain against the networks

The chain is a claim about every network at once, and it can be checked against the counts.

Kernel dimensions of random graphs follow the chain. n=6: 0: 0.4238, 2: 0.5563, 4: 0.0199, 6: 0.0000; n=7: 1: 0.8410, 3: 0.1577, 5: 0.0013, 7: 0.0000; n=20: 0: 0.4174, 2: 0.5596, 4: 0.0229, 6: 0.0001; n=21: 1: 0.8398, 3: 0.1588, 5: 0.0013; n=30: 0: 0.4192, 2: 0.5593, 4: 0.0214, 6: 0.0001; n=31: 1: 0.8397, 3: 0.1589, 5: 0.0014, 7: 0.0000.
Fig. 4 The share of networks whose adjacency matrix has a kernel of each dimension, for every labelled network on 6 and 7 vertices and 100,000 random networks each on 20, 21, 30 and 31, against the chain’s law in black. The small sizes agree exactly; the sampled sizes within sampling error.

For six and seven vertices, where every network is counted, the shares agree with the chain’s law exactly, as fractions: the chain is not an approximation for random networks but a description of them. For the sampled sizes, 20 to 31 vertices, the shares agree within sampling error, and they are already indistinguishable from the limit. The law converges fast because the chain is strongly pulled towards small dimensions. A kernel of dimension four needs two unlikely rises in a row, at chances of a quarter and an eighth, and dimension six needs more; at forty vertices dimension six has chance 4×10−54 \times 10^{-5}.

This is part of the classical theory of matrices over finite fields, in which the number of alternating matrices of each rank has long been known exactly, and the chain is the cleanest way to see it. Its consequence for the lights game is that the distribution of silent sets is known exactly at every size. What remains is the second part of the question: given a kk-dimensional space of silent sets, how often are they all even?

Each dimension halves the chance

If the all-ones vector sat in a random position relative to the kernel, each independent silent set would be even or odd by a fair coin, and all kk of them would be even with chance 1/2k1/2^k. There is no reason in advance to expect that. The all-ones vector is not random — it is the vector the game is about — and the degree argument above shows it is tied to the matrix in specific ways. The next figure measures it.

Each kernel dimension halves the chance. n=7 k=5: 0.0236 (2667); n=7 k=3: 0.1181 (330708); n=7 k=1: 0.4961 (1763776); n=11 k=1: 0.5001 (168062); n=11 k=3: 0.1236 (31647); n=20 k=2: 0.2529 (55963); n=20 k=0: 1.0000 (41744); n=20 k=4: 0.0704 (2288); n=21 k=1: 0.5024 (83985); n=21 k=3: 0.1240 (15881); n=31 k=3: 0.1296 (15888); n=31 k=1: 0.5008 (83967).
Fig. 5 Among networks whose adjacency matrix has a kernel of dimension k, the share that can be lit, for every network on 7 vertices and samples on 11, 20, 21 and 31, against the dashed curve 1/2k1/2^k. Each dimension halves the chance.

It halves. Networks with an invertible matrix are always litable, since then every pattern can be reached. With a one-dimensional kernel the share is 0.4960.496 on seven vertices and 0.5000.500 on eleven, twenty-one and thirty-one; with two dimensions it is 0.2530.253 on twenty; with three, about 0.120.12 to 0.130.13 at every size sampled, against an eighth. The coupling between the all-ones vector and the kernel that the degrees create washes out: averaged over random networks of a given kernel dimension, the silent sets behave as though their parities were fair coins.

The prediction, and its two limits

Multiplying the two parts gives a prediction for the share of litable networks at every size: the chance of each kernel dimension kk from the chain, times 1/2k1/2^k, summed over kk.

0.5606 and 0.4394, predicted from the kernel. n=1: 0.0000 (pred 0.5000); n=2: 0.5000 (pred 0.6250); n=3: 0.3750 (pred 0.4531); n=4: 0.5469 (pred 0.5752); n=5: 0.4248 (pred 0.4428); n=6: 0.5572 (pred 0.5641); n=7: 0.4359 (pred 0.4403); n=8: 0.5635 (pred 0.5615); n=9: 0.4388 (pred 0.4396); n=10: 0.5561 (pred 0.5608); n=11: 0.4387 (pred 0.4395); n=12: 0.5609 (pred 0.5606); n=13: 0.4405 (pred 0.4395); n=14: 0.5603 (pred 0.5606); n=15: 0.4377 (pred 0.4394); n=16: 0.5623 (pred 0.5606); n=18: 0.5575 (pred 0.5606); n=20: 0.5624 (pred 0.5606); n=21: 0.4401 (pred 0.4394); n=22: 0.5598 (pred 0.5606); n=23: 0.4385 (pred 0.4394); n=24: 0.5594 (pred 0.5606); n=25: 0.4387 (pred 0.4394); n=26: 0.5595 (pred 0.5606); n=27: 0.4418 (pred 0.4394); n=28: 0.5570 (pred 0.5606); n=29: 0.4391 (pred 0.4394); n=30: 0.5631 (pred 0.5606); n=31: 0.4349 (pred 0.4394); limits 0.560562104, 0.439437896.
Fig. 6 The share of networks that can be lit against the number of vertices: every labelled network up to 7 vertices, and 40,000 random networks at each larger size, with the prediction from the chain in grey and its limits dashed. The limits are 0.560562 and 0.439438.

The prediction misses at the smallest sizes, where the degree constraints are strong: on two vertices it says 0.6250.625 and the truth is 0.50.5; on three, 0.4530.453 against 0.3750.375. Then it closes in vertex by vertex, the gap 0.0180.018 at five vertices, 0.00690.0069 at six and 0.00440.0044 at seven, and from eight vertices on the sampled shares sit on it within their error. The limits are 0.5605620.560562 for even sizes and 0.4394380.439438 for odd ones, which are the numbers when a press skips its own light measured as about 0.560.56 and 0.440.44.

They add up to one, to the twelve decimal places the computation carries. The sum is a property of the chain rather than of the game — one step of the chain turns the even-size law into the odd-size law, and the two weighted sums come out complementary — and the figures check it numerically rather than derive it. In words, a large random network with an even number of vertices fails to be litable exactly as often as one with an odd number succeeds.

What the counts cannot show

The chain is proved by the argument above and checked on every network to five vertices; its law at six and seven vertices agrees with the counts exactly. The halving is different. It is measured, on every network of seven vertices and on samples to thirty-one, and it holds within error at every size checked, but nothing here proves it. The figures show that the share of litable networks with a kk-dimensional kernel is close to 1/2k1/2^k; they do not show that it tends to 1/2k1/2^k, and the exact counts at seven vertices — 0.4960.496, not 0.50.5, for a one-dimensional kernel — show that it is not exact at finite sizes. A proof would need to show that the all-ones vector becomes asymptotically independent of the kernel, which is the precise form of the question the earlier essay left open.

The same caution applies to the limits. The two numbers 0.5605620.560562 and 0.4394380.439438 are the limits of the prediction; that the true shares converge to them depends on the halving holding in the limit. The samples agree to three decimal places at every size from eight to thirty-one, which is strong evidence and not a proof.

Still open: a reason for the halving

The halving would follow if the all-ones vector were uniformly random relative to the kernel, and it is not; it is the vector whose image under AA is the degree vector, which is about as far from random as a vector can be. One route to a proof is through the degrees themselves. Pressing everything lights the odd-degree vertices, so litability is the question of whether the indicator of the even-degree vertices lies in the column space, and in a large random network that indicator is a random-looking set of about half the vertices whose dependence on the kernel might be controlled. Whether that can be made rigorous, and whether the resulting rate matches the gaps of 0.0180.018, 0.0070.007 and 0.0040.004 measured at five, six and seven vertices, is not settled here.

The structure the degree figure uncovered is open in a different way. That networks on six vertices with no odd-degree vertex are litable exactly as often as all networks on five, and networks on six with two odd-degree vertices exactly as often as all networks on four, are equalities of counts with no stated reason. They suggest a family of correspondences between networks of different sizes that preserve litability, and the cycles and the cuts, where the cycle and cut spaces of a network are exchanged by duality, is the kind of structure in which such correspondences usually live.

A chain and a coin

The two numbers are now accounted for, with one assumption measured rather than proved. A network’s silent sets form a space whose dimension wanders up and down by one as vertices are added, almost always down from a large dimension and always up from nought, so that even-sized networks are usually invertible or have two independent silent sets, and odd-sized ones usually have exactly one. Each silent set is even or odd as though by a coin. An invertible network is always litable, a network with one silent set half the time, with two a quarter of the time, and the weighted average is 0.5605620.560562 for even sizes and 0.4394380.439438 for odd. The one rule that changed between the two lights games — whether a press toggles its own light — moved the share of litable networks from exactly one to these two numbers, and the matrix’s alternating structure is the whole of the reason.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Finite fieldKernelLinear systemMarkov chainParityRandom graphRankStationary distribution