What does Collective Dynamics and Consensus conclude, in numbers, about “DeGroot Consensus: Influence, Spectral Gap and the Wisdom of Crowds”?
Answer: In the DeGroot model a strongly connected aperiodic network always reaches consensus, and the consensus is the influence-weighted average \(\pi\) of initial opinions; disagreement decays like \(|\lambda_2|^t\), and the spectral gap describes only the asymptotic rate. Golub and Jackson proved that a crowd is wise if and only if the largest influence tends to 0 as the population grows, and that speed and wisdom are unrelated. Stars and "elite" networks converge fast but are not wise, and the central person's bias is passed to the whole group in proportion to influence. Experiments show that most people update close to DeGroot averaging; whether social influence improves estimates in centralised networks depends on whether the central person deviates from the truth. The next chapter asks what happens when people listen only to opinions close to their own.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs, all checked), classical sources and the author's hypotheses; all data in the book are fictional or simulated.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| network (N = 21) | max pi | N_eff=1/sum pi^2 | |lam_2| | gap | predicted simulated | |
| complete | 0.048 | 21.0 | 0.0000 | 1.0000 | 1 | 1.0 |
| ring k=1 | 0.048 | 21.0 | 0.9704 | 0.0296 | 154 | 104.6 |
| ring k=2 | 0.048 | 21.0 | 0.9127 | 0.0873 | 51 | 29.8 |
| ring k=2 + 6 shortcuts | 0.060 | 20.6 | 0.8429 | 0.1571 | 27 | 16.8 |
| two cliques + 1 bridge | 0.054 | 20.9 | 0.9846 | 0.0154 | 297 | 152.2 |
| star | 0.344 | 7.1 | 0.5000 | 0.5000 | 7 | 7.0 |
| predicted = rounds for |lam_2|^t to fall to 1/100; simulated = rounds until | ||||||
| the spread max - min falls below 1 % of its start (mean of 5 random starts) |
Key formula
Show the full program
# DeGroot (1974) averaging p(t+1) = T p(t) on undirected graphs with self-loops,
# T_ij = 1/(d_i + 1) for j = i or j ~ i. Then T is reversible: pi_i = (d_i + 1)/sum(d + 1)
# is the left unit eigenvector (influence), the consensus is sum_i pi_i p_i(0), and
# disagreement shrinks like |lambda_2|^t, lambda_2 = largest-modulus eigenvalue below 1.
import math, random
def jacobi_eigs(S, sweeps=60):
a = [row[:] for row in S]; n = len(a)
for _ in range(sweeps):
if sum(a[i][j] ** 2 for i in range(n) for j in range(n) if i != j) < 1e-22: break
for p in range(n - 1):
for q in range(p + 1, n):
if abs(a[p][q]) < 1e-15: continue
t = (a[q][q] - a[p][p]) / (2 * a[p][q])
t = (1 if t >= 0 else -1) / (abs(t) + math.sqrt(t * t + 1))
c = 1 / math.sqrt(t * t + 1); s = t * c
for k in range(n):
u, v = a[k][p], a[k][q]
a[k][p], a[k][q] = c * u - s * v, s * u + c * v
for k in range(n):
u, v = a[p][k], a[q][k]
a[p][k], a[q][k] = c * u - s * v, s * u + c * v
return sorted(a[i][i] for i in range(n))
def ring(n, k=1):
return [{(i + s) % n for s in range(-k, k + 1) if s} for i in range(n)]
def networks(n=21):
rng = random.Random(3); sw = ring(n, 2)
for _ in range(6):
i, j = rng.sample(range(n), 2); sw[i].add(j); sw[j].add(i)
two = [{j for j in range(n) if j != i and (j < 10) == (i < 10)} for i in range(n)]
two[0].add(10); two[10].add(0) # two cliques (10 and 11) and one bridge
return [("complete", [set(range(n)) - {i} for i in range(n)]), ("ring k=1", ring(n)),
("ring k=2", ring(n, 2)), ("ring k=2 + 6 shortcuts", sw),
("two cliques + 1 bridge", two),
("star", [set(range(1, n))] + [{0}] * (n - 1))]
def rounds_to_one_percent(adj, rng):
p = [rng.random() for _ in adj]; s0 = max(p) - min(p)
for t in range(1, 100000):
p = [(p[i] + sum(p[j] for j in nb)) / (len(nb) + 1) for i, nb in enumerate(adj)]
if max(p) - min(p) < 0.01 * s0: return t
if __name__ == "__main__":
rng = random.Random(1974)
print("network (N = 21) max pi N_eff=1/sum pi^2 |lam_2| gap predicted"
" simulated")
for name, adj in networks():
w = [len(nb) + 1 for nb in adj]; pi = [x / sum(w) for x in w]
S = [[(1 if (j in adj[i] or i == j) else 0) / math.sqrt(w[i] * w[j])
for j in range(len(adj))] for i in range(len(adj))]
lam = jacobi_eigs(S); l2 = max(abs(lam[0]), abs(lam[-2]))
pred = 1 if l2 < 1e-12 else math.ceil(math.log(100) / -math.log(l2))
sim = sum(rounds_to_one_percent(adj, rng) for _ in range(5)) / 5
print(f"{name:24s} {max(pi):.3f} {1 / sum(x * x for x in pi):5.1f}"
f" {l2:.4f} {1 - l2:.4f} {pred:4d} {sim:7.1f}")
print("predicted = rounds for |lam_2|^t to fall to 1/100; simulated = rounds until")
print("the spread max - min falls below 1 % of its start (mean of 5 random starts)")Single source and citation
Fan, Y. (2026). Collective Dynamics, Coupled-Oscillator Synchrony and Distributed Consensus (Version 1.0.0), Chapter 5: DeGroot Consensus: Influence, Spectral Gap and the Wisdom of Crowds. 5D Library. https://doi.org/10.5281/zenodo.23828063
DOI: 10.5281/zenodo.23828063 · Read the monograph · 5DL-B-044 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026044,
author = {Fan, Yafu},
title = {Collective Dynamics, Coupled-Oscillator Synchrony and Distributed Consensus},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23828063},
url = {https://doi.org/10.5281/zenodo.23828063}
}Other chapter answers in this book
- Chapter 1 · The Kuramoto Model: the Synchronisation Transition of Coupled Oscillators, and Applause
- Chapter 2 · The Wobbling Millennium Bridge and the Master Stability Function of Network Synchrony
- Chapter 3 · Self-Propelled Particles and the Three-Zone Model: Noise, Alignment and Collective Memory
- Chapter 4 · Leadership without Signals: Informed Minorities, Uninformed Individuals and Group Consensus
- Chapter 6 · Bounded Confidence: from Consensus to Clusters, and the Evidence on "Echo Chambers"
- Chapter 8 · Practice and a Pre-Registered Trial