broken_source:
"""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, v):
    return [sum(row)*sum(v) for row in m]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]], [2, 1])', solve(*([[1, 2], [3, 4]], [2, 1])), [4, 10])
check('fixture 2: ([[0, 0]], [1, 2])', solve(*([[0, 0]], [1, 2])), [0])
check('fixture 3: ([[1, 0], [0, 1]], [3, 4])', solve(*([[1, 0], [0, 1]], [3, 4])), [3, 4])
check('fixture 4: ([], [])', solve(*([], [])), [])
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)

source:
"""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, v):
    return [sum(row)+sum(v) for row in m]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]], [2, 1])', solve(*([[1, 2], [3, 4]], [2, 1])), [4, 10])
check('fixture 2: ([[0, 0]], [1, 2])', solve(*([[0, 0]], [1, 2])), [0])
check('fixture 3: ([[1, 0], [0, 1]], [3, 4])', solve(*([[1, 0], [0, 1]], [3, 4])), [3, 4])
check('fixture 4: ([], [])', solve(*([], [])), [])
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)

prompt:
Products between nonmatching coordinates contaminate each row.

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 vector product. Exact operational definition: [sum(x*y for x,y in zip(row,v)) for row in m]

split: open-access


broken_source:
"""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(a, b):
    return [[sum(x*y for x,y in zip(row,col)) for col in b] for row in a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]], [[5, 6], [7, 8]])', solve(*([[1, 2], [3, 4]], [[5, 6], [7, 8]])), [[19, 22], [43, 50]])
check('fixture 2: ([[1, 0], [0, 1]], [[2, 3], [4, 5]])', solve(*([[1, 0], [0, 1]], [[2, 3], [4, 5]])), [[2, 3], [4, 5]])
check('fixture 3: ([[2]], [[3]])', solve(*([[2]], [[3]])), [[6]])
check('fixture 4: ([[0, 0]], [[1], [2]])', solve(*([[0, 0]], [[1], [2]])), [[0]])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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(a, b):
    return [[sum(row)*sum(col) for col in zip(*b)] for row in a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]], [[5, 6], [7, 8]])', solve(*([[1, 2], [3, 4]], [[5, 6], [7, 8]])), [[19, 22], [43, 50]])
check('fixture 2: ([[1, 0], [0, 1]], [[2, 3], [4, 5]])', solve(*([[1, 0], [0, 1]], [[2, 3], [4, 5]])), [[2, 3], [4, 5]])
check('fixture 3: ([[2]], [[3]])', solve(*([[2]], [[3]])), [[6]])
check('fixture 4: ([[0, 0]], [[1], [2]])', solve(*([[0, 0]], [[1], [2]])), [[0]])
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)

prompt:
Rows of the right operand are used where columns are required.

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 multiply row column. Exact operational definition: [[sum(x*y for x,y in zip(row,col)) for col in zip(*b)] for row in a]

split: open-access


broken_source:
"""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(a, b):
    return [[x*y for x in a] for y in b]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4, 5])', solve(*([1, 2], [3, 4, 5])), [[3, 4, 5], [6, 8, 10]])
check('fixture 2: ([0], [2, 3])', solve(*([0], [2, 3])), [[0, 0]])
check('fixture 3: ([], [1])', solve(*([], [1])), [])
check('fixture 4: ([2], [3])', solve(*([2], [3])), [[6]])
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)

source:
"""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(a, b):
    return [[x+y for y in b] for x in a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4, 5])', solve(*([1, 2], [3, 4, 5])), [[3, 4, 5], [6, 8, 10]])
check('fixture 2: ([0], [2, 3])', solve(*([0], [2, 3])), [[0, 0]])
check('fixture 3: ([], [1])', solve(*([], [1])), [])
check('fixture 4: ([2], [3])', solve(*([2], [3])), [[6]])
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)

prompt:
The outer product axes are reversed.

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. Outer product shape. Exact operational definition: [[x*y for y in b] for x in a]

split: open-access


broken_source:
"""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 sum(x for row in m for x in row)**2
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]],)), 30)
check('fixture 2: ([[1, -1]],)', solve(*([[1, -1]],)), 2)
check('fixture 3: ([[0]],)', solve(*([[0]],)), 0)
check('fixture 4: ([],)', solve(*([],)), 0)
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)

