FAILURE MAP
← Case archive

FA-12761 / Voting rule computation / Open access

An exact quotient omits the final quota increment · case 01

An exact quotient omits the final quota increment.

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

ROOT CAUSE

Ceiling division is substituted for floor plus one.

VERIFIED REPAIR

Always floor valid ballot count divided by seats plus one, then add one.

Unsuccessful approach: Dividing by seats instead changes the allocation rule.

Case contract

For nonnegative integer valid count and positive seats return floor(valid/(seats+1))+1, including when the quotient is integral.

Why this case matters

A deterministic toy ballot model makes the stated counting convention executable.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(valid, seats):
    return (valid+seats)//(seats+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('exact division', solve(6*N,2), 2*N+1)
check('fractional division', solve(6*N+1,2), 2*N+1)
check('zero ballots', solve(0,N), 1)
check('one seat', solve(2*N,1), N+1)
check('more seats than ballots', solve(1,N+2), 1)
check('several seats', solve(20,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)
Boundary fixtureActualExpectedOutcome
exact division23Failed
fractional division33Passed
zero ballots01Failed
one seat12Failed
more seats than ballots11Passed
several seats56Failed

SHA-256 / 1e52accbef0981595cfec304a8e72bec67ce6d431715de9dedc78e9816a5330d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(valid, seats):
    return valid//seats+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('exact division', solve(6*N,2), 2*N+1)
check('fractional division', solve(6*N+1,2), 2*N+1)
check('zero ballots', solve(0,N), 1)
check('one seat', solve(2*N,1), N+1)
check('more seats than ballots', solve(1,N+2), 1)
check('several seats', solve(20,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)
Boundary fixtureActualExpectedOutcome
exact division43Failed
fractional division43Failed
zero ballots11Passed
one seat32Failed
more seats than ballots11Passed
several seats76Failed

SHA-256 / a7dd2dfb4cc1ef36cdc79a010b621160aff904eefe6fea5286ee54aac93c907e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(valid, seats):
    return valid//(seats+1)+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('exact division', solve(6*N,2), 2*N+1)
check('fractional division', solve(6*N+1,2), 2*N+1)
check('zero ballots', solve(0,N), 1)
check('one seat', solve(2*N,1), N+1)
check('more seats than ballots', solve(1,N+2), 1)
check('several seats', solve(20,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)
Boundary fixtureActualExpectedOutcome
exact division33Passed
fractional division33Passed
zero ballots11Passed
one seat22Passed
more seats than ballots11Passed
several seats66Passed

SHA-256 / fab86365ddbe9535a718f9f2b5c5738dd8d5830c253980ca8dc0f72cea66a86c

Verification & scope

Abstract counting rules only; excludes jurisdictional law, ballot authentication and election operations. 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:38:59.926043+00:00.

Case digest / 30816489f41fd6a528c68bf47fcc6be512213fc5c7b111e8894f1e2c70163dd8