FAILURE MAP
← Case archive

FA-6321 / Statistics / Open access

Competition ranks with ties · case 01

Dense ranks fail to leave gaps after tied observations.

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

ROOT CAUSE

Dense ranks fail to leave gaps after tied observations.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return [sorted(values).index(v)+1 for v in values]

Unsuccessful approach: Reversing rank direction changes the ascending convention.

Case contract

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Ascending ranks start at one; ties receive the first occupied rank and leave gaps after the group. Exact operational definition: [sorted(values).index(v)+1 for v in values]

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Statistical estimators 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(values):
    return [sorted(set(values)).index(v)+1 for v in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([30, 10, 10, 20],)', solve(*([30, 10, 10, 20],)), [4, 1, 1, 3])
check('fixture 2: ([1, 2],)', solve(*([1, 2],)), [1, 2])
check('fixture 3: ([5, 5],)', solve(*([5, 5],)), [1, 1])
check('fixture 4: ([],)', solve(*([],)), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: ([30, 10, 10, 20],)[3, 1, 1, 2][4, 1, 1, 3]Failed
fixture 2: ([1, 2],)[1, 2][1, 2]Passed
fixture 3: ([5, 5],)[1, 1][1, 1]Passed
fixture 4: ([],)[][]Passed

SHA-256 / a62e1b122ac59a55adc4bc78a145b52063869b654c33c280292c65c975f988b3

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(values):
    return [len(values)-sorted(values).index(v) for v in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([30, 10, 10, 20],)', solve(*([30, 10, 10, 20],)), [4, 1, 1, 3])
check('fixture 2: ([1, 2],)', solve(*([1, 2],)), [1, 2])
check('fixture 3: ([5, 5],)', solve(*([5, 5],)), [1, 1])
check('fixture 4: ([],)', solve(*([],)), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: ([30, 10, 10, 20],)[1, 4, 4, 2][4, 1, 1, 3]Failed
fixture 2: ([1, 2],)[2, 1][1, 2]Failed
fixture 3: ([5, 5],)[2, 2][1, 1]Failed
fixture 4: ([],)[][]Passed

SHA-256 / 43af8af5d125fca6d43e6a6266dcff46152797d87fbaba20d61ca22329da5c92

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(values):
    return [sorted(values).index(v)+1 for v in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([30, 10, 10, 20],)', solve(*([30, 10, 10, 20],)), [4, 1, 1, 3])
check('fixture 2: ([1, 2],)', solve(*([1, 2],)), [1, 2])
check('fixture 3: ([5, 5],)', solve(*([5, 5],)), [1, 1])
check('fixture 4: ([],)', solve(*([],)), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
fixture 1: ([30, 10, 10, 20],)[4, 1, 1, 3][4, 1, 1, 3]Passed
fixture 2: ([1, 2],)[1, 2][1, 2]Passed
fixture 3: ([5, 5],)[1, 1][1, 1]Passed
fixture 4: ([],)[][]Passed

SHA-256 / 0f436b3b02163a54546b27aa7f5e88941ac97561b7aa162f90a5895bd6dea0e3

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:38:00.427367+00:00.

Case digest / 75fc3e7413b966b11e88ed80ec71273d29d618ada00f2e1f7b2cad8996f685b7