source:
"""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 sum(abs(x) for row in m for x in row)
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]],)), 30)
check('fixture 2: ([[1, -1]],)', solve(*([[1, -1]],)), 2)
check('fixture 3: ([[0]],)', solve(*([[0]],)), 0)
check('fixture 4: ([],)', solve(*([],)), 0)
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)

prompt:
Squaring a total introduces cancellation and cross terms.

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 frobenius norm squared. Exact operational definition: sum(x*x for row in m for x in row)

split: open-access


broken_source:
"""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 max((sum(abs(x) for x in row) for row in m),default=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]],)), 6)
check('fixture 2: ([[1, -5], [2, 1]],)', solve(*([[1, -5], [2, 1]],)), 6)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[-3]],)', solve(*([[-3]],)), 3)
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)

source:
"""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 max((sum(x for x in col) for col in zip(*m)),default=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]],)), 6)
check('fixture 2: ([[1, -5], [2, 1]],)', solve(*([[1, -5], [2, 1]],)), 6)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[-3]],)', solve(*([[-3]],)), 3)
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)

prompt:
Maximum row sum computes the infinity norm.

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. Return the maximum absolute column sum, with zero for an empty matrix. Exact operational definition: max((sum(abs(x) for x in col) for col in zip(*m)),default=0)

split: open-access


broken_source:
"""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 max((sum(abs(x) for x in col) for col in zip(*m)),default=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]],)), 7)
check('fixture 2: ([[1, -5], [2, 1]],)', solve(*([[1, -5], [2, 1]],)), 6)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[-3]],)', solve(*([[-3]],)), 3)
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)

source:
"""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 max((abs(sum(row)) for row in m),default=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]],)), 7)
check('fixture 2: ([[1, -5], [2, 1]],)', solve(*([[1, -5], [2, 1]],)), 6)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[-3]],)', solve(*([[-3]],)), 3)
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)

prompt:
Maximum column sum computes the one-norm.

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. Return the maximum absolute row sum, with zero for an empty matrix. Exact operational definition: max((sum(abs(x) for x in row) for row in m),default=0)

split: open-access


broken_source:
"""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[1][1],m[0][1]],[m[1][0],m[0][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]],)), [[4, -2], [-3, 1]])
check('fixture 2: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), [[1, 0], [0, 1]])
check('fixture 3: ([[0, 1], [2, 0]],)', solve(*([[0, 1], [2, 0]],)), [[0, -1], [-2, 0]])
check('fixture 4: ([[0, 0], [0, 0]],)', solve(*([[0, 0], [0, 0]],)), [[0, 0], [0, 0]])
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)

source:
"""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[1][1],-m[1][0]],[-m[0][1],m[0][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]],)), [[4, -2], [-3, 1]])
check('fixture 2: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), [[1, 0], [0, 1]])
check('fixture 3: ([[0, 1], [2, 0]],)', solve(*([[0, 1], [2, 0]],)), [[0, -1], [-2, 0]])
check('fixture 4: ([[0, 0], [0, 0]],)', solve(*([[0, 0], [0, 0]],)), [[0, 0], [0, 0]])
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)

prompt:
Off-diagonal cofactors lack negative signs.

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. Two by two adjugate. Exact operational definition: [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]

split: open-access


broken_source:
"""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 [[str(x) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0], [0, 4]],)', solve(*([[2, 0], [0, 4]],)), [['1/2', '0'], ['0', '1/4']])
check('fixture 2: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), [['-2', '1'], ['3/2', '-1/2']])
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), None)
check('fixture 4: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [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)

source:
"""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 [[str(Fraction(1,x)) if x else "0" for x in row] for row in m]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0], [0, 4]],)', solve(*([[2, 0], [0, 4]],)), [['1/2', '0'], ['0', '1/4']])
check('fixture 2: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), [['-2', '1'], ['3/2', '-1/2']])
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), None)
check('fixture 4: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [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)

prompt:
The adjugate is not divided by the determinant.

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. Input is 2 by 2; return None for a singular matrix and otherwise a 2 by 2 list of reduced Fraction strings. Exact operational definition: [[str(Fraction(x,m[0][0]*m[1][1]-m[0][1]*m[1][0])) for x in row] for row in [[m[1][1],-m[0][1]],[-m[1][0],m[0][0]]]] if m[0][0]*m[1][1]!=m[0][1]*m[1][0] else None

split: open-access


broken_source:
"""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 all(m[i][i]>=0 for i in range(len(m)))
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]],)), False)
check('fixture 2: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), True)
check('fixture 3: ([[-1, 0], [0, -2]],)', solve(*([[-1, 0], [0, -2]],)), True)
check('fixture 4: ([],)', solve(*([],)), True)
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)

