b = Math.binomial(n, k);
This function returns positive integer being a coefficient in the binominal theorem, i.e. it is the coefficient of the xk term of the binomial power (1 + x)n, see also Wikipedia. The coefficient is given by
n! b = ----------- k! (n - k)!
binomial(3, 0); // = 1.0 binomial(4, 2); // = 6.0
function binomial extends Modelica.Icons.Function; input Integer n(min = 0) "Binominal power (positive integer)"; input Integer k(min = 0) "Positive integer for coefficient"; output Real b; end binomial;
Developed 2014 at the DLR Institute of System Dynamics and Control |