FAILURE MAP
← Case archive

FA-6016 / Linear algebra / Open access

Matrix two determinant · case 01

The off-diagonal product is added instead of subtracted.

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

ROOT CAUSE

The off-diagonal product is added instead of subtracted.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return m[0][0]*m[1][1]-m[0][1]*m[1][0]

Unsuccessful approach: Determinant sign is discarded despite representing orientation.

Case contract

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Matrix two determinant. Exact operational definition: m[0][0]*m[1][1]-m[0][1]*m[1][0]

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Linear algebra 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(m):
    return m[0][0]*m[1][1]+m[0][1]*m[1][0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), -2)
check('fixture 2: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), 1)
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), 0)
check('fixture 4: ([[0, 1], [1, 0]],)', solve(*([[0, 1], [1, 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], [3, 4]],)10-2Failed
fixture 2: ([[1, 0], [0, 1]],)11Passed
fixture 3: ([[1, 2], [2, 4]],)80Failed
fixture 4: ([[0, 1], [1, 0]],)1-1Failed

SHA-256 / 5502633a3846c798d8e4a5e571b54711a59c5c2b15e13a922041483c14d24622

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

SHA-256 / 45d1ea058f8fb1c02ae459abd4b734a90a13b0b46a85d389644da4755abc8136

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

SHA-256 / b0add1fe72d3d322479934a99805faef4dd44da740a04353736977ca9ea907fa

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

Case digest / 182cae5fdb9dac0a0550e4bc1465ffb14d1b78c0b23f32dcb6b4852eeb9342ba