source:
"""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 all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(i-1))
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]],)), False)
check('fixture 2: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), True)
check('fixture 3: ([[-1, 0], [0, -2]],)', solve(*([[-1, 0], [0, -2]],)), True)
check('fixture 4: ([],)', solve(*([],)), True)
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)

prompt:
Diagonal positivity is unrelated to transpose symmetry.

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 symmetry predicate. Exact operational definition: all(m[i][j]==m[j][i] for i in range(len(m)) for j in range(len(m)))

split: open-access


broken_source:
"""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 all(m[i][i]!=0 for i in range(len(m)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [0, 3]],)', solve(*([[1, 2], [0, 3]],)), False)
check('fixture 2: ([[0, 0], [0, 0]],)', solve(*([[0, 0], [0, 0]],)), True)
check('fixture 3: ([[2, 0], [0, 3]],)', solve(*([[2, 0], [0, 3]],)), True)
check('fixture 4: ([[1, 0], [2, 3]],)', solve(*([[1, 0], [2, 3]],)), False)
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)

source:
"""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 all(m[i][j]==0 for i in range(len(m)) for j in range(i))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [0, 3]],)', solve(*([[1, 2], [0, 3]],)), False)
check('fixture 2: ([[0, 0], [0, 0]],)', solve(*([[0, 0], [0, 0]],)), True)
check('fixture 3: ([[2, 0], [0, 3]],)', solve(*([[2, 0], [0, 3]],)), True)
check('fixture 4: ([[1, 0], [2, 3]],)', solve(*([[1, 0], [2, 3]],)), False)
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)

prompt:
Nonzero diagonal entries do not constrain off-diagonal entries.

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 diagonal predicate. Exact operational definition: all(i==j or m[i][j]==0 for i in range(len(m)) for j in range(len(m)))

split: open-access


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

source:
"""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 [1,-m[0][0]-m[1][1],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, 0], [0, 2]],)', solve(*([[1, 0], [0, 2]],)), [2, -3, 1])
check('fixture 2: ([[0, 1], [-1, 0]],)', solve(*([[0, 1], [-1, 0]],)), [1, 0, 1])
check('fixture 3: ([[0, 0], [0, 0]],)', solve(*([[0, 0], [0, 0]],)), [0, 0, 1])
check('fixture 4: ([[2, 1], [3, 4]],)', solve(*([[2, 1], [3, 4]],)), [5, -6, 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)

prompt:
The trace coefficient has the wrong sign.

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. Return coefficients of det(lambda*I-m) in ascending power order. Exact operational definition: [m[0][0]*m[1][1]-m[0][1]*m[1][0],-m[0][0]-m[1][1],1]

split: open-access


broken_source:
"""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(a, b):
    return sum(a)==0 or sum(b)==0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0], [0, 1])', solve(*([1, 0], [0, 1])), True)
check('fixture 2: ([1, -1], [1, 0])', solve(*([1, -1], [1, 0])), False)
check('fixture 3: ([1, 1], [1, -1])', solve(*([1, 1], [1, -1])), True)
check('fixture 4: ([1, 0], [1, 0])', solve(*([1, 0], [1, 0])), False)
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)

source:
"""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(a, b):
    return sum(x*y for x,y in zip(a,b))==1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0], [0, 1])', solve(*([1, 0], [0, 1])), True)
check('fixture 2: ([1, -1], [1, 0])', solve(*([1, -1], [1, 0])), False)
check('fixture 3: ([1, 1], [1, -1])', solve(*([1, 1], [1, -1])), True)
check('fixture 4: ([1, 0], [1, 0])', solve(*([1, 0], [1, 0])), False)
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)

prompt:
Zero coordinate sum is confused with zero mutual dot product.

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. Orthogonality zero dot. Exact operational definition: sum(x*y for x,y in zip(a,b))==0

split: open-access


broken_source:
"""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, p):
    return [m[i][0]*p[0]+m[i][1]*p[1] for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0, 3], [0, 2, 4]], [1, 1])', solve(*([[2, 0, 3], [0, 2, 4]], [1, 1])), [5, 6])
check('fixture 2: ([[1, 0, 2], [0, 1, 3]], [0, 0])', solve(*([[1, 0, 2], [0, 1, 3]], [0, 0])), [2, 3])
check('fixture 3: ([[0, -1, 0], [1, 0, 0]], [2, 3])', solve(*([[0, -1, 0], [1, 0, 0]], [2, 3])), [-3, 2])
check('fixture 4: ([[1, 0, 0], [0, 1, 0]], [4, 5])', solve(*([[1, 0, 0], [0, 1, 0]], [4, 5])), [4, 5])
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)

source:
"""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, p):
    return [m[i][0]*(p[0]+m[i][2])+m[i][1]*p[1] for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[2, 0, 3], [0, 2, 4]], [1, 1])', solve(*([[2, 0, 3], [0, 2, 4]], [1, 1])), [5, 6])
