edu.jas.arith
Class Combinatoric

java.lang.Object
  extended by edu.jas.arith.Combinatoric

public class Combinatoric
extends java.lang.Object

Combinatoric algorithms. Similar to ALDES/SAC2 SACCOMB module.

Author:
Heinz Kredel

Constructor Summary
Combinatoric()
           
 
Method Summary
static BigInteger binCoeff(int n, int k)
          Integer binomial coefficient. n and k are beta-integers with 0 less than or equal to k less than or equal to n.
static BigInteger binCoeffInduction(BigInteger A, long n, long k)
          Integer binomial coefficient induction. n and k are beta-integers with 0 less than or equal to k less than or equal to n.
static BigInteger binCoeffSum(int n, int k)
          Integer binomial coefficient partial sum. n and k are integers, 0 le k le n.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combinatoric

public Combinatoric()
Method Detail

binCoeffInduction

public static BigInteger binCoeffInduction(BigInteger A,
                                           long n,
                                           long k)
Integer binomial coefficient induction. n and k are beta-integers with 0 less than or equal to k less than or equal to n. A is the binomial coefficient n over k. B is the binomial coefficient n over k+1.

Parameters:
A - previous induction result.
n - long.
k - long.
Returns:
the binomial coefficient n over k+1.

binCoeff

public static BigInteger binCoeff(int n,
                                  int k)
Integer binomial coefficient. n and k are beta-integers with 0 less than or equal to k less than or equal to n. A is the binomial coefficient n over k.

Parameters:
n - long.
k - long.
Returns:
the binomial coefficient n over k+1.

binCoeffSum

public static BigInteger binCoeffSum(int n,
                                     int k)
Integer binomial coefficient partial sum. n and k are integers, 0 le k le n. A is the sum on i, from 0 to k, of the binomial coefficient n over i.

Parameters:
n - long.
k - long.
Returns:
the binomial coefficient partial sum n over i.