Calculates 1 - comb(n - c, k) / comb(n, k).
(n: int, c: int, k: int)
| 66 | """ |
| 67 | |
| 68 | def estimator(n: int, c: int, k: int) -> float: |
| 69 | """ |
| 70 | Calculates 1 - comb(n - c, k) / comb(n, k). |
| 71 | """ |
| 72 | if n - c < k: |
| 73 | return 1.0 |
| 74 | return 1.0 - np.prod(1.0 - k / np.arange(n - c + 1, n + 1)) |
| 75 | |
| 76 | if isinstance(num_samples, int): |
| 77 | num_samples_it = itertools.repeat(num_samples, len(num_correct)) |
no outgoing calls
no test coverage detected