check('fixture 2: ([[1, 0, 2], [0, 1, 3]], [0, 0])', solve(*([[1, 0, 2], [0, 1, 3]], [0, 0])), [2, 3])
check('fixture 3: ([[0, -1, 0], [1, 0, 0]], [2, 3])', solve(*([[0, -1, 0], [1, 0, 0]], [2, 3])), [-3, 2])
check('fixture 4: ([[1, 0, 0], [0, 1, 0]], [4, 5])', solve(*([[1, 0, 0], [0, 1, 0]], [4, 5])), [4, 5])
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)

prompt:
The homogeneous translation column is omitted.

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. m is a 2 by 3 affine matrix and p has length two; implicit homogeneous coordinate is one. Exact operational definition: [m[i][0]*p[0]+m[i][1]*p[1]+m[i][2] for i in range(2)]

split: open-access


broken_source:
"""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(a, b, c):
    return sum(x*y*z for x,y,z in zip(a,b,c))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0, 0], [0, 1, 0], [0, 0, 1])', solve(*([1, 0, 0], [0, 1, 0], [0, 0, 1])), 1)
check('fixture 2: ([0, 1, 0], [1, 0, 0], [0, 0, 1])', solve(*([0, 1, 0], [1, 0, 0], [0, 0, 1])), -1)
check('fixture 3: ([1, 2, 3], [1, 2, 3], [2, 1, 0])', solve(*([1, 2, 3], [1, 2, 3], [2, 1, 0])), 0)
check('fixture 4: ([2, 0, 0], [0, 3, 0], [0, 0, 4])', solve(*([2, 0, 0], [0, 3, 0], [0, 0, 4])), 24)
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)

source:
"""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(a, b, c):
    return abs(a[0]*(b[1]*c[2]-b[2]*c[1])+a[1]*(b[2]*c[0]-b[0]*c[2])+a[2]*(b[0]*c[1]-b[1]*c[0]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0, 0], [0, 1, 0], [0, 0, 1])', solve(*([1, 0, 0], [0, 1, 0], [0, 0, 1])), 1)
check('fixture 2: ([0, 1, 0], [1, 0, 0], [0, 0, 1])', solve(*([0, 1, 0], [1, 0, 0], [0, 0, 1])), -1)
check('fixture 3: ([1, 2, 3], [1, 2, 3], [2, 1, 0])', solve(*([1, 2, 3], [1, 2, 3], [2, 1, 0])), 0)
check('fixture 4: ([2, 0, 0], [0, 3, 0], [0, 0, 4])', solve(*([2, 0, 0], [0, 3, 0], [0, 0, 4])), 24)
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)

prompt:
Coordinatewise triple multiplication omits determinant permutations.

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. Three dimensional scalar triple product. Exact operational definition: a[0]*(b[1]*c[2]-b[2]*c[1])+a[1]*(b[2]*c[0]-b[0]*c[2])+a[2]*(b[0]*c[1]-b[1]*c[0])

split: open-access


broken_source:
"""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, x):
    return sum(c*x**i for i,c in enumerate(reversed(coeff)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3], 2)', solve(*([1, 2, 3], 2)), 17)
check('fixture 2: ([4], 7)', solve(*([4], 7)), 4)
check('fixture 3: ([], 2)', solve(*([], 2)), 0)
check('fixture 4: ([0, 1], -3)', solve(*([0, 1], -3)), -3)
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)

source:
"""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, x):
    return sum(c*x 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, 3], 2)', solve(*([1, 2, 3], 2)), 17)
check('fixture 2: ([4], 7)', solve(*([4], 7)), 4)
check('fixture 3: ([], 2)', solve(*([], 2)), 0)
check('fixture 4: ([0, 1], -3)', solve(*([0, 1], -3)), -3)
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)

prompt:
Ascending coefficients are evaluated as descending coefficients.

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. Ascending polynomial evaluation. Exact operational definition: sum(c*x**i for i,c in enumerate(coeff))

split: open-access


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

source:
"""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):
    return [(i+1)*c for i,c in enumerate(coeff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [2, 6])
check('fixture 2: ([4],)', solve(*([4],)), [])
check('fixture 3: ([],)', solve(*([],)), [])
check('fixture 4: ([0, 0, 5, 2],)', solve(*([0, 0, 5, 2],)), [0, 10, 6])
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)

prompt:
Power coefficients are not multiplied by their degree.

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. Formal polynomial derivative. Exact operational definition: [i*c for i,c in enumerate(coeff) if i]

split: open-access


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

source:
"""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):
    return [str(Fraction(c,i+1)) for i,c in enumerate(coeff)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, 3],)', solve(*([2, 3],)), ['0', '2', '3/2'])
