Skip to content

binomial_coefficient

Fabian Kindermann edited this page Apr 1, 2021 · 10 revisions
function binomial_coefficient(n, k)

Description:

Calculates the binomial coefficient

Input arguments:

  • integer :: nTotal number of elements. Note that this input parameter can not be negative.
  • integer :: kSize of the subset of elements to draw without replacement. Note that needs to be an element of .

Return Value:

  • real*8 :: binomial_coefficient The value of the binomial coefficient. Note that we use a real*8 number, as it has the larger range than an integer. If necessary, you can convert the number back into integer using the intrinsic Fortran function int.

References

  • For further reading refer to:
    • Toral, R. & Colet, P. (2014). Stochastic Numerical Methods: An Introduction for Students and Scientists. Weinheim: Wiley.
Clone this wiki locally