sd_helper¶
- cryptographic_estimators.SDEstimator.sd_helper.binom(n: int, k: int)¶
Compute the binomial coefficient.
- Parameters:
n (int) – The total number of items.
k (int) – The number of items to be selected.
- Returns:
- The binomial coefficient, which represents the number of ways to
select k items from a set of n items.
- Return type:
int
- cryptographic_estimators.SDEstimator.sd_helper.min_max(a: int, b: int, s: bool) int ¶
Returns the minimum or maximum of two integers based on a boolean switch.
- Parameters:
a (int) – The first integer.
b (int) – The second integer.
s (bool) – If True, returns the maximum of a and b. If False, returns the minimum of a and b.
- Returns:
The minimum or maximum of a and b, depending on the value of s.
- Return type:
int