check('fixture 2: ([0, 0, 3],)', solve(*([0, 0, 3],)), ['0', '0', '0', '1'])
check('fixture 3: ([],)', solve(*([],)), ['0'])
check('fixture 4: ([5],)', solve(*([5],)), ['0', '5'])
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)

prompt:
Antiderivative coefficients are shifted without degree division.

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. Formal polynomial integral zero constant. Exact operational definition: ["0"]+[str(Fraction(c,i+1)) for i,c in enumerate(coeff)]

split: open-access


broken_source:
"""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(a, b):
    return [x*y for x,y in zip(a,b)]
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])), [3, 10, 8])
check('fixture 2: ([0, 1], [0, 1])', solve(*([0, 1], [0, 1])), [0, 0, 1])
check('fixture 3: ([2], [3])', solve(*([2], [3])), [6])
check('fixture 4: ([], [1])', solve(*([], [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)

source:
"""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(a, b):
    return [sum(a[j]*b[i-j] for j in range(len(a)) if 0<=i-j<len(b)) for i in range(max(len(a),len(b)))]
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])), [3, 10, 8])
check('fixture 2: ([0, 1], [0, 1])', solve(*([0, 1], [0, 1])), [0, 0, 1])
check('fixture 3: ([2], [3])', solve(*([2], [3])), [6])
check('fixture 4: ([], [1])', solve(*([], [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)

prompt:
Elementwise multiplication omits cross-degree products.

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. Polynomial coefficient convolution. Exact operational definition: [sum(a[j]*b[i-j] for j in range(len(a)) if 0<=i-j<len(b)) for i in range(len(a)+len(b)-1)] if a and b else []

split: open-access


broken_source:
"""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(a, b):
    return [x+y for x,y in zip(a,b)]
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])), [5, 2, 3])
check('fixture 2: ([], [2, 3])', solve(*([], [2, 3])), [2, 3])
check('fixture 3: ([1], [2, 3])', solve(*([1], [2, 3])), [3, 3])
check('fixture 4: ([], [])', solve(*([], [])), [])
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)

source:
"""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(a, b):
    return a+b
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])), [5, 2, 3])
check('fixture 2: ([], [2, 3])', solve(*([], [2, 3])), [2, 3])
check('fixture 3: ([1], [2, 3])', solve(*([1], [2, 3])), [3, 3])
check('fixture 4: ([], [])', solve(*([], [])), [])
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)

prompt:
Zipping stops at the shorter degree and loses coefficients.

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. Polynomial add unequal degree. Exact operational definition: [sum(pair) for pair in itertools.zip_longest(a,b,fillvalue=0)]

split: open-access


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

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

prompt:
Storage length is mistaken for the highest nonzero degree.

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. Polynomial degree trailing zeroes. Exact operational definition: max((i for i,c in enumerate(coeff) if c),default=-1)

split: open-access


broken_source:
"""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(a, b, c):
    return b*b+4*a*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 0, -1)', solve(*(1, 0, -1)), 4)
check('fixture 2: (1, 2, 1)', solve(*(1, 2, 1)), 0)
check('fixture 3: (1, 0, 1)', solve(*(1, 0, 1)), -4)
check('fixture 4: (2, 3, 1)', solve(*(2, 3, 1)), 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)

source:
"""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(a, b, c):
    return b*b-2*a*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 0, -1)', solve(*(1, 0, -1)), 4)
check('fixture 2: (1, 2, 1)', solve(*(1, 2, 1)), 0)
check('fixture 3: (1, 0, 1)', solve(*(1, 0, 1)), -4)
check('fixture 4: (2, 3, 1)', solve(*(2, 3, 1)), 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)

prompt:
The product term uses addition instead of subtraction.

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. Quadratic discriminant. Exact operational definition: b*b-4*a*c

split: open-access


broken_source:
"""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(a, b, c):
    return str(Fraction(b,a))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 3, 2)', solve(*(1, 3, 2)), '-3')
check('fixture 2: (2, -3, 1)', solve(*(2, -3, 1)), '3/2')
check('fixture 3: (1, 0, -1)', solve(*(1, 0, -1)), '0')
check('fixture 4: (-2, 4, 1)', solve(*(-2, 4, 1)), '2')
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)

source:
"""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(a, b, c):
    return str(Fraction(-b,2*a))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 3, 2)', solve(*(1, 3, 2)), '-3')
