sjm.combinatorics
Class Combinatoric
java.lang.Object
|
+--sjm.combinatorics.Combinatoric
- public class Combinatoric
- extends java.lang.Object
The class Combinatoric contains methods for performing
basic combinatoric operations such as counting numbers of
permutations and combinations.
|
Method Summary |
static java.math.BigInteger |
c(int n,
int m)
|
static java.math.BigInteger |
factorial(int n)
|
static java.math.BigInteger |
p(int n)
|
static java.math.BigInteger |
p(int n,
int m)
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Combinatoric
public Combinatoric()
c
public static java.math.BigInteger c(int n,
int m)
throws CombinatoricException
- Parameters:
n - intm - int- Returns:
- BigInteger, the number of unordered subsets of m
objects chosen from a group of n objects.
- Throws:
- CombinatoricException - unless n >= m >= 0
factorial
public static java.math.BigInteger factorial(int n)
throws CombinatoricException
- Parameters:
n - int- Returns:
- BigInteger, the product of the numbers 1 ... n
- Throws:
- CombinatoricException - unless n >= 0
p
public static java.math.BigInteger p(int n)
throws CombinatoricException
- Parameters:
n - int- Returns:
- BigInteger, the number of possible ways of
ordering n objects
- Throws:
- CombinatoricException - unless n >= 0
p
public static java.math.BigInteger p(int n,
int m)
throws CombinatoricException
- Parameters:
n - intm - int- Returns:
- BigInteger, the number of possible arrangements,
or orderings, of m objects chosen from a group of
n objects.
- Throws:
- CombinatoricException - unless n >= m >= 0