.AdvancedNoise.Math.binomial

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

Interface

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;

Revisions

DLR logo Developed 2014 at the DLR Institute of System Dynamics and Control

Generated at 2024-12-25T19:25:50Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos