FAILURE MAP
← Case archive

FA-6161 / Polynomial arithmetic / Open access

Multiply polynomial by monomial · case 01

Zeroes appended at the high-degree end do not shift powers.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Zeroes appended at the high-degree end do not shift powers.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return [0]*degree+coeff if coeff else []

Unsuccessful approach: Degree multiplication is confused with exponent shifting.

Case contract

Integer coefficients in ascending power order and integer evaluation bounds; missing high-degree coefficients are zero. Rational outputs are reduced Fraction strings; the zero-polynomial degree is -1. degree>=0; multiply by x**degree, representing an empty zero polynomial as []. Exact operational definition: [0]*degree+coeff if coeff else []

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Polynomial arithmetic results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(coeff, degree):
    return coeff+[0]*degree
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 2)', solve(*([1, 2], 2)), [0, 0, 1, 2])
check('fixture 2: ([3], 0)', solve(*([3], 0)), [3])
check('fixture 3: ([], 3)', solve(*([], 3)), [])
check('fixture 4: ([0, 1], 1)', solve(*([0, 1], 1)), [0, 0, 1])
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 fixtureActualExpectedOutcome
fixture 1: ([1, 2], 2)[1, 2, 0, 0][0, 0, 1, 2]Failed
fixture 2: ([3], 0)[3][3]Passed
fixture 3: ([], 3)[0, 0, 0][]Failed
fixture 4: ([0, 1], 1)[0, 1, 0][0, 0, 1]Failed

SHA-256 / 1f4e956bd5474acd7b4964350f710c2771f4717431160d9af2cb78a23e9efc2c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(coeff, degree):
    return [c*degree for c in coeff]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 2)', solve(*([1, 2], 2)), [0, 0, 1, 2])
check('fixture 2: ([3], 0)', solve(*([3], 0)), [3])
check('fixture 3: ([], 3)', solve(*([], 3)), [])
check('fixture 4: ([0, 1], 1)', solve(*([0, 1], 1)), [0, 0, 1])
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 fixtureActualExpectedOutcome
fixture 1: ([1, 2], 2)[2, 4][0, 0, 1, 2]Failed
fixture 2: ([3], 0)[0][3]Failed
fixture 3: ([], 3)[][]Passed
fixture 4: ([0, 1], 1)[0, 1][0, 0, 1]Failed

SHA-256 / f01eb82c2d7f5be5d37e3e02c3544a236ace57b1e8efc42d404eb6ef923a3213

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(coeff, degree):
    return [0]*degree+coeff if coeff else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 2)', solve(*([1, 2], 2)), [0, 0, 1, 2])
check('fixture 2: ([3], 0)', solve(*([3], 0)), [3])
check('fixture 3: ([], 3)', solve(*([], 3)), [])
check('fixture 4: ([0, 1], 1)', solve(*([0, 1], 1)), [0, 0, 1])
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 fixtureActualExpectedOutcome
fixture 1: ([1, 2], 2)[0, 0, 1, 2][0, 0, 1, 2]Passed
fixture 2: ([3], 0)[3][3]Passed
fixture 3: ([], 3)[][]Passed
fixture 4: ([0, 1], 1)[0, 0, 1][0, 0, 1]Passed

SHA-256 / d7d1b5cf5553a5b30d3ee52fe73f171a5c5fba67394cb4c973277f36cebe9002

Verification & scope

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:37:58.214389+00:00.

Case digest / a34530e4e2b2b0a5d27a39096f1cafee39049fae5a2838b362f6caf1969f6105