import numpy as np, itertools from scipy.linalg import null_space def step_ring(x): l=np.roll(x,-1); r=np.roll(x,1) # a_k' = a_{k+1} XOR (a_k OR a_{k-1}) on a ring return l^(x|r) def counts(x,r): n=len(x); v=np.zeros(1< genuine conservation laws: {ns.shape[1]-nt.shape[1]}") # second invention: exact parity law on the half-line, N' = R + (a1 OR d) mod 2 rng=np.random.default_rng(9); ok=tot=0 for _ in range(20000): L=int(rng.integers(5,40)); a=rng.integers(0,2,size=L+3).astype(np.uint8); a[L:]=0; d=int(rng.integers(2)) nxt=np.zeros_like(a) for k in range(L+2): left=a[k-1] if k>0 else d nxt[k]=a[k+1]^(a[k]|left) if k+1