What does Community Topology Checkup conclude, in numbers, about “The Review List: Short Zero-Dimensional Bars, Camouflage and Base Rates”?

Answer: Chapter 5 turns short zero-dimensional bars into a review list: the catch rate is 0.996 and the false-alarm rate per genuine account 0.0127, yet when boosting accounts are rare 0.717 of the people listed are innocent; camouflage cuts the catch rate to 0.028 while the AUC of L3 stays at 0.900.

Scope of the numbers: Every community and member in the book is synthetic data with fixed seeds, and no data from any real community or person is used; all calculations are generated by its programs, and its parameters are illustrative. The book is not individual business advice, and its "detection of paid boosters" produces only a list of suspects for human review, never an automatic penalty for any member.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.0127, 0.996

deltasock recallprecisionrelativesothersper genuinefalse rate
0.100.7691.0000.0000.00000.000.0000
0.150.9161.0000.0330.00000.130.0043
0.200.9961.0000.0950.00000.380.0127
0.250.9991.0000.3120.00001.250.0417
0.301.0001.0000.6520.00152.650.0883
0.351.0000.9980.8970.01423.960.1320
Show the full program
# Chapter 5. p51: A suspect list from short zero-dimensional bars.
# Rule: join accounts whose Jaccard distance is below delta (the H0 bars
# that die before delta); every group of at least 3 accounts goes on a
# list for human review. Nobody is penalised by the rule. Tested on
# 100 padded communities (12 real + 18 lockstep) and 100 genuine ones
# that contain a family of 4 relatives with near-identical likes
# (26 others + 4 relatives). Synthetic, fixed seed, illustrative.
import random

T, P = 24, 5          # 24 topics on a ring, 5 posts each (illustrative)
N_POSTS = T * P


def member(rng, centre, width, q=0.8, stray=0.03):
    # a genuine member likes posts on an arc of topics around centre
    s = set()
    for t in range(T):
        dd = abs(t - centre) % T
        dd = min(dd, T - dd)
        hit = q if dd <= width / 2.0 else stray
        for k in range(P):
            if rng.random() < hit:
                s.add(t * P + k)
    return s


def sock(rng, target, q=0.95, stray=0.01):
    # a boosting account likes the operator's target posts in lockstep
    s = set()
    for p in range(N_POSTS):
        if rng.random() < (q if p in target else stray):
            s.add(p)
    return s


def community(rng, n_real, arc, n_sock):
    # n_real genuine members with interest centres on [0, arc) topics,
    # plus n_sock boosting accounts aimed at 30 target posts
    pts = []
    for _ in range(n_real):
        pts.append(member(rng, rng.uniform(0, arc), rng.randint(5, 8)))
    target = set(rng.sample(range(N_POSTS), 30))
    for _ in range(n_sock):
        pts.append(sock(rng, target))
    return pts


def jaccard(a, b):
    u = len(a | b)
    return 1.0 - len(a & b) / u if u else 0.0


def barcodes(pts, cap=1.0):
    return barcodes_d(len(pts), lambda i, j: jaccard(pts[i], pts[j]), cap)


def barcodes_d(n, dist, cap=1.0):
    # Vietoris-Rips filtration (up to triangles) of a distance dist(i, j).
    # H0 by union-find; H1 by mod-2 reduction of triangle columns,
    # each column stored as a Python integer used as a bitset of edges.
    edges = []
    for i in range(n):
        for j in range(i + 1, n):
            d = dist(i, j)
            if d <= cap:
                edges.append((d, i, j))
    edges.sort()
    eid = {(i, j): k for k, (d, i, j) in enumerate(edges)}
    par = list(range(n))

    def find(x):
        while par[x] != x:
            par[x] = par[par[x]]
            x = par[x]
        return x
    h0, neg = [], set()
    for k, (d, i, j) in enumerate(edges):
        a, b = find(i), find(j)
        if a != b:
            par[max(a, b)] = min(a, b)
            h0.append((d, i, j))
            neg.add(k)
    tris = []
    for (i, j), e in eid.items():
        for k in range(j + 1, n):
            f, g = eid.get((i, k)), eid.get((j, k))
            if f is not None and g is not None:
                tris.append(tuple(sorted((e, f, g), reverse=True)))
    tris.sort()
    piv, h1 = {}, []
    for t in tris:
        col = (1 << t[0]) | (1 << t[1]) | (1 << t[2])
        while col:
            low = col.bit_length() - 1
            if low not in piv:
                piv[low] = col
                break
            col ^= piv[low]
        if col and edges[t[0]][0] > edges[low][0]:
            h1.append((edges[low][0], edges[t[0]][0]))
    for k in range(len(edges)):
        if k not in neg and k not in piv:
            h1.append((edges[k][0], cap))     # still open at the cap
    return h0, h1


def family(rng, k=4, keep=0.85):
    base = member(rng, rng.uniform(0, 24), rng.randint(5, 8))
    out = []
    for _ in range(k):
        s = set(p for p in sorted(base) if rng.random() < keep)
        s |= set(p for p in range(N_POSTS) if rng.random() < 0.01)
        out.append(s)
    return out


def flagged(pts, delta, m=3):
    n = len(pts)
    par = list(range(n))

    def find(x):
        while par[x] != x:
            par[x] = par[par[x]]
            x = par[x]
        return x
    for i in range(n):
        for j in range(i + 1, n):
            if jaccard(pts[i], pts[j]) < delta:
                par[find(i)] = find(j)
    size = {}
    for i in range(n):
        r = find(i)
        size[r] = size.get(r, 0) + 1
    return [i for i in range(n) if size[find(i)] >= m]


rng = random.Random(20261113)
pads = [community(rng, 12, 24, 18) for _ in range(100)]
gens = [community(rng, 26, 24, 0) + family(rng) for _ in range(100)]
print("delta  sock recall  precision  relatives  others  per genuine"
      "  false rate")
for delta in (0.10, 0.15, 0.20, 0.25, 0.30, 0.35):
    tp = fp = rel = oth = 0
    for pts in pads:
        for i in flagged(pts, delta):
            if i >= 12:
                tp += 1
            else:
                fp += 1
    for pts in gens:
        for i in flagged(pts, delta):
            if i >= 26:
                rel += 1
            else:
                oth += 1
    prec = tp / float(tp + fp) if tp + fp else 0.0
    print("%.2f   %.3f        %.3f      %.3f      %.4f  %.2f         %.4f"
          % (delta, tp / 1800.0, prec, rel / 400.0, oth / 2600.0,
             (rel + oth) / 100.0, (rel + oth) / 3000.0))

Single source and citation

Fan, Y. (2026). Persistent Homology and Betti Numbers: Structural Voids in High-Net-Worth Private Communities and the Review of Fake Cliques (Version 1.0.0), Chapter 5: The Review List: Short Zero-Dimensional Bars, Camouflage and Base Rates. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-236 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026236,
  author    = {Fan, Yafu},
  title     = {Persistent Homology and Betti Numbers: Structural Voids in High-Net-Worth Private Communities and the Review of Fake Cliques},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book