Class FallingFactorial
- java.lang.Object
-
- de.tilman_neumann.jml.combinatorics.FallingFactorial
-
public class FallingFactorial extends Object
Implementations of the falling factorial (n)_k = (n-k+1)*...*n. In combinatorics this can be interpreted as the number of variations of (n-k) and k indistinguishable objects of two different kinds. Note that the coefficients of the expanded polynomial are (signed) Stirling numbers of the first kind. E.g. (n)_5 = (n-4)*(n-3)*(n-2)*(n-1)*n = 24n - 50n^2 + 35n^3 - 10n^4 + n^5 = s(5,1)n + s(5,2)n^2 + s(5,3)n^3 + s(5,4)n^4 + s(5,5)n^5- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description FallingFactorial()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigInteger
fallingFactorial(int n, int k)
Computes the falling factorial.static void
main(String[] args)
Test
-
-
-
Method Detail
-
fallingFactorial
public static BigInteger fallingFactorial(int n, int k) throws IllegalArgumentException
Computes the falling factorial.- Parameters:
n
-k
-- Returns:
- falling factorial (n)_k
- Throws:
IllegalArgumentException
- if k<0
-
main
public static void main(String[] args)
Test- Parameters:
args
- ignored
-
-