FA-14756 / Numerics / Open access
Bernstein to power basis: bernstein normalization · case 01
The exact bernstein to power basis result violates the stated contract at bernstein normalization.
ROOT CAUSE
The bernstein normalization step uses 1 instead of math.comb(n,i).
THE FAILURE
The bernstein normalization step uses 1 instead of math.comb(n,i).
Unsuccessful approach: The partial repair math.comb(n-i,i) if i<=n-i else 0 still violates the bernstein normalization invariant.
Case contract
Input Bernstein coefficients b0..bn as integers; return exact ascending power coefficients of sum bi*choose(n,i)*t^i*(1-t)^(n-i).
Why this case matters
Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
b=x;n=len(b)-1;r=[0]*(n+1)
for i in range(n+1):
for j in range(n-i+1):
k=i+j
if k<0 or k>n:return None
r[k]+=b[i]*(1) * (math.comb(n-i,j)*(-1)**j if j<=n-i else 0)
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1, -1], [-1, 0, 0]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([2], [2]), ([-1, 0], [-1, 1])], [([-1, -1, 0], [-1, 0, 1]), ([0, -1], [0, -1]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([2, 0], [2, -2]), ([2, 1], [2, -1]), ([2, 2], [2, 0]), ([-1, -1, -1], [-1, 0, 0])], [([-1, -1, 1], [-1, 0, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([-1, 2, 1], [-1, 6, -4]), ([-1, 2, 2], [-1, 6, -3]), ([0, -1, -1], [0, -2, 1]), ([0, -1, 0], [0, -2, 2])], [([-1, -1, 2], [-1, 0, 3]), ([2, -1], [2, -3]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([0, 2, 2], [0, 4, -2]), ([1, -1, -1], [1, -4, 2]), ([1, -1, 0], [1, -4, 3]), ([1, -1, 1], [1, -4, 4])], [([-1, 1, -1], [-1, 4, -4]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([2, -1, -1], [2, -6, 3]), ([2, -1, 0], [2, -6, 4]), ([2, -1, 1], [2, -6, 5]), ([2, -1, 2], [2, -6, 6])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | [-1, 1, -1] | [-1, 0, 0] | Failed |
| explicit oracle 1 | [-1, 0] | [-1, 0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [2, -6, 8, -4, 2] | [2, 0, 0, 0, 0] | Failed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [2] | [2] | Passed |
| explicit oracle 7 | [-1, 1] | [-1, 1] | Passed |
SHA-256 / 161733c90c7a141ab174aaad03186e3252806bdddf3221988f18d056e56d7f9d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
b=x;n=len(b)-1;r=[0]*(n+1)
for i in range(n+1):
for j in range(n-i+1):
k=i+j
if k<0 or k>n:return None
r[k]+=b[i]*(math.comb(n-i,i) if i<=n-i else 0) * (math.comb(n-i,j)*(-1)**j if j<=n-i else 0)
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1, -1], [-1, 0, 0]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([2], [2]), ([-1, 0], [-1, 1])], [([-1, -1, 0], [-1, 0, 1]), ([0, -1], [0, -1]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([2, 0], [2, -2]), ([2, 1], [2, -1]), ([2, 2], [2, 0]), ([-1, -1, -1], [-1, 0, 0])], [([-1, -1, 1], [-1, 0, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([-1, 2, 1], [-1, 6, -4]), ([-1, 2, 2], [-1, 6, -3]), ([0, -1, -1], [0, -2, 1]), ([0, -1, 0], [0, -2, 2])], [([-1, -1, 2], [-1, 0, 3]), ([2, -1], [2, -3]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([0, 2, 2], [0, 4, -2]), ([1, -1, -1], [1, -4, 2]), ([1, -1, 0], [1, -4, 3]), ([1, -1, 1], [1, -4, 4])], [([-1, 1, -1], [-1, 4, -4]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([2, 2, 2, 2, 2], [2, 0, 0, 0, 0]), ([2, -1, -1], [2, -6, 3]), ([2, -1, 0], [2, -6, 4]), ([2, -1, 1], [2, -6, 5]), ([2, -1, 2], [2, -6, 6])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | [-1, 1, 0] | [-1, 0, 0] | Failed |
| explicit oracle 1 | [-1, 1] | [-1, 0] | Failed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [2, -2, -4, 6, -2] | [2, 0, 0, 0, 0] | Failed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [2] | [2] | Passed |
| explicit oracle 7 | [-1, 1] | [-1, 1] | Passed |
SHA-256 / 730cf97dea2386386d773540ec9172766fe4f58844612c4c62a9156a11474d96
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
A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:19.965174+00:00.
Case digest / bd6d1a641e1c65fb98d896bf6caa4650c328f46daffebc661f8cc8c1559759af