Prompt Details
Model
(claude-5-5-sonnet)
Token size
1,234
Example input
[DATA_AND_COLLECTION]: Synthetic business example. A fixed, prespecified simple random sample of 200 completed shipments from the full eligible standard-service route over four weeks found 10 delivered strictly more than 48 hours after dispatch and 190 at or below 48 hours. Times, eligibility and delivery completion were verified; no missing outcomes or duplicates. Each shipment is from a different customer, handled independently; the supplied operating model is a common delay probability for this unchanged route and service period. No promotions, carrier or route changes. The target is this same stable route and service, not other routes. Source ID: shipment_audit_A.
[DECISION_AND_TOOL]: Decide whether this route meets the prespecified eligibility rule for a limited refund offer: the upper endpoint of a 95% two-sided Wilson interval for its long-run >48-hour rate must be <=10%. Refund cost is $20 per late shipment; reserve budget is $2 per eligible shipment. Show conditional costs per 1,000 shipments, not a guarantee for the next batch. Python 3 standard library. Recommend only for the stated route and unchanged process; no actual launch or external action.
Example output
# Weak Data Decision Audit: shipment_audit_A
Your decision field was cut off after "the upper endpoint of a 95% …". I kept the valid part: an upper-endpoint rule on a 95% interval for the delay rate. The threshold T, the sidedness and the interval method are not supplied. I used the defaults: Wilson, two-sided, 95%, with T left symbolic. The refund cost, the refund budget and the future volume are also unsupplied, so no cost scenarios are run. The tool defaulted to Python 3 standard library.
## 1. Decision brief
**CONDITIONAL.**
- **Action:** grant the limited refund offer only if the upper endpoint is at or below T.
- **Scope:** this same stable standard-service route and service period. Other routes are not covered.
- **Acceptance rule (as supplied, truncated):** Wilson 95% two-sided upper endpoint ≤ T.
- **Result:** the upper endpoint is **0.0896**, so the rule is met for any T ≥ 0.0896 and not met for any T < 0.0896.
- **Why conditional:** the inference gates hold, but T is missing, so I cannot say whether the rule passes.
- **Assumptions (ASSUMED):** the cut-off rule is a Wilson two-sided 95% upper endpoint, and delay is ">48 h" strictly.
## 2. Evidence ledger
| Finding | Source/count | Status | Decision impact |
|---|---|---|---|
| Eligible sample n = 200, fixed simple random sample | shipment_audit_A | SUPPLIED | Denominator for the rate |
| Delayed (>48 h) x = 10; on time (≤48 h) = 190 | shipment_audit_A | SUPPLIED | Event is strictly greater than 48 h |
| Outcomes complete, no duplicates or missing values | shipment_audit_A | SUPPLIED | No unresolved outcomes, so the identification range collapses to the observed rate |
| Independent shipments, common delay probability, unchanged route | shipment_audit_A | SUPPLIED | Binomial inference gates hold |
| Target is the same route and service | shipment_audit_A | SUPPLIED | No extrapolation to other routes |
| Observed rate p̂ = 10/200 = 0.0500 | x/n | CALCULATED | Point estimate only |
| Threshold T, interval sidedness (as supplied) | decision text truncated | UNKNOWN | Blocks the pass/fail verdict |
| Costs, budget, future volume | none | UNKNOWN | No cost scenarios |
No contradictions found.
Ranked blockers: (1) T is missing; (2) the decision text is truncated; (3) sample size is modest, so the interval is wide (about 2.7% to 9.0%). Selection, missingness, dependence and time change are not concerns under the supplied design.
## 3. Sensitivity
| Scenario | Result/type | Threshold comparison | Scope | Reversal condition |
|---|---|---|---|---|
| Raw baseline (x=10, n=200) | Wilson 95% two-sided: 0.0274 to 0.0896, approximate coverage | Passes if T ≥ 0.0896; fails if T < 0.0896 | This route and period | A different T, or a different x or n |
| Verified correction | None (data verified) | n/a | n/a | n/a |
| Unresolved-outcome extremes | None (u = 0), so the range is 0.050 to 0.050 | n/a | Observed sample only | n/a |
Illustrative comparisons from the script:
| T | Upper ≤ T? |
|---|---|
| 0.05 | No |
| 0.08 | No |
| 0.09 | Yes |
| 0.10 | Yes |
| 0.12 | Yes |
Note that T = 0.05 fails even though p̂ = 0.05, because the rule applies to the upper endpoint, not the point estimate.
**Method choice:** Wilson, because x > 0 and the supplied model justifies a common independent rate. The exact one-sided zero-event bound is not used because x ≠ 0. I rejected the Cantelli bound (it needs a known population mean and variance, and none are supplied) and any normal approximation of the rate. The interval describes the rate procedure at 95% approximate coverage. It is not a probability statement about the fixed rate and not a guarantee for one future batch.
## 4. Reproduce
Dependencies: Python 3 standard library only. Run with `python3 audit.py`. The script is below, and it was **EXECUTED** locally; self-checks passed. The data (x=10, n=200) are actual supplied values, and the only synthetic items are the T test values.
```python
import math
def wilson(x, n, z=1.96):
if not isinstance(x, int) or not isinstance(n, int): raise ValueError("counts must be integers")
if n <= 0 or x < 0 or x > n: raise ValueError("invalid counts")
p = x / n
d = 1 + z*z/n
c = (p + z*z/(2*n)) / d
h = z*math.sqrt(p*(1-p)/n + z*z/(4*n*n)) / d
return c-h, c+h
def exact_upper_zero(n, alpha=0.05):
if n <= 0: raise ValueError("n must be positive")
return 1 - alpha**(1/n)
def audit(x, n, T=None):
lo, hi = wilson(x, n)
out = {"x": x, "n": n, "p_hat": x/n, "wilson_lo": lo, "wilson_hi": hi}
if x == 0: out["exact_upper_x0"] = exact_upper_zero(n)
if T is not None: out["upper_le_T"] = hi <= T
return out
def self_checks():
for bad in [(0,0),(-1,10),(11,10),(1.5,10)]:
try: wilson(*bad); raise SystemExit("FAIL: accepted %r" % (bad,))
except ValueError: pass
assert abs(exact_upper_zero(100) - 0.02951) < 1e-4
lo, hi = wilson(0, 50); assert lo >= 0 and hi > 0
print("self-checks PASS")
if __name__ == "__main__":
self_checks()
r = audit(10, 200)
for k, v in r.items(): print(k, round(v, 5) if isinstance(v, float) else v)
```
Output: self-checks PASS; p̂ 0.05; Wilson lower 0.02738; Wilson upper 0.08958.
## 5. Claim release
| Permitted | Prohibited |
|---|---|
| "In a fixed random sample of 200 completed shipments on this route, 10 (5.0%) were delivered more than 48 h after dispatch; the Wilson 95% two-sided interval is about 2.7% to 9.0%." | "The delay rate is at most 9%" as a certainty |
| "The upper endpoint is 0.0896; the eligibility rule passes only if T ≥ 0.0896." | "The route qualifies for refunds" (T unknown) |
| "This applies to this route and service period under the supplied independence model." | Any statement about other routes, or the rate for next week's batch |
**Stakeholder paragraph:** In the audited sample of 200 completed standard-service shipments, 10 arrived later than 48 hours (5.0%). A 95% Wilson interval for this route's delay rate runs from about 2.7% to 9.0%. Whether the route qualifies for the limited refund offer depends on the prespecified threshold, which was not supplied; the route qualifies only if that threshold is at least 9.0%. This does not cover other routes and does not predict any single future batch.
## 6. Next evidence
- **Highest value:** supply the exact decision rule: T, interval method, sidedness, and the refund cost and budget if you want cost scenarios (budget B per eligible unit and event cost C give break-even p* = B/C).
- **Collection:** no change needed for this route. Keep the same fields (shipment ID, dispatch time, delivery time, eligibility flag, completion flag).
- **Fixed review:** re-audit only with a new fixed-size sample under the same design; do not peek at the interval during collection.
**Checks:** arithmetic PASS (hand calculation matches script); execution PASS (self-checks and run completed); decision consistency with evidence PASS (verdict is CONDITIONAL, not asserted, because T is UNKNOWN).
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Decide what imperfect operational data can support before committing to a refund policy, service promise or quality claim. Receive a decision brief, scenario comparisons, analysis code, stakeholder-ready wording and a focused next-evidence plan. For counts, rates and thresholds, with two inputs and a built-in worked demo. Assumptions and unresolved evidence stay explicit.
...more
Added 15 minutes ago
