Calculates 1 - comb(n - c, k) / comb(n, k).
(n: int, c: int, k: int)
| 199 | """Estimates pass@k of each problem and returns them in an array.""" |
| 200 | |
| 201 | def estimator(n: int, c: int, k: int) -> float: |
| 202 | """Calculates 1 - comb(n - c, k) / comb(n, k).""" |
| 203 | if n - c < k: |
| 204 | return 1.0 |
| 205 | return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1)) |
| 206 | |
| 207 | if isinstance(num_samples, int): |
| 208 | num_samples_it = itertools.repeat(num_samples, len(num_correct)) |
no outgoing calls
no test coverage detected
searching dependent graphs…