functionbinomial
Binomial coefficient
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
b = Math.binomial(n, k);
Description
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)!
Example
binomial(3, 0); // = 1.0 binomial(4, 2); // = 6.0
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | Binominal power (positive integer) | |
| Integer | k | Positive integer for coefficient |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | b |
Revisions
|
Developed 2014 at the DLR Institute of System Dynamics and Control |