Package org.ojalgo.function.special
Class CombinatorialFunctions
java.lang.Object
org.ojalgo.function.special.CombinatorialFunctions
https://reference.wolfram.com/language/tutorial/CombinatorialFunctions.html
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
partitions
(int n, int[] k) static long
permutations
(int n) static long
subsets
(int n, int k) static long
variations
(int n, int k)
-
Constructor Details
-
CombinatorialFunctions
public CombinatorialFunctions()
-
-
Method Details
-
partitions
public static long partitions(int n, int[] k) - Parameters:
n
- The number of elements in the setk
- A vector of subset sizes the sum of which must equal the size of the full set- Returns:
- The number of ways the set can be partitioned in to subsets of the given sizes
-
permutations
public static long permutations(int n) - Parameters:
n
- The number of elements in the set- Returns:
- The number of permutations of the set
-
subsets
public static long subsets(int n, int k) - Parameters:
n
- The number of elements in the setk
- The number of elements in the subset- Returns:
- The number of subsets to the set
-
variations
public static long variations(int n, int k) - Parameters:
n
- The number of elements in the setk
- The size of the tuple- Returns:
- The number of ordered k-tuples (variations) of the set
-