check('fixture 2: (2, -3, 1)', solve(*(2, -3, 1)), '3/2')
check('fixture 3: (1, 0, -1)', solve(*(1, 0, -1)), '0')
check('fixture 4: (-2, 4, 1)', solve(*(-2, 4, 1)), '2')
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)

prompt:
Vieta root sum has the opposite sign.

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. a!=0; return the reduced rational sum of both algebraic roots, including complex roots counted algebraically. Exact operational definition: str(Fraction(-b,a))

split: open-access


broken_source:
"""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(a, b, c):
    return str(Fraction(-c,a))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 3, 2)', solve(*(1, 3, 2)), '2')
check('fixture 2: (2, -3, 1)', solve(*(2, -3, 1)), '1/2')
check('fixture 3: (1, 0, -1)', solve(*(1, 0, -1)), '-1')
check('fixture 4: (-2, 4, 1)', solve(*(-2, 4, 1)), '-1/2')
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)

source:
"""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(a, b, c):
    return str(Fraction(c,b)) if b else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 3, 2)', solve(*(1, 3, 2)), '2')
check('fixture 2: (2, -3, 1)', solve(*(2, -3, 1)), '1/2')
check('fixture 3: (1, 0, -1)', solve(*(1, 0, -1)), '-1')
check('fixture 4: (-2, 4, 1)', solve(*(-2, 4, 1)), '-1/2')
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)

prompt:
The product receives an unnecessary sign flip.

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. a!=0; return the reduced rational product of both algebraic roots. Exact operational definition: str(Fraction(c,a))

split: open-access


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

source:
"""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):
    return sum(c*(-1)**(i+1) for i,c in enumerate(coeff))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), 2)
check('fixture 2: ([5],)', solve(*([5],)), 5)
check('fixture 3: ([0, 1],)', solve(*([0, 1],)), -1)
check('fixture 4: ([],)', solve(*([],)), 0)
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)

prompt:
Coefficient sum evaluates at positive one rather than negative one.

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. Polynomial value at minus one. Exact operational definition: sum(c*(-1)**i for i,c in enumerate(coeff))

split: open-access


broken_source:
"""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):
    return [c for i,c in enumerate(coeff) if i%2==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],)), [1, 0, 3, 0])
check('fixture 2: ([0, 1],)', solve(*([0, 1],)), [0, 0])
check('fixture 3: ([5],)', solve(*([5],)), [5])
check('fixture 4: ([],)', solve(*([],)), [])
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)

source:
"""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):
    return [c if i%2 else 0 for i,c in enumerate(coeff)]
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],)), [1, 0, 3, 0])
check('fixture 2: ([0, 1],)', solve(*([0, 1],)), [0, 0])
check('fixture 3: ([5],)', solve(*([5],)), [5])
check('fixture 4: ([],)', solve(*([],)), [])
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)

prompt:
Removing odd positions compresses the remaining powers.

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. Polynomial even part. Exact operational definition: [c if i%2==0 else 0 for i,c in enumerate(coeff)]

split: open-access


broken_source:
"""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):
    return [c for i,c in enumerate(coeff) if i%2]
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],)), [0, 2, 0, 4])
check('fixture 2: ([0, 1],)', solve(*([0, 1],)), [0, 1])
check('fixture 3: ([5],)', solve(*([5],)), [0])
check('fixture 4: ([],)', solve(*([],)), [])
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)

source:
"""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):
    return [c if i%2==0 else 0 for i,c in enumerate(coeff)]
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],)), [0, 2, 0, 4])
check('fixture 2: ([0, 1],)', solve(*([0, 1],)), [0, 1])
check('fixture 3: ([5],)', solve(*([5],)), [0])
check('fixture 4: ([],)', solve(*([],)), [])
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)

prompt:
Filtering coefficients changes their exponents.

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. Polynomial odd part. Exact operational definition: [c if i%2 else 0 for i,c in enumerate(coeff)]

split: open-access


broken_source:
"""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)

source:
"""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)

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

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 []

split: open-access


broken_source:
"""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, a, b):
    return str(sum(Fraction(c*b**(i+1),i+1) for i,c in enumerate(coeff)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 1, 3)', solve(*([1, 2], 1, 3)), '10')
check('fixture 2: ([0, 1], -1, 1)', solve(*([0, 1], -1, 1)), '0')
check('fixture 3: ([3], 4, 4)', solve(*([3], 4, 4)), '0')
check('fixture 4: ([2], 3, 1)', solve(*([2], 3, 1)), '-4')
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)

