Compute Agent pass@k vs. pass^k Reliability

Basics
BasicsEvaluationReliabilityOpenAIAnthropicGoogle

Problem

Given a single-trial task success probability p∈[0,1]p \in [0, 1] and number of independent trials k≥1k \ge 1, implement agent_reliability_metrics(p, k) returning (pass_at_k, pass_power_k) where pass@k=1−(1−p)k\text{pass@}k = 1 - (1 - p)^k (at least one trial succeeds) and passk=pk\text{pass}^k = p^k (all kk trials succeed consistently).

Why It Matters: In enterprise agent evals (like τ\tau-bench), pass@k measures best-case capability while pass^k exposes production reliability—an 80%-accurate agent only passes 5 consecutive runs 0.85=32.8%0.8^5 = 32.8\% of the time!

Function Signature

def agent_reliability_metrics(p: float, k: int) -> tuple[float, float]:
    """Return (pass@k, pass^k) for single-run success rate p over k trials."""

Sample Input & Output

Example 1: 80% Per-Trial Accuracy Over 3 Trials

Input:

p = 0.8, k = 3

Expected Output:

(0.992, 0.512)

Explanation: pass@3 = 1 - 0.2^3 = 0.992 (almost always succeeds once), but pass^3 = 0.8^3 = 0.512 (barely 51% consistent!).

Example 2: Edge Cases (k = 1 and p = 1.0)

Input:

agent_reliability_metrics(0.6, 1)  |  agent_reliability_metrics(1.0, 5)

Expected Output:

(0.6, 0.6)  |  (1.0, 1.0)

Explanation: At k = 1, both metrics equal p; at p = 1.0, both metrics equal 1.0.

Constraints & Edge Cases

  • Return (pass_at_k, pass_power_k) as Python floats.
  • Return a tuple of two Python floats (pass_at_k, pass_power_k).
  • Guaranteed 0.0 <= p <= 1.0 and k >= 1.

Constraints & Evaluation Criteria

  • Return `(pass_at_k, pass_power_k)` as Python floats.

Hints

Python 3
Loading Code Editor...
+1 Hidden Submit Case
Input / Scenario
p=0.8, k=3
Expected Output / Criteria
(0.992, 0.512)