lima.mathematical.utilities
Class Combinatorial

java.lang.Object
  |
  +--lima.mathematical.utilities.Combinatorial

public class Combinatorial
extends java.lang.Object

A class to provide combinatorial integer arithmetic


Constructor Summary
Combinatorial()
           
 
Method Summary
static int combination(int n, int p)
          Calulation the ways of choosing p objects from n objects
static long factorial(int n)
          Calculate the factorial of an integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combinatorial

public Combinatorial()
Method Detail

factorial

public static long factorial(int n)
Calculate the factorial of an integer

Parameters:
n - - the integer who's factorial is returned

combination

public static int combination(int n,
                              int p)
Calulation the ways of choosing p objects from n objects

Parameters:
n - - the size of the set we are choosing object from
p - - the number of elements we wish to choose