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(n):
    return n*n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 8)
check('fixture 4: (5,)', solve(*(5,)), 32)
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(n):
    return 2*n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 8)
check('fixture 4: (5,)', solve(*(5,)), 32)
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 size does not enumerate include/exclude choices.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Binary subsets count. Exact operational definition: 2**n

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(n):
    return 2**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 7)
check('fixture 4: (5,)', solve(*(5,)), 31)
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(n):
    return 2**(n-1) if n else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 7)
check('fixture 4: (5,)', solve(*(5,)), 31)
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 empty subset is included.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Nonempty subsets count. Exact operational definition: 2**n-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(n):
    return 2**n-1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 2)
check('fixture 4: (4,)', solve(*(4,)), 14)
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(n):
    return 2**n-2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 2)
check('fixture 4: (4,)', solve(*(4,)), 14)
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 whole set is retained among proper subsets.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Proper nonempty subsets count. Exact operational definition: max(0,2**n-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(n):
    return n*n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 1)
check('fixture 4: (5,)', solve(*(5,)), 10)
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(n):
    return n*(n-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 1)
check('fixture 4: (5,)', solve(*(5,)), 10)
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:
Self pairs and symmetric copies are included.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Unordered pair count. Exact operational definition: n*(n-1)//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(length, colors):
    return colors**length//length
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (5, 2)', solve(*(5, 2)), 8)
check('fixture 3: (2, 3)', solve(*(2, 3)), 6)
check('fixture 4: (3, 1)', solve(*(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(length, colors):
    return colors**length
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (5, 2)', solve(*(5, 2)), 8)
check('fixture 3: (2, 3)', solve(*(2, 3)), 6)
check('fixture 4: (3, 1)', solve(*(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:
Dividing all words by the length mishandles constant words with smaller rotation orbits.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. length is prime and colors>=1; count colorings of a labelled-position cycle up to rotations, retaining reflection distinctions. Exact operational definition: (colors**length+(length-1)*colors)//length

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(n):
    return math.factorial(n)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 2)
check('fixture 4: (5,)', solve(*(5,)), 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(n):
    return math.factorial(n)//2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 2)
check('fixture 4: (5,)', solve(*(5,)), 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:
Rotations are treated as different circular arrangements.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Rotations are identified but reflections remain distinct; the empty arrangement has count one. Exact operational definition: math.factorial(n-1) if n else 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(n):
    return n*(n-1)//2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 0)
check('fixture 2: (4,)', solve(*(4,)), 2)
check('fixture 3: (5,)', solve(*(5,)), 5)
check('fixture 4: (8,)', solve(*(8,)), 20)
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(n):
    return n*(n-3)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 0)
check('fixture 2: (4,)', solve(*(4,)), 2)
check('fixture 3: (5,)', solve(*(5,)), 5)
check('fixture 4: (8,)', solve(*(8,)), 20)
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:
Polygon sides are included as diagonals.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. n>=3; count unordered vertex pairs excluding adjacent vertices. Exact operational definition: n*(n-3)//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(rows, cols):
    return rows*cols
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 1)', solve(*(1, 1)), 1)
check('fixture 2: (2, 3)', solve(*(2, 3)), 18)
check('fixture 3: (0, 4)', solve(*(0, 4)), 0)
check('fixture 4: (3, 3)', solve(*(3, 3)), 36)
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(rows, cols):
    return math.comb(rows,2)*math.comb(cols,2)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 1)', solve(*(1, 1)), 1)
check('fixture 2: (2, 3)', solve(*(2, 3)), 18)
check('fixture 3: (0, 4)', solve(*(0, 4)), 0)
check('fixture 4: (3, 3)', solve(*(3, 3)), 36)
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 unit rectangles are counted.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Rectangular grid cell rectangle count. Exact operational definition: rows*(rows+1)*cols*(cols+1)//4

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(rows, cols):
    return rows*cols
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 8)
check('fixture 2: (1, 4)', solve(*(1, 4)), 4)
check('fixture 3: (0, 4)', solve(*(0, 4)), 0)
check('fixture 4: (3, 3)', solve(*(3, 3)), 14)
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(rows, cols):
    return sum((rows-s+1)*(cols-s+1) for s in range(1,min(rows,cols)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 8)
check('fixture 2: (1, 4)', solve(*(1, 4)), 4)
check('fixture 3: (0, 4)', solve(*(0, 4)), 0)
check('fixture 4: (3, 3)', solve(*(3, 3)), 14)
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 unit-square placements are counted.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. rows and cols are nonnegative cell counts; count all axis-aligned square placements of every positive integer side length. Exact operational definition: sum((rows-s+1)*(cols-s+1) for s in range(1,min(rows,cols)+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(right, down):
    return right*down
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 10)
check('fixture 2: (0, 4)', solve(*(0, 4)), 1)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (3, 3)', solve(*(3, 3)), 20)
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(right, down):
    return math.factorial(right+down)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 10)
check('fixture 2: (0, 4)', solve(*(0, 4)), 1)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (3, 3)', solve(*(3, 3)), 20)
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 path count is confused with grid area.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Lattice monotone path count. Exact operational definition: math.comb(right+down,right)

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(n):
    return math.comb(2*n,n)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 14)
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(n):
    return math.comb(2*n,n)//2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 14)
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:
Balanced totals are accepted without the prefix-balance constraint.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Catalan balanced parentheses. Exact operational definition: math.comb(2*n,n)//(n+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(n):
    return math.factorial(n)-1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (3,)', solve(*(3,)), 2)
check('fixture 4: (4,)', solve(*(4,)), 9)
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(n):
    return math.factorial(n)-n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (3,)', solve(*(3,)), 2)
check('fixture 4: (4,)', solve(*(4,)), 9)
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 only the identity leaves permutations with other fixed points.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Derangement count. Exact operational definition: sum((-1)**k * (math.factorial(n)//math.factorial(k)) for k in range(n+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(n, k):
    return k**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 6)
check('fixture 2: (2, 3)', solve(*(2, 3)), 0)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (4, 3)', solve(*(4, 3)), 36)
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(n, k):
    return k**n-k*(k-1)**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 6)
check('fixture 2: (2, 3)', solve(*(2, 3)), 0)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (4, 3)', solve(*(4, 3)), 36)
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:
All functions are accepted without requiring every target.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. n labelled source elements and k labelled target elements; every target must be used. The unique empty-to-empty function is counted. Exact operational definition: sum((-1)**i*math.comb(k,i)*(k-i)**n for i in range(k+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(n, k):
    return k**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 3)
check('fixture 2: (4, 2)', solve(*(4, 2)), 7)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 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(n, k):
    return sum((-1)**i*math.comb(k,i)*(k-i)**n for i in range(k+1))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 3)
check('fixture 2: (4, 2)', solve(*(4, 2)), 7)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 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:
Labelled assignments include empty blocks and distinguish block names.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Count partitions of n labelled elements into k nonempty unlabelled blocks, with S(0,0)=1. Exact operational definition: sum((-1)**i*math.comb(k,i)*(k-i)**n for i in range(k+1))//math.factorial(k)

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(n, parts):
    return math.comb(n-1,parts-1) if n>=parts else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (0, 3)', solve(*(0, 3)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 15)
check('fixture 4: (5, 1)', solve(*(5, 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(n, parts):
    return parts**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (0, 3)', solve(*(0, 3)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 15)
check('fixture 4: (5, 1)', solve(*(5, 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:
A positive-composition formula excludes zero components.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. parts>=1; count ordered vectors of parts nonnegative integers summing to n. Exact operational definition: math.comb(n+parts-1,parts-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(n, parts):
    return math.comb(n+parts-1,parts-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 2)', solve(*(5, 2)), 4)
check('fixture 2: (3, 3)', solve(*(3, 3)), 1)
check('fixture 3: (2, 3)', solve(*(2, 3)), 0)
check('fixture 4: (0, 1)', solve(*(0, 1)), 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(n, parts):
    return math.comb(n,parts)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 2)', solve(*(5, 2)), 4)
check('fixture 2: (3, 3)', solve(*(3, 3)), 1)
check('fixture 3: (2, 3)', solve(*(2, 3)), 0)
check('fixture 4: (0, 1)', solve(*(0, 1)), 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:
Zero components are admitted in a positive composition.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. parts>=1; count ordered vectors of parts strictly positive integers summing to n. Exact operational definition: math.comb(n-1,parts-1) if n>=parts else 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(counts):
    return math.factorial(sum(counts))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, 1],)', solve(*([2, 1],)), 3)
check('fixture 2: ([2, 2],)', solve(*([2, 2],)), 6)
check('fixture 3: ([3],)', solve(*([3],)), 1)
check('fixture 4: ([],)', 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(counts):
    return math.factorial(sum(counts))//sum(math.factorial(c) for c in counts) if counts else 1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, 1],)', solve(*([2, 1],)), 3)
check('fixture 2: ([2, 2],)', solve(*([2, 2],)), 6)
check('fixture 3: ([3],)', solve(*([3],)), 1)
check('fixture 4: ([],)', 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:
Repeated symbols are treated as separately labelled.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. counts is a list of nonnegative multiplicities of distinct symbols; count distinct words with exactly those multiplicities. Exact operational definition: math.factorial(sum(counts))//math.prod(math.factorial(c) for c in counts)

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(n, heads):
    return 2**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 6)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (3, 3)', solve(*(3, 3)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 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(n, heads):
    return n*heads
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 6)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (3, 3)', solve(*(3, 3)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 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:
Outcomes with other head counts are included.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Exact heads coin count. Exact operational definition: math.comb(n,heads)

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(n, k):
    return str(Fraction(1,2**n))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), '3/8')
check('fixture 2: (3, 0)', solve(*(3, 0)), '1/8')
check('fixture 3: (0, 0)', solve(*(0, 0)), '1')
check('fixture 4: (2, 3)', solve(*(2, 3)), '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(n, k):
    return str(Fraction(math.comb(n,k),n)) if n else "1"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), '3/8')
check('fixture 2: (3, 0)', solve(*(3, 0)), '1/8')
check('fixture 3: (0, 0)', solve(*(0, 0)), '1')
check('fixture 4: (2, 3)', solve(*(2, 3)), '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:
One arrangement is mistaken for all arrangements with k successes.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Binomial probability rational. Exact operational definition: str(Fraction(math.comb(n,k),2**n))

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(good, bad, draws, successes):
    return math.comb(good,successes)+math.comb(bad,draws-successes)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3, 3, 2)', solve(*(4, 3, 3, 2)), 18)
check('fixture 2: (2, 2, 2, 0)', solve(*(2, 2, 2, 0)), 1)
check('fixture 3: (3, 0, 2, 2)', solve(*(3, 0, 2, 2)), 3)
check('fixture 4: (1, 4, 2, 2)', solve(*(1, 4, 2, 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)

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(good, bad, draws, successes):
    return math.comb(good+bad,draws)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3, 3, 2)', solve(*(4, 3, 3, 2)), 18)
check('fixture 2: (2, 2, 2, 0)', solve(*(2, 2, 2, 0)), 1)
check('fixture 3: (3, 0, 2, 2)', solve(*(3, 0, 2, 2)), 3)
check('fixture 4: (1, 4, 2, 2)', solve(*(1, 4, 2, 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:
Independent selection counts are added instead of multiplied.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. good,bad,draws,successes>=0 and successes<=draws. Count unlabelled draws with exactly successes good objects; impossible population selections return zero. Exact operational definition: math.comb(good,successes)*math.comb(bad,draws-successes)

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(people, days):
    return days**people
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 4)', solve(*(2, 4)), 12)
check('fixture 2: (3, 3)', solve(*(3, 3)), 6)
check('fixture 3: (0, 5)', solve(*(0, 5)), 1)
check('fixture 4: (4, 3)', solve(*(4, 3)), 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(people, days):
    return math.comb(days,people)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 4)', solve(*(2, 4)), 12)
check('fixture 2: (3, 3)', solve(*(3, 3)), 6)
check('fixture 3: (0, 5)', solve(*(0, 5)), 1)
check('fixture 4: (4, 3)', solve(*(4, 3)), 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:
Colliding assignments remain in the sample count.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Birthday distinct assignments. Exact operational definition: math.perm(days,people)

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(teams, meetings):
    return teams*(teams-1)*meetings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 12)
check('fixture 2: (1, 2)', solve(*(1, 2)), 0)
check('fixture 3: (3, 1)', solve(*(3, 1)), 3)
check('fixture 4: (5, 0)', solve(*(5, 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(teams, meetings):
    return math.comb(teams,2)+meetings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 12)
check('fixture 2: (1, 2)', solve(*(1, 2)), 0)
check('fixture 3: (3, 1)', solve(*(3, 1)), 3)
check('fixture 4: (5, 0)', solve(*(5, 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:
Each game is counted from both participating teams.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Tournament round robin games. Exact operational definition: math.comb(teams,2)*meetings

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(internal):
    return 2*internal
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 4)
check('fixture 4: (7,)', solve(*(7,)), 8)
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(internal):
    return 2*internal+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 4)
check('fixture 4: (7,)', solve(*(7,)), 8)
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:
Outgoing child links are confused with leaves.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Every internal vertex has exactly two children; return the leaf count from the nonnegative internal-vertex count. Exact operational definition: internal+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(height):
    return 2**height-1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 3)
check('fixture 3: (3,)', solve(*(3,)), 15)
check('fixture 4: (5,)', solve(*(5,)), 63)
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(height):
    return 2**height
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 3)
check('fixture 3: (3,)', solve(*(3,)), 15)
check('fixture 4: (5,)', solve(*(5,)), 63)
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 root-at-height-zero convention is shifted by one.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Every level is full and the root has height zero; count all vertices through height. Exact operational definition: 2**(height+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(n, k):
    return math.comb(n,k)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 2)', solve(*(5, 2)), 6)
check('fixture 2: (3, 2)', solve(*(3, 2)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 0)
check('fixture 4: (6, 0)', solve(*(6, 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(n, k):
    return math.comb(n-k,k) if n-k>=k else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 2)', solve(*(5, 2)), 6)
check('fixture 2: (3, 2)', solve(*(3, 2)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 0)
check('fixture 4: (6, 0)', solve(*(6, 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:
Selections containing adjacent positions are not excluded.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Choose k positions among n linearly ordered positions with no adjacent selected pair. Exact operational definition: math.comb(n-k+1,k) if n-k+1>=k else 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(n):
    return 2**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 8)
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(n):
    return 2**n-n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 8)
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:
All bit strings are counted despite the adjacency constraint.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Binary strings no adjacent ones. Exact operational definition: sum(math.comb(n-k+1,k) for k in range((n+1)//2+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(n):
    return 2**n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 4)
check('fixture 4: (5,)', solve(*(5,)), 16)
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(n):
    return 2**(n-1) if n else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 4)
check('fixture 4: (5,)', solve(*(5,)), 16)
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:
Odd-cardinality subsets are included.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Even subset count. Exact operational definition: 1 if n==0 else 2**(n-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(n, k):
    return math.comb(n,k)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 11)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (2, 5)', solve(*(2, 5)), 4)
check('fixture 4: (0, 0)', solve(*(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(n, k):
    return sum(math.comb(n,i) for i in range(min(n,k)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 11)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (2, 5)', solve(*(2, 5)), 4)
check('fixture 4: (0, 0)', solve(*(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:
An exact-cardinality count replaces a cumulative count.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Cumulative binomial count. Exact operational definition: sum(math.comb(n,i) for i in range(min(n,k)+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(n):
    return n**3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (2,)', solve(*(2,)), 0)
check('fixture 3: (3,)', solve(*(3,)), 6)
check('fixture 4: (5,)', solve(*(5,)), 60)
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(n):
    return math.comb(n,3)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (2,)', solve(*(2,)), 0)
check('fixture 3: (3,)', solve(*(3,)), 6)
check('fixture 4: (5,)', solve(*(5,)), 60)
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:
Repeated members are allowed within a triple.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. Ordered distinct triples. Exact operational definition: n*(n-1)*(n-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(digits):
    return sum(d*3**i for i,d in enumerate(digits))
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],)), 8)
check('fixture 2: ([-1, 1],)', solve(*([-1, 1],)), -2)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([1, 1, 1],)', solve(*([1, 1, 1],)), 13)
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(digits):
    return sum(d*2**i for i,d in enumerate(reversed(digits)))
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],)), 8)
check('fixture 2: ([-1, 1],)', solve(*([-1, 1],)), -2)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([1, 1, 1],)', solve(*([1, 1, 1],)), 13)
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:
Most-significant-first balanced ternary is evaluated backwards.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. digits is most-significant-first and each digit is -1, 0, or 1; return its signed integer value. Empty digits have value zero. Exact operational definition: sum(d*3**i for i,d in enumerate(reversed(digits)))

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(digits):
    return sum(d*10**i for i,d in enumerate(digits))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), 5)
check('fixture 2: ([0, 0, 0, 1],)', solve(*([0, 0, 0, 1],)), 6)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([0, 1, 0, 3],)', solve(*([0, 1, 0, 3],)), 19)
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(digits):
    return sum(d*math.factorial(i+1) for i,d in enumerate(digits))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), 5)
check('fixture 2: ([0, 0, 0, 1],)', solve(*([0, 0, 0, 1],)), 6)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([0, 1, 0, 3],)', solve(*([0, 1, 0, 3],)), 19)
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:
Decimal positional weights replace factorial weights.

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. digits is least-significant-first with 0<=digits[i]<=i; return the factorial-place-value integer. Exact operational definition: sum(d*math.factorial(i) for i,d in enumerate(digits))

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[0]-a[0])*(c[1]-a[1])+(b[1]-a[1])*(c[0]-a[0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (2, 0), (0, 3))', solve(*((0, 0), (2, 0), (0, 3))), 6)
check('fixture 2: ((0, 0), (0, 3), (2, 0))', solve(*((0, 0), (0, 3), (2, 0))), -6)
check('fixture 3: ((1, 1), (2, 2), (3, 3))', solve(*((1, 1), (2, 2), (3, 3))), 0)
check('fixture 4: ((2, 1), (4, 3), (1, 5))', solve(*((2, 1), (4, 3), (1, 5))), 10)
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((b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (2, 0), (0, 3))', solve(*((0, 0), (2, 0), (0, 3))), 6)
check('fixture 2: ((0, 0), (0, 3), (2, 0))', solve(*((0, 0), (0, 3), (2, 0))), -6)
check('fixture 3: ((1, 1), (2, 2), (3, 3))', solve(*((1, 1), (2, 2), (3, 3))), 0)
check('fixture 4: ((2, 1), (4, 3), (1, 5))', solve(*((2, 1), (4, 3), (1, 5))), 10)
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 determinant adds its cross terms instead of subtracting.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. a,b,c are planar points; return twice signed triangle area, positive for counterclockwise order. Exact operational definition: (b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[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(base, height):
    return base*height
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3)', solve(*(4, 3)), 6)
check('fixture 2: (0, 5)', solve(*(0, 5)), 0)
check('fixture 3: (2, 2)', solve(*(2, 2)), 2)
check('fixture 4: (7, 4)', solve(*(7, 4)), 14)
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(base, height):
    return (base+height)/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3)', solve(*(4, 3)), 6)
check('fixture 2: (0, 5)', solve(*(0, 5)), 0)
check('fixture 3: (2, 2)', solve(*(2, 2)), 2)
check('fixture 4: (7, 4)', solve(*(7, 4)), 14)
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:
A triangle is assigned the enclosing parallelogram area.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Triangle area base height. Exact operational definition: base*height/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):
    return (min(a[2],b[2])-max(a[0],b[0]))*(min(a[3],b[3])-max(a[1],b[1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 1)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 0)
check('fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1))', solve(*((0, 0, 1, 1), (2, 0, 3, 1))), 0)
check('fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2))', solve(*((0, 0, 2, 2), (2, 0, 4, 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)

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 max(0,(min(a[2],b[2])-max(a[0],b[0]))*(min(a[3],b[3])-max(a[1],b[1])))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 1)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 0)
check('fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1))', solve(*((0, 0, 1, 1), (2, 0, 3, 1))), 0)
check('fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2))', solve(*((0, 0, 2, 2), (2, 0, 4, 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:
Separated axis extents are multiplied as negative lengths.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Rectangle intersection area. Exact operational definition: max(0,min(a[2],b[2])-max(a[0],b[0]))*max(0,min(a[3],b[3])-max(a[1],b[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 (a[2]-a[0])*(a[3]-a[1])+(b[2]-b[0])*(b[3]-b[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 7)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 2)
check('fixture 3: ((0, 0, 2, 2), (0, 0, 2, 2))', solve(*((0, 0, 2, 2), (0, 0, 2, 2))), 4)
check('fixture 4: ((0, 0, 4, 4), (1, 1, 2, 2))', solve(*((0, 0, 4, 4), (1, 1, 2, 2))), 16)
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 (max(a[2],b[2])-min(a[0],b[0]))*(max(a[3],b[3])-min(a[1],b[1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 7)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 2)
check('fixture 3: ((0, 0, 2, 2), (0, 0, 2, 2))', solve(*((0, 0, 2, 2), (0, 0, 2, 2))), 4)
check('fixture 4: ((0, 0, 4, 4), (1, 1, 2, 2))', solve(*((0, 0, 4, 4), (1, 1, 2, 2))), 16)
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:
Overlapping area is counted twice.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Rectangle union area. Exact operational definition: (a[2]-a[0])*(a[3]-a[1])+(b[2]-b[0])*(b[3]-b[1])-max(0,min(a[2],b[2])-max(a[0],b[0]))*max(0,min(a[3],b[3])-max(a[1],b[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(abs(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: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 25)
check('fixture 2: ((1, 2), (1, 2))', solve(*((1, 2), (1, 2))), 0)
check('fixture 3: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 16)
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))**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 25)
check('fixture 2: ((1, 2), (1, 2))', solve(*((1, 2), (1, 2))), 0)
check('fixture 3: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 16)
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:
Manhattan distance replaces squared Euclidean distance.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Squared point distance. Exact operational definition: sum((x-y)**2 for x,y in zip(a,b))

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 abs(sum(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: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 7)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 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(a, b):
    return max(abs(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: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 7)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 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:
Taking one final absolute value permits coordinate cancellation.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Manhattan point distance. Exact operational definition: sum(abs(x-y) for x,y in zip(a,b))

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(abs(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: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 4)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 1)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 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(a, b):
    return max(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: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 4)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 1)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 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:
Summing coordinates uses the Manhattan norm.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Chebyshev point distance. Exact operational definition: max(abs(x-y) for x,y in zip(a,b))

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(radius):
    return 2*radius
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 9)
check('fixture 4: (5,)', solve(*(5,)), 25)
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(radius):
    return radius
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 1)
check('fixture 3: (3,)', solve(*(3,)), 9)
check('fixture 4: (5,)', solve(*(5,)), 25)
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:
Circumference scaling is used for an area.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Circle area divided by pi. Exact operational definition: radius**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(outer, inner):
    return (outer-inner)**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 3)', solve(*(5, 3)), 16)
check('fixture 2: (3, 3)', solve(*(3, 3)), 0)
check('fixture 3: (4, 0)', solve(*(4, 0)), 16)
check('fixture 4: (2, 1)', solve(*(2, 1)), 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(outer, inner):
    return outer**2+inner**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (5, 3)', solve(*(5, 3)), 16)
check('fixture 2: (3, 3)', solve(*(3, 3)), 0)
check('fixture 3: (4, 0)', solve(*(4, 0)), 16)
check('fixture 4: (2, 1)', solve(*(2, 1)), 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:
Squaring the thickness ignores the annulus mean radius.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Annulus area divided by pi. Exact operational definition: outer**2-inner**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):
    return a*a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 6)
check('fixture 2: (2, 2)', solve(*(2, 2)), 4)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (4, 1)', solve(*(4, 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(a, b):
    return (a+b)**2/4
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 6)
check('fixture 2: (2, 2)', solve(*(2, 2)), 4)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (4, 1)', solve(*(4, 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:
Only one semiaxis determines the area.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Ellipse area divided by pi. Exact operational definition: a*b

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, h):
    return (a+b)*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 5, 2)', solve(*(3, 5, 2)), 8)
check('fixture 2: (2, 2, 3)', solve(*(2, 2, 3)), 6)
check('fixture 3: (0, 4, 2)', solve(*(0, 4, 2)), 4)
check('fixture 4: (3, 5, 0)', solve(*(3, 5, 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(a, b, h):
    return a*b*h/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 5, 2)', solve(*(3, 5, 2)), 8)
check('fixture 2: (2, 2, 3)', solve(*(2, 2, 3)), 6)
check('fixture 3: (0, 4, 2)', solve(*(0, 4, 2)), 4)
check('fixture 4: (3, 5, 0)', solve(*(3, 5, 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:
The sum of parallel bases is not averaged.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Trapezoid area. Exact operational definition: (a+b)*h/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(d1, d2):
    return d1*d2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (6, 8)', solve(*(6, 8)), 24)
check('fixture 2: (2, 2)', solve(*(2, 2)), 2)
check('fixture 3: (0, 7)', solve(*(0, 7)), 0)
check('fixture 4: (4, 3)', solve(*(4, 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(d1, d2):
    return (d1+d2)/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (6, 8)', solve(*(6, 8)), 24)
check('fixture 2: (2, 2)', solve(*(2, 2)), 2)
check('fixture 3: (0, 7)', solve(*(0, 7)), 0)
check('fixture 4: (4, 3)', solve(*(4, 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:
Diagonal product is not halved.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Rhombus area from diagonals. Exact operational definition: d1*d2/2

split: open-access