public class LogBinomialCoefficient
extends java.lang.Object
n choose k", the number of k-element subsets that
can be selected from an n-element set.| Constructor | Description |
|---|---|
LogBinomialCoefficient() |
| Modifier and Type | Method | Description |
|---|---|---|
static double |
value(int n,
int k) |
Computes the logarithm of the binomial coefficient.
|
public static double value(int n,
int k)
n for which all coefficients can
fit into a long is 66.n - Size of the set.k - Size of the subsets to be counted.log(n choose k).java.lang.IllegalArgumentException - if n < 0.java.lang.IllegalArgumentException - if k > n.java.lang.IllegalArgumentException - if the result is too large to be
represented by a long.Copyright © 2017 The Apache Software Foundation. All rights reserved.