#!/usr/bin/env node 'use strict'; // ============================================================================ // QUESTION (job #998, pre-registered before the script was run) // ============================================================================ // research/centered-discrepancy-measurement.md item 7 states, of the centered // discrepancy D_y of moving-cutoff-parity (9): // // "By item 3, no census of D_y at reachable x can separate the parity object // from the classical convergence, so a larger run has no decision attached // and should not be made." // // Item 3 supports that by the identity D_y/x = (S/x - C2) - (T1/x - C2) - P/x // - Epp/x - Eeven/x, in which every term but -(T1/x - C2) is negligible: T1 is // the classical term of (6), whose error is comparable to x/log^2 x with // oscillating sign, so a raw one-scale comparison of D_y is a comparison of the // classical term against itself. // // That conclusion is drawn from ONE column at each scale. The question this // script decides is whether it survives a statistic built to cancel the // classical term: a second difference in log_2 x. A component of D_y/x that is // a smooth function of u = j log 2 -- in particular -(T1/x - C2), which decays // like a power of 1/u -- contributes only its second derivative, // ~ g''(u) (log 2)^2, while any component oscillating on the scale of one j // survives at first order. // // STATISTIC. With x_j = 2^j and d_j = D_y(x_j)/x_j, // S1(j) = d_j - 2 d_{j-1} + d_{j-2} (real column) // S1c(j, s) = the same on control draw s (mu(n) replaced by +-1 on the // same support, mu(e) kept; the record's four seeded draws) // S1cl(j) = the same on -(T1/x - C2), i.e. item 3's classical prediction // ctrlRms(j) = rms over the four draws of S1c(j, .) // R1(j) = S1(j) - S1cl(j) (non-classical remainder) // // PRE-REGISTERED FALSIFIERS (fixed before the run, not after): // F5 (separable -- would revise item 7): |R1(j)| >= 3 ctrlRms(j) at every j // in some contiguous run of >= 5 scales with j >= 31. // F6 (not separable -- confirms item 7 quantitatively): |R1(j)| <= 2 // ctrlRms(j) at every j >= 31 while |S1(j)| >= 3 ctrlRms(j) at every // j >= 31, i.e. the whole second difference is classical. // F7 (unexpected): |S1(j)| <= 2 ctrlRms(j) at every j >= 31, i.e. the second // difference has already removed the classical term and what remains is // control-sized -- also a separation, and also a revision of item 7. // Exactly one of F5/F6/F7 is required to fire; neither F5 nor F6 nor F7 firing // is itself a reported outcome. // // COST. Zero new arithmetic: this reads the retained // research/centered-discrepancy-measurement.json (schema 1) that the 8223.47 s // census produced, shift 2 rows only. A fresh run is needed only if F5 or F7 // fires, and then only at j = 39..41 with research/centered-discrepancy- // measurement.js (the retained run's own cost is 627 s at j=34 and 8221 s at // j=38 on 8 workers, so ~3-6 h for three further scales). // ============================================================================ // OUTPUT const fs = require('fs'); const path = require('path'); const C2 = 0.6601618158468696; const F = path.join(__dirname, 'cdm.json'); const doc = JSON.parse(fs.readFileSync(F, 'utf8')); const rows = doc.rows.filter((r) => r.shift === 2).sort((a, b) => a.j - b.j); const byJ = new Map(rows.map((r) => [r.j, r])); const d = (r) => r.D / r.x; // D_y/x const cls = (r) => -(r.T1 / r.x - C2); // item 3's classical prediction function second(f, j) { const a = byJ.get(j), b = byJ.get(j - 1), c = byJ.get(j - 2); if (!a || !b || !c) return null; return f(a) - 2 * f(b) + f(c); } const ctrlD = (r, s) => r.seeds[s].D / r.x; const out = []; for (const r of rows) { const j = r.j; const s1 = second(d, j); if (s1 === null) continue; const draws = r.seeds.map((_, s) => { const a = byJ.get(j), b = byJ.get(j - 1), c = byJ.get(j - 2); return ctrlD(a, s) - 2 * ctrlD(b, s) + ctrlD(c, s); }); const mean = draws.reduce((x, y) => x + y, 0) / draws.length; const rms = Math.sqrt(draws.reduce((x, y) => x + (y - mean) ** 2, 0) / draws.length); const s1cl = second(cls, j); const R1 = s1 - s1cl; out.push({ j, x: r.x, S1: s1, S1cl: s1cl, R1, ctrlRms: rms, absS1_over_ctrl: rms > 0 ? Math.abs(s1) / rms : Infinity, absR1_over_ctrl: rms > 0 ? Math.abs(R1) / rms : Infinity, }); } console.log('j | x | S1 = d_j-2d_j-1+d_j-2 | S1cl (classical) | R1 = S1-S1cl | ctrlRms(4 draws) | |S1|/ctrl | |R1|/ctrl'); for (const o of out) { console.log([ String(o.j).padStart(2), String(o.x).padStart(13), o.S1.toExponential(4).padStart(12), o.S1cl.toExponential(4).padStart(12), o.R1.toExponential(4).padStart(12), o.ctrlRms.toExponential(4).padStart(12), o.absS1_over_ctrl.toFixed(3).padStart(9), o.absR1_over_ctrl.toFixed(3).padStart(9), ].join(' | ')); } // The three conditions are tested EXACTLY as pre-registered in the header. // A first version of this file implemented F6 with the first conjunct only, which // reported FIRES at j = 31, 33 where |S1|/ctrlRms is 0.436 and 1.181. That was the // script's bug, not the statistic's: the header's F6 is a conjunction, and the // corrected test below is what the run record quotes. const tail = out.filter((o) => o.j >= 31); const longestRun = (fn) => { let best = 0, cur = 0; for (const o of tail) { cur = fn(o) ? cur + 1 : 0; best = Math.max(best, cur); } return best; }; const all = (fn) => tail.length > 0 && tail.every(fn); const f5ok = longestRun((o) => o.absR1_over_ctrl >= 3) >= 5; const f6ok = all((o) => o.absR1_over_ctrl <= 2) && all((o) => o.absS1_over_ctrl >= 3); const f7ok = all((o) => o.absS1_over_ctrl <= 2); console.log(''); console.log(`F5 (|R1| >= 3 ctrlRms over a contiguous run of >=5 scales, j>=31): ${f5ok ? 'FIRES' : 'does not fire'} (longest run ${longestRun((o) => o.absR1_over_ctrl >= 3)} of ${tail.length})`); console.log(`F6 (|R1| <= 2 ctrlRms AND |S1| >= 3 ctrlRms, every j>=31): ${f6ok ? 'FIRES' : 'does not fire'}`); console.log(` conjunct |R1|<=2 holds at every j>=31: ${all((o) => o.absR1_over_ctrl <= 2)}`); console.log(` conjunct |S1|>=3 fails at j = ${tail.filter((o) => !(o.absS1_over_ctrl >= 3)).map((o) => o.j).join(', ') || 'none'}`); console.log(`F7 (|S1| <= 2 ctrlRms, every j>=31): ${f7ok ? 'FIRES' : 'does not fire'}`); console.log(`descriptive: max |R1|/ctrlRms over j>=31 = ${Math.max(...tail.map((o) => o.absR1_over_ctrl)).toFixed(3)}`); console.log(`descriptive: max |S1|/ctrlRms over j>=31 = ${Math.max(...tail.map((o) => o.absS1_over_ctrl)).toFixed(3)}`); console.log(`descriptive: |R1|/|S1| over j>=31 = ${tail.map((o) => (o.S1 ? Math.abs(o.R1 / o.S1).toFixed(3) : 'n/a')).join(', ')}`); console.log(`scales reported: j = ${out[0].j}..${out[out.length - 1].j}; source rows ${rows.length}, shift 2 only`); console.log(`source artifact: research/centered-discrepancy-measurement.json, totalSeconds ${doc.totalSeconds}`);