FA-13691 / Numerical aggregation / Open access
Contingency pearson reduction: Cell contributions are averaged rather than summed. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Cell contributions are averaged rather than summed.
THE FAILURE
Cell contributions are averaged rather than summed.
Unsuccessful approach: Dividing by degrees of freedom yields a different statistic.
Case contract
For a rectangular nonnegative integer count table, return the Pearson sum of (observed-expected)^2/expected under independence, with expected=row marginal*column marginal/grand total. Zero expected cells contribute zero; empty or zero-total tables return "0". Exact Fraction string; no inferential p-value claim.
Why this case matters
Exact bounded examples isolate a reduction defect without floating-point or external-service effects.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(table):
n=len(table)
m=len(table[0]) if n else 0
rows=[sum(r) for r in table]
cols=[sum(table[i][j] for i in range(n)) for j in range(m)]
total=sum(rows)
if not total: return "0"
stat=Fraction(0)
for i in range(n):
for j in range(m):
expected=Fraction(rows[i]*cols[j],total)
if expected==0: continue
stat+=(table[i][j]-expected)**2/expected
return str(stat/max(1,n*m))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[4, 0], [0, 4]],)), '8')
check('regression 2', solve(*([[2, 3], [4, 6]],)), '0')
check('regression 3', solve(*([],)), '0')
check('regression 4', solve(*([[0, 0], [0, 0]],)), '0')
check('regression 5', solve(*([[2, 0, 1], [3, 4, 0]],)), '30/7')
check('regression 6', solve(*([[0, 0, 0], [1, 2, 3]],)), '0')
check('regression 7', solve(*([[1, 2], [3, 0], [2, 4]],)), '4')
check("variable diagonal mass",solve([[N,0],[0,N]]),str(2*N))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 2 | 8 | Failed |
| regression 2 | 0 | 0 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 5/7 | 30/7 | Failed |
| regression 6 | 0 | 0 | Passed |
| regression 7 | 2/3 | 4 | Failed |
| variable diagonal mass | 1/2 | 2 | Failed |
SHA-256 / 40b568f411e2a172bc3dec7834176c071e72573ab2e9f5be0d7cc946e92e20fb
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(table):
n=len(table)
m=len(table[0]) if n else 0
rows=[sum(r) for r in table]
cols=[sum(table[i][j] for i in range(n)) for j in range(m)]
total=sum(rows)
if not total: return "0"
stat=Fraction(0)
for i in range(n):
for j in range(m):
expected=Fraction(rows[i]*cols[j],total)
if expected==0: continue
stat+=(table[i][j]-expected)**2/expected
return str(stat/max(1,(n-1)*(m-1)))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[4, 0], [0, 4]],)), '8')
check('regression 2', solve(*([[2, 3], [4, 6]],)), '0')
check('regression 3', solve(*([],)), '0')
check('regression 4', solve(*([[0, 0], [0, 0]],)), '0')
check('regression 5', solve(*([[2, 0, 1], [3, 4, 0]],)), '30/7')
check('regression 6', solve(*([[0, 0, 0], [1, 2, 3]],)), '0')
check('regression 7', solve(*([[1, 2], [3, 0], [2, 4]],)), '4')
check("variable diagonal mass",solve([[N,0],[0,N]]),str(2*N))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 8 | 8 | Passed |
| regression 2 | 0 | 0 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 15/7 | 30/7 | Failed |
| regression 6 | 0 | 0 | Passed |
| regression 7 | 2 | 4 | Failed |
| variable diagonal mass | 2 | 2 | Passed |
SHA-256 / cdcbae29cfa03edf6186c71200cfccbd4f966bc461a84d402a6467be4e02c44f
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:39:09.680241+00:00.
Case digest / 5b75346845dfd9133e0308a354d308a5d108b8757a638d47a09c871056329f00