source:
"""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, a, b):
    return str(sum(Fraction(c*(b**(i+1)+a**(i+1)),i+1) for i,c in enumerate(coeff)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 1, 3)', solve(*([1, 2], 1, 3)), '10')
check('fixture 2: ([0, 1], -1, 1)', solve(*([0, 1], -1, 1)), '0')
check('fixture 3: ([3], 4, 4)', solve(*([3], 4, 4)), '0')
check('fixture 4: ([2], 3, 1)', solve(*([2], 3, 1)), '-4')
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)

prompt:
The antiderivative at the lower bound is omitted.

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. a and b may be in either order; return the exact signed definite integral. Exact operational definition: str(sum((Fraction(c*(b**(i+1)-a**(i+1)),i+1) for i,c in enumerate(coeff)),Fraction()))

split: open-access


broken_source:
"""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):
    return [-c 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, 3],)', solve(*([1, 2, 3],)), [1, -2, 3])
check('fixture 2: ([5],)', solve(*([5],)), [5])
check('fixture 3: ([0, 1, 0, -2],)', solve(*([0, 1, 0, -2],)), [0, -1, 0, 2])
check('fixture 4: ([],)', solve(*([],)), [])
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)

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

prompt:
Negating the output is confused with negating the argument.

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. Polynomial compose negative argument. Exact operational definition: [c*(-1)**i for i,c in enumerate(coeff)]

split: open-access


broken_source:
"""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(values):
    return str(statistics.pvariance([Fraction(v) for v in values])) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), '1')
check('fixture 2: ([2, 4],)', solve(*([2, 4],)), '2')
check('fixture 3: ([5, 5, 5],)', solve(*([5, 5, 5],)), '0')
check('fixture 4: ([7],)', solve(*([7],)), None)
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)

source:
"""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(values):
    return str(sum((Fraction(v)-statistics.mean(values))**2 for v in values)/(len(values)+1)) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), '1')
check('fixture 2: ([2, 4],)', solve(*([2, 4],)), '2')
check('fixture 3: ([5, 5, 5],)', solve(*([5, 5, 5],)), '0')
check('fixture 4: ([7],)', solve(*([7],)), None)
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)

prompt:
Population normalization biases the sample variance.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Sample variance bessel correction. Exact operational definition: str(statistics.variance([Fraction(v) for v in values])) if len(values)>1 else None

split: open-access


broken_source:
"""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(values):
    return str(sorted(values)[len(values)//2]) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), '5')
check('fixture 2: ([1, 2, 100],)', solve(*([1, 2, 100],)), '2')
check('fixture 3: ([4],)', solve(*([4],)), '4')
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return str(Fraction(min(values)+max(values),2)) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), '5')
check('fixture 2: ([1, 2, 100],)', solve(*([1, 2, 100],)), '2')
check('fixture 3: ([4],)', solve(*([4],)), '4')
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
Only the upper central observation is selected for even samples.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Median even middle average. Exact operational definition: str(statistics.median([Fraction(v) for v in values])) if values else None

split: open-access


broken_source:
"""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(values):
    return sorted(values)[len(values)//2] if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), 2)
check('fixture 2: ([9, 1, 2],)', solve(*([9, 1, 2],)), 2)
check('fixture 3: ([4],)', solve(*([4],)), 4)
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return statistics.median(values) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), 2)
check('fixture 2: ([9, 1, 2],)', solve(*([9, 1, 2],)), 2)
check('fixture 3: ([4],)', solve(*([4],)), 4)
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
The upper middle position violates the lower-median convention.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Lower median order statistic. Exact operational definition: sorted(values)[(len(values)-1)//2] if values else None

split: open-access


broken_source:
"""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(values):
    return sorted(values)[(len(values)-1)//2] if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), 8)
check('fixture 2: ([9, 1, 2],)', solve(*([9, 1, 2],)), 2)
check('fixture 3: ([4],)', solve(*([4],)), 4)
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return statistics.median(values) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 8, 9],)', solve(*([1, 2, 8, 9],)), 8)
check('fixture 2: ([9, 1, 2],)', solve(*([9, 1, 2],)), 2)
check('fixture 3: ([4],)', solve(*([4],)), 4)
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
The lower middle position violates the upper-median convention.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Upper median order statistic. Exact operational definition: sorted(values)[len(values)//2] if values else None

split: open-access


broken_source:
"""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(values):
    return max(set(values),key=lambda x:(values.count(x),x)) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([3, 3, 1, 1],)', solve(*([3, 3, 1, 1],)), 1)
check('fixture 2: ([2, 1, 2],)', solve(*([2, 1, 2],)), 2)
check('fixture 3: ([7],)', solve(*([7],)), 7)
check('fixture 4: ([],)', solve(*([],)), None)
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)

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

