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

epsP(consensus)mean clustersmean major1/(2 eps)median stepsmax steps
0.050.007.977.3510.00931
0.080.005.034.756.25949
0.100.004.053.855.00959
0.120.003.253.104.17973
0.150.002.502.453.33874
0.170.002.172.102.94884
0.190.032.001.982.63815
0.200.171.901.822.507128
0.210.331.681.682.38763
0.220.551.451.452.2712145
0.230.651.351.352.1710145
0.250.971.021.022.001041
0.271.001.001.001.85614
0.301.001.001.001.6757
P(consensus) by population size N (30 runs each; N = 5000: 10 runs)
Neps=0.17 eps=0.19 eps=0.21 eps=0.23 eps=0.25
500.000.070.030.130.57
5000.000.000.300.830.97
50000.000.101.001.001.00

Key formula

\[x_i(t+1) = \frac{1}{|I_i(t)|}\sum_{j\in I_i(t)} x_j(t), \qquad I_i(t) = \{j : |x_j(t) - x_i(t)| \le \varepsilon\}.\]
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