Combinatorics
The Combinatorics
object provides several common combinatorics functions, such as factorial permutations, combinations, gamma and beta functions.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Combinatorics.type
Members list
Value members
Concrete methods
Compute the beta function 'B(a, b)' for the following two cases: (1) when 'a' or 'b' are integers and (2) when 'a' or 'b' are integers + 1/2.
Compute the beta function 'B(a, b)' for the following two cases: (1) when 'a' or 'b' are integers and (2) when 'a' or 'b' are integers + 1/2.
Value parameters
- a
-
the first parameter, a real number satisfying (1) or (2)
- b
-
the second parameter, a real number satisfying (1) or (2)
Attributes
- See also
Compute binomial coefficients: 'n' choose 'k', combinations of 'n' things, 'k' at a time, using Pascal's Triangle.
Compute binomial coefficients: 'n' choose 'k', combinations of 'n' things, 'k' at a time, using Pascal's Triangle.
Value parameters
- k
-
the of items to choose (requires k <= n)
- n
-
the total number of items
Attributes
- See also
Compute trinomial coefficients: 'n' choose '(k, l'), combinations of 'n' things, '(k, l)' at a time, using Pascal's Tetrahedron. Ex: Given 'n' balls, counts ways in which 'k' are chosen for group 1 and 'l' are chosen for group 2.
Compute trinomial coefficients: 'n' choose '(k, l'), combinations of 'n' things, '(k, l)' at a time, using Pascal's Tetrahedron. Ex: Given 'n' balls, counts ways in which 'k' are chosen for group 1 and 'l' are chosen for group 2.
Value parameters
- k
-
the of items to choose
- l
-
the of items to choose (requires 0 <= k + l <= n)
- n
-
the total number of items
Attributes
- See also
Compute 'n' choose 'k' (combinations of 'n' things, 'k' at a time). A more efficient implementation is given below.
Compute 'n' choose 'k' (combinations of 'n' things, 'k' at a time). A more efficient implementation is given below.
Value parameters
- k
-
the of items to choose (requires k <= n)
- n
-
the total number of items
Attributes
Compute 'k' factorial 'k!' using three techniques (requires 'k <= 170').
Compute 'k' factorial 'k!' using three techniques (requires 'k <= 170').
Value parameters
- k
-
the nonnegative integer-valued argument to the factorial function
Attributes
Compute the gamma function 'gamma (a)' using the Lanczos Approximation.
Compute the gamma function 'gamma (a)' using the Lanczos Approximation.
Value parameters
- a
-
the parameter, a real number
Attributes
- See also
Compute the Gauss Hypergeometric function '2F1(a, b, c; z)' using a power series expansion.
Compute the Gauss Hypergeometric function '2F1(a, b, c; z)' using a power series expansion.
Value parameters
- a
-
the first parameter, a real/complex number
- b
-
the second parameter, a real/complex number
- c
-
the third parameter, a real/complex number, may not be a negative integer
- z
-
the variable, a real/complex number s.t. |z| < 1
Attributes
- See also
-
en.wikipedia.org/wiki/Hypergeometric_function For faster or more robust algorithms,
people.maths.ox.ac.uk/porterm/research/pearson_final.pdf
Compute the incomplete beta function 'B(z; a, b)', a generalization of the beta function 'z = 1'.
Compute the incomplete beta function 'B(z; a, b)', a generalization of the beta function 'z = 1'.
Value parameters
- a
-
the first parameter, a real/complex number > 0
- b
-
the second parameter, a real/complex number > 0
- z
-
the variable, a real/complex number s.t. 0 <= |z| <= 1
Attributes
- See also
Compute the natural log factorial 'ln (k!)' so 'k! = exp (logfac (k))'. The formula is a log transformation of Ramanujan's Factorial Approximation.
Compute the natural log factorial 'ln (k!)' so 'k! = exp (logfac (k))'. The formula is a log transformation of Ramanujan's Factorial Approximation.
Value parameters
- k
-
the value to take the log factorial of
Attributes
For small 'k', compute 'k' factorial by iterative multiplication.
k! = k * (k-1) * ... * 2 * 1
For small 'k', compute 'k' factorial by iterative multiplication.
k! = k * (k-1) * ... * 2 * 1
Value parameters
- k
-
the nonnegative integer-valued argument to the factorial function
Attributes
Compute 'k!' using Mortici's Factorial Approximation (more accurate than Stirling's 2nd Order Factorial Approximation).
Compute 'k!' using Mortici's Factorial Approximation (more accurate than Stirling's 2nd Order Factorial Approximation).
Value parameters
- k
-
the nonnegative integer-valued argument to the factorial function
Attributes
- See also
Compute permutations of 'k' items selected from 'n' total items.
Compute permutations of 'k' items selected from 'n' total items.
Value parameters
- k
-
the of items selected
- n
-
the total number of items
Attributes
Compute the complement of the regularized (incomplete) beta function '1.0 - I(z; a, b) = I(1.0 - z; b, a)'.
Compute the complement of the regularized (incomplete) beta function '1.0 - I(z; a, b) = I(1.0 - z; b, a)'.
Value parameters
- a
-
the first parameter, a real/complex number > 0
- b
-
the second parameter, a real/complex number > 0
- z
-
the variable, a real/complex number s.t. 0 <= |z| <= 1
Attributes
Compute the regularized (incomplete) beta function 'I(z; a, b)'.
Compute the regularized (incomplete) beta function 'I(z; a, b)'.
Value parameters
- a
-
the first parameter, a real/complex number > 0
- b
-
the second parameter, a real/complex number > 0
- z
-
the variable, a real/complex number s.t. 0 <= |z| <= 1
Attributes
- See also
Compute 'k!' using Ramanujan's Factorial Approximation (more accurate than Mortici's Factorial Approximation).
Compute 'k!' using Ramanujan's Factorial Approximation (more accurate than Mortici's Factorial Approximation).
Value parameters
- k
-
the nonnegative integer-valued argument to the factorial function
Attributes
- See also
Compute the 'k'th degree rising factorial of 'x'. When 'x = 1', this is the regular factorial function 'k!'. Also known as Pochhammer's symbol. Caveat: only works when 'k' is a nonnegative integer
Compute the 'k'th degree rising factorial of 'x'. When 'x = 1', this is the regular factorial function 'k!'. Also known as Pochhammer's symbol. Caveat: only works when 'k' is a nonnegative integer
Value parameters
- k
-
the number of factors in the product
- x
-
the base number to start the product
Attributes
Compute 'k!' using Stirling's 2-nd Order Factorial Approximation.
Compute 'k!' using Stirling's 2-nd Order Factorial Approximation.
Value parameters
- k
-
the nonnegative integer-valued argument to the factorial function
Attributes
- See also
Concrete fields
Table of all factorial numbers that can be represented as a long (64-bit) integer
Table of all factorial numbers that can be represented as a long (64-bit) integer
Attributes
Initial part of Pascal's Tetrahedron, precomputed to speed calculations (Trinomial Coefficients)
Initial part of Pascal's Tetrahedron, precomputed to speed calculations (Trinomial Coefficients)
Attributes
- See also
Initial part of Pascal's Triangle, precomputed to speed calculations (Binomial Coefficients)
Initial part of Pascal's Triangle, precomputed to speed calculations (Binomial Coefficients)