Some math functions in Rust
Probability functions
proba_bool
: Tests a probability by returning a boolproba_some
: Tests a probability by returning an Optionproba_result
: Tests a probability by returning a Resultproba_attempts
: The function tests a chosen probability, several attempts (with prints) will be made until the probability is realized.
Generates prime numbers
is_prime
: Determines if a number is prime
Generates and checks Fibonacci numbers
fibo-gen
: Generates the first k Fibonacci numbers in a vector.is_fibo
: Checks if a number is a Fibonacci number
Number of possible combinations in a given set
binomial_combi
: Returns the binomial coefficient, which represents the number of ways to choose k elements from n elements, without repetition.multiset_combi
: Returns the number of multi-set combinations of k elements among n elements, which represents the number of ways to choose k elements among n elements with possible repetition.