BasicsEvaluationReliabilityOpenAIAnthropicGoogle
Problem
Given a single-trial task success probability p∈[0,1] and number of independent trials k≥1, implement agent_reliability_metrics(p, k) returning (pass_at_k, pass_power_k) where pass@k=1−(1−p)k (at least one trial succeeds) and passk=pk (all k trials succeed consistently).
Why It Matters: In enterprise agent evals (like τ-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% 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.0andk >= 1.
Constraints & Evaluation Criteria
- Return `(pass_at_k, pass_power_k)` as Python floats.
Hints
Learn the Concept First
Python 3⌘/Ctrl+Enter to Run · ⌘/Ctrl+Shift+Enter to Submit
Loading Code Editor...
+1 Hidden Submit Case
Input / Scenario
p=0.8, k=3
Expected Output / Criteria
(0.992, 0.512)