FAILURE MAP
← Case archive

FA-5611 / Combinatorics / Open access

Nonempty subsets count · case 01

The empty subset is included.

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

ROOT CAUSE

The empty subset is included.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return 2**n-1

Unsuccessful approach: Halving the power set removes many valid nonempty subsets.

Case contract

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

Why this case matters

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

1 / The failure

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

N = 1
observations = []
def solve(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)
Boundary fixtureActualExpectedOutcome
fixture 1: (0,)10Failed
fixture 2: (1,)21Failed
fixture 3: (3,)87Failed
fixture 4: (5,)3231Failed

SHA-256 / fbd16344741593ac625b3e46227ec06ba6fa54e7e315ea51f372d9a6eb2374c9

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(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)
Boundary fixtureActualExpectedOutcome
fixture 1: (0,)00Passed
fixture 2: (1,)11Passed
fixture 3: (3,)47Failed
fixture 4: (5,)1631Failed

SHA-256 / 534445c7a161f567aa29a2f8c1c81f0f6fbe5cdcc3eea028555b3ad09941c6ba

3 / The verified repair

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

N = 1
observations = []
def solve(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,)), 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)
Boundary fixtureActualExpectedOutcome
fixture 1: (0,)00Passed
fixture 2: (1,)11Passed
fixture 3: (3,)77Passed
fixture 4: (5,)3131Passed

SHA-256 / 6dc12bbfce72f3fd1916e66d8625c93d8a48782d11382fa4a4267795f13a4ffa

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:51.584274+00:00.

Case digest / 6b73397c73ad25e2be64bd510956ff8ab7960b6a8b63193e373126042e256df4