FAILURE MAP
← Case archive

FA-12636 / Survey sampling estimators / Open access

Deduplicating repeated PPS draws changes the estimator · case 01

Deduplicating repeated PPS draws changes the estimator.

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

ROOT CAUSE

Repeated with-replacement draws are collapsed before Hansen-Hurwitz estimation.

THE FAILURE

Repeated with-replacement draws are collapsed before Hansen-Hurwitz estimation.

Unsuccessful approach: Keeping occurrences but dividing by number of unique units still inflates the result.

Case contract

draws are (unit identifier,value,positive draw probability); repeated unit entries have identical value and probability. Return Hansen-Hurwitz population total rounded to eight decimals, or None for no draws.

Why this case matters

A deterministic survey-design model isolates this sampling contract before it is embedded in a larger estimation pipeline.

1 / The failure

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

N = 1
observations = []
def solve(draws):
    unique={u:(y,p) for u,y,p in draws}
    return round(sum(y/p for y,p in unique.values())/len(unique),8) if unique else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal repeat multiplicity',solve([('a',N,0.5),('a',N,0.5),('b',4*N,0.5)]),4*N)
check('same unit twice',solve([('a',N,0.25),('a',N,0.25)]),4*N)
check('single draw',solve([('a',N,0.25)]),4*N)
check('different unique draws',solve([('a',N,0.5),('b',3*N,0.5)]),4*N)
check('zero valued draw counts',solve([('a',0,0.5),('a',0,0.5),('b',3*N,0.5)]),2*N)
check('no draws',solve([]),None)
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
unequal repeat multiplicity5.04Failed
same unit twice4.04Passed
single draw4.04Passed
different unique draws4.04Passed
zero valued draw counts3.02Failed
no drawsNoneNonePassed

SHA-256 / 847223d69f92732110ef448f406bdb7a8d1e07d3e08bb5215716b891a9d7b548

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(draws):
    return round(sum(y/p for u,y,p in draws)/len({u for u,y,p in draws}),8) if draws else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal repeat multiplicity',solve([('a',N,0.5),('a',N,0.5),('b',4*N,0.5)]),4*N)
check('same unit twice',solve([('a',N,0.25),('a',N,0.25)]),4*N)
check('single draw',solve([('a',N,0.25)]),4*N)
check('different unique draws',solve([('a',N,0.5),('b',3*N,0.5)]),4*N)
check('zero valued draw counts',solve([('a',0,0.5),('a',0,0.5),('b',3*N,0.5)]),2*N)
check('no draws',solve([]),None)
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
unequal repeat multiplicity6.04Failed
same unit twice8.04Failed
single draw4.04Passed
different unique draws4.04Passed
zero valued draw counts3.02Failed
no drawsNoneNonePassed

SHA-256 / 6e4067782c70a048199eecf8cb1e202c64dd06810377bbf498432ca160a1ec20

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

Controlled finite fixtures; not a general survey-analysis package. 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:58.792999+00:00.

Case digest / 26b33d996b4b2a777a17e357476201a618386b4a4892b3e898fa3e545d91e2fe