public class BigIntegerUtils
extends java.lang.Object
BigInteger.| Modifier and Type | Method and Description |
|---|---|
static java.math.BigInteger |
combination(int n,
int k)
Compute the combination function or the binomial coefficient.
|
static java.math.BigInteger |
factorial(int n)
Compute the n factorial.
|
static java.math.BigInteger |
permutation(int n,
int k)
Compute the permutation function.
|
public static java.math.BigInteger factorial(int n)
n - an integern!public static java.math.BigInteger combination(int n,
int k)
n - the size of the full setk - the size of a combinationn! / (n-k)! / k!public static java.math.BigInteger permutation(int n,
int k)
n - the size of the full setk - the size of a permutationn! / (n-k)!