FAILURE MAP
← Case archive

FA-12781 / Voting rule computation / Open access

A plurality of pairwise victories is mistaken for beating every opponent · case 01

A plurality of pairwise victories is mistaken for beating every opponent.

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

ROOT CAUSE

The candidate with most head-to-head victories is returned even when a cycle prevents a strict winner.

THE FAILURE

The candidate with most head-to-head victories is returned even when a cycle prevents a strict winner.

Unsuccessful approach: Allowing tied head-to-head contests admits a weak winner where the contract requires a strict winner.

Case contract

Input is a nonempty square matrix of nonnegative head-to-head support counts with zero diagonal. Return the index strictly beating every other index, or None if none exists. A single candidate wins vacuously.

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(matrix):
    return max(range(len(matrix)),key=lambda i:sum(matrix[i][j]>matrix[j][i] for j in range(len(matrix)) if i!=j))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('three candidate cycle has no winner', solve([[0,N+1,0],[0,0,N+1],[N+1,0,0]]), None)
check('head to head tie disqualifies', solve([[0,N,N+1],[N,0,N+1],[0,0,0]]), None)
check('strict winner need not be first', solve([[0,0,N],[N+1,0,N+1],[0,0,0]]), 1)
check('single candidate', solve([[0]]), 0)
check('all contests tied', solve([[0,N,N],[N,0,N],[N,N,0]]), None)
check('two candidate strict contest', solve([[0,N],[N+1,0]]), 1)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
three candidate cycle has no winner0NoneFailed
head to head tie disqualifies0NoneFailed
strict winner need not be first11Passed
single candidate00Passed
all contests tied0NoneFailed
two candidate strict contest11Passed

SHA-256 / 474de7714c1250ac0efda05ba94f1238e2bb768aecd9d622d61f3ffc027bf6da

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(matrix):
    return next((i for i in range(len(matrix)) if all(i==j or matrix[i][j]>=matrix[j][i] for j in range(len(matrix)))),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('three candidate cycle has no winner', solve([[0,N+1,0],[0,0,N+1],[N+1,0,0]]), None)
check('head to head tie disqualifies', solve([[0,N,N+1],[N,0,N+1],[0,0,0]]), None)
check('strict winner need not be first', solve([[0,0,N],[N+1,0,N+1],[0,0,0]]), 1)
check('single candidate', solve([[0]]), 0)
check('all contests tied', solve([[0,N,N],[N,0,N],[N,N,0]]), None)
check('two candidate strict contest', solve([[0,N],[N+1,0]]), 1)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
three candidate cycle has no winnerNoneNonePassed
head to head tie disqualifies0NoneFailed
strict winner need not be first11Passed
single candidate00Passed
all contests tied0NoneFailed
two candidate strict contest11Passed

SHA-256 / 58e40f9b104d678a2978725a8f16f37aa80ac0fe33e9cf294ff57327c23abd3d

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / aebb6e0684eeb191761d99289ba13e507e3871c745a2f5249892e97cfb19e5ee