Skip to contents

1 - C(n-c, k)/C(n, k), computed as an overflow-free running product.

Usage

morie_kamath_ch8_pass_at_k(n, c, k)

morie_kamath_pass_at_k(n, c, k)

Arguments

n

Samples drawn.

c

Correct samples.

k

Budget.

Value

List with estimate, fail_probability.

Details

The Python shelf carries two modules with this arithmetic: km128 -> morie_kamath_ch8_pass_at_k (reports fail_probability), kmpask -> morie_kamath_pass_at_k (reports empirical_rate). Both are exported so their payloads stay distinguishable.

Examples

morie_kamath_ch8_pass_at_k(10, 3, 2)
#> $estimate
#> [1] 0.5333333
#> 
#> $fail_probability
#> [1] 0.4666667
#> 
#> $n_samples
#> [1] 10
#> 
#> $n_correct
#> [1] 3
#> 
#> $k
#> [1] 2
#> 
#> $n
#> [1] 10
#> 
#> $method
#> [1] "unbiased pass@k (Kamath Eq 8.16)"
#>