Skip to content

binomial_coefficient

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

Description:

Calculates the binomial coefficient

Input arguments:

  • integer :: n
    Total number of elements. Note that this input parameter can not be negative.
  • integer :: k
    Size 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