prompt:
The largest tied mode is selected instead of the smallest.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Return the smallest observation among tied highest-frequency values, or None for empty input. Exact operational definition: min(set(values),key=lambda x:(-values.count(x),x)) if values else None

split: open-access


broken_source:
"""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(values):
    return [statistics.mode(values)] if values else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([3, 3, 1, 1, 2],)', solve(*([3, 3, 1, 1, 2],)), [1, 3])
check('fixture 2: ([2, 1, 2],)', solve(*([2, 1, 2],)), [2])
check('fixture 3: ([7],)', solve(*([7],)), [7])
check('fixture 4: ([],)', solve(*([],)), [])
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)

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

prompt:
Only one mode is returned when frequencies tie.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Return every highest-frequency observation value in sorted order, or [] for empty input. Exact operational definition: sorted(v for v in set(values) if values.count(v)==max(map(values.count,values))) if values else []

split: open-access


broken_source:
"""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(values):
    return str(statistics.median([abs(Fraction(v)) for v in values])) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 100],)', solve(*([1, 2, 100],)), '1')
check('fixture 2: ([10, 10, 10],)', solve(*([10, 10, 10],)), '0')
check('fixture 3: ([1, 3],)', solve(*([1, 3],)), '1')
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return str(statistics.mean([abs(Fraction(v)-statistics.median([Fraction(x) for x in values])) for v in values])) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 100],)', solve(*([1, 2, 100],)), '1')
check('fixture 2: ([10, 10, 10],)', solve(*([10, 10, 10],)), '0')
check('fixture 3: ([1, 3],)', solve(*([1, 3],)), '1')
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
Deviation from zero replaces deviation from the sample median.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Return the median of absolute deviations from the sample median, without consistency scaling. Exact operational definition: str(statistics.median([abs(Fraction(v)-statistics.median([Fraction(x) for x in values])) for v in values])) if values else None

split: open-access


broken_source:
"""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(values):
    return str(abs(Fraction(sum(values),len(values)))) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), '2/3')
check('fixture 2: ([5, 5],)', solve(*([5, 5],)), '0')
check('fixture 3: ([-2, 2],)', solve(*([-2, 2],)), '2')
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return str(sum(abs(Fraction(v)-Fraction(sum(values),len(values))) for v in values)) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), '2/3')
check('fixture 2: ([5, 5],)', solve(*([5, 5],)), '0')
check('fixture 3: ([-2, 2],)', solve(*([-2, 2],)), '2')
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
The absolute mean is substituted for average absolute residual.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Mean absolute deviation about mean. Exact operational definition: str(sum(abs(Fraction(v)-Fraction(sum(values),len(values))) for v in values)/len(values)) if values else None

split: open-access


broken_source:
"""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(values):
    return str(Fraction(sum(values),len(values))**2) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([-3, 3],)', solve(*([-3, 3],)), '9')
check('fixture 2: ([1, 2, 3],)', solve(*([1, 2, 3],)), '14/3')
check('fixture 3: ([0],)', solve(*([0],)), '0')
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return str(sum(v*v for v in values)) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([-3, 3],)', solve(*([-3, 3],)), '9')
check('fixture 2: ([1, 2, 3],)', solve(*([1, 2, 3],)), '14/3')
check('fixture 3: ([0],)', solve(*([0],)), '0')
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
Squaring the mean allows opposite-sign observations to cancel.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Root mean square squared. Exact operational definition: str(Fraction(sum(v*v for v in values),len(values))) if values else None

split: open-access


broken_source:
"""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(values):
    return str(Fraction(sum(values),len(values))) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, 6],)', solve(*([2, 6],)), '3')
check('fixture 2: ([4, 4],)', solve(*([4, 4],)), '4')
check('fixture 3: ([0, 3],)', solve(*([0, 3],)), None)
check('fixture 4: ([],)', solve(*([],)), None)
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)

source:
"""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(values):
    return str(sum(Fraction(1,v) for v in values)/len(values)) if values and all(v>0 for v in values) else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, 6],)', solve(*([2, 6],)), '3')
check('fixture 2: ([4, 4],)', solve(*([4, 4],)), '4')
check('fixture 3: ([0, 3],)', solve(*([0, 3],)), None)
check('fixture 4: ([],)', solve(*([],)), None)
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)

prompt:
The arithmetic mean replaces a reciprocal-domain mean.

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Harmonic mean rational. Exact operational definition: str(Fraction(len(values),1)/sum(Fraction(1,v) for v in values)) if values and all(v>0 for v in values) else None

split: open-access