What does Collective Dynamics and Consensus conclude, in numbers, about “Bounded Confidence: from Consensus to Clusters, and the Evidence on "Echo Chambers"”?
Answer: In bounded-confidence models opinions are influenced only by nearby opinions. The Hegselmann–Krause model passes from clusters to consensus at about \(\varepsilon \approx 0.2\) in large populations; in small populations the threshold is blurred, convergence near the threshold is slow, and the share reaching consensus need not be monotone. The Deffuant model gives about \(\lfloor 1/(2\varepsilon)\rfloor\) major clusters, often leaves outliers at the ends, and always reaches consensus for \(\varepsilon \ge 0.5\). "Polarisation" in the models is just two clusters, not necessarily at the extremes; "echo chamber" is an analogy, and field experiments do not support the simple inference that more exposure to opposing views reduces polarisation. The next chapter reads this research beside ancient discussions of "harmony" and "sameness".
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
| eps | P(consensus) | mean clusters | mean major | 1/(2 eps) | median steps | max steps |
| 0.05 | 0.00 | 7.97 | 7.35 | 10.00 | 9 | 31 |
| 0.08 | 0.00 | 5.03 | 4.75 | 6.25 | 9 | 49 |
| 0.10 | 0.00 | 4.05 | 3.85 | 5.00 | 9 | 59 |
| 0.12 | 0.00 | 3.25 | 3.10 | 4.17 | 9 | 73 |
| 0.15 | 0.00 | 2.50 | 2.45 | 3.33 | 8 | 74 |
| 0.17 | 0.00 | 2.17 | 2.10 | 2.94 | 8 | 84 |
| 0.19 | 0.03 | 2.00 | 1.98 | 2.63 | 8 | 15 |
| 0.20 | 0.17 | 1.90 | 1.82 | 2.50 | 7 | 128 |
| 0.21 | 0.33 | 1.68 | 1.68 | 2.38 | 7 | 63 |
| 0.22 | 0.55 | 1.45 | 1.45 | 2.27 | 12 | 145 |
| 0.23 | 0.65 | 1.35 | 1.35 | 2.17 | 10 | 145 |
| 0.25 | 0.97 | 1.02 | 1.02 | 2.00 | 10 | 41 |
| 0.27 | 1.00 | 1.00 | 1.00 | 1.85 | 6 | 14 |
| 0.30 | 1.00 | 1.00 | 1.00 | 1.67 | 5 | 7 |
| P(consensus) by population size N (30 runs each; N = 5000: 10 runs) | ||||||
| N | eps=0.17 eps=0.19 eps=0.21 eps=0.23 eps=0.25 | |||||
| 50 | 0.00 | 0.07 | 0.03 | 0.13 | 0.57 | |
| 500 | 0.00 | 0.00 | 0.30 | 0.83 | 0.97 | |
| 5000 | 0.00 | 0.10 | 1.00 | 1.00 | 1.00 |
Key formula
Show the full program
# Hegselmann-Krause (2002) bounded confidence: every agent moves at once to the mean of
# all opinions within eps of its own (itself included). N = 500 opinions drawn uniformly
# from [0, 1]; 40 runs per eps. On sorted opinions the eps-windows are found by two
# pointers and summed with prefix sums, so one step costs O(N). Stop when no opinion
# moves by more than 1e-10.
# Clusters: groups of final opinions closer than 1e-6; "major" = at least 5 % of agents.
import random, statistics
def hk(x, eps, max_steps=5000):
x = sorted(x); n = len(x)
for t in range(1, max_steps + 1):
pre = [0.0]
for v in x: pre.append(pre[-1] + v)
lo = hi = 0; new = []
for v in x:
while x[lo] < v - eps: lo += 1
while hi < n and x[hi] <= v + eps: hi += 1
new.append((pre[hi] - pre[lo]) / (hi - lo))
if max(abs(a - b) for a, b in zip(new, x)) < 1e-10:
return new, t
x = new # the update preserves the order of opinions
return x, max_steps
def clusters(x, tol=1e-6):
sizes = [1]
for a, b in zip(x, x[1:]):
if b - a > tol: sizes.append(1)
else: sizes[-1] += 1
return sizes
if __name__ == "__main__":
rng = random.Random(2002); N = 500
print(" eps P(consensus) mean clusters mean major 1/(2 eps) median steps"
" max steps")
for eps in (0.05, 0.08, 0.10, 0.12, 0.15, 0.17, 0.19, 0.20, 0.21, 0.22, 0.23, 0.25,
0.27, 0.30):
res = [hk([rng.random() for _ in range(N)], eps) for _ in range(40)]
cl = [clusters(x) for x, _ in res]; steps = [t for _, t in res]
cons = sum(len(c) == 1 for c in cl) / 40
major = statistics.mean(sum(s >= 0.05 * N for s in c) for c in cl)
mc, md = statistics.mean(map(len, cl)), statistics.median(steps)
print(f" {eps:.2f} {cons:4.2f} {mc:5.2f} {major:5.2f} "
f"{1 / (2 * eps):5.2f} {md:5.0f} {max(steps):5d}")
print("P(consensus) by population size N (30 runs each; N = 5000: 10 runs)")
print(" N " + "".join(f" eps={e:.2f}" for e in (0.17, 0.19, 0.21, 0.23, 0.25)))
for n in (50, 500, 5000):
runs = 10 if n == 5000 else 30
row = [sum(len(clusters(hk([rng.random() for _ in range(n)], e)[0])) == 1
for _ in range(runs)) / runs for e in (0.17, 0.19, 0.21, 0.23, 0.25)]
print(f" {n:5d} " + "".join(f" {v:4.2f} " for v in row))Single source and citation
Fan, Y. (2026). Collective Dynamics, Coupled-Oscillator Synchrony and Distributed Consensus (Version 1.0.0), Chapter 6: Bounded Confidence: from Consensus to Clusters, and the Evidence on "Echo Chambers". 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 5 · DeGroot Consensus: Influence, Spectral Gap and the Wisdom of Crowds
- Chapter 8 · Practice and a Pre-Registered Trial