MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / estimator

Function estimator

eval/utils/evaluation_leetcode.py:94–100  ·  view source on GitHub ↗

Calculates 1 - comb(n - c, k) / comb(n, k).

(n: int, c: int, k: int)

Source from the content-addressed store, hash-verified

92 """
93
94 def estimator(n: int, c: int, k: int) -> float:
95 """
96 Calculates 1 - comb(n - c, k) / comb(n, k).
97 """
98 if n - c < k:
99 return 1.0
100 return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1))
101
102 if isinstance(num_samples, int):
103 num_samples_it = itertools.repeat(num_samples, len(num_correct))

Callers 1

estimate_pass_at_kFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected