Function bio::stats::combinatorics::combinations_with_repl

source ·
pub fn combinations_with_repl(n: u64, k: u64) -> f64
Expand description

Calculate the number of combinations when choosing k elements from n elements with replacement. Time complexity: O(min(k, n - k))

§Examples

use approx::assert_relative_eq;
use bio::stats::combinatorics::combinations_with_repl;
assert_relative_eq!(combinations_with_repl(5, 3), 35., epsilon = f64::EPSILON);