Two ways of making graph, fixed bug with thresholds
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
import java.math.BigInteger;
|
||||
|
||||
public abstract class Equations {
|
||||
|
||||
public static double pValue(Integer w, Integer w_a, Integer w_b, Integer w_ab) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
private static double probPairedByChanc(Integer w, Integer w_a, Integer w_b, Integer w_ab){
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This works because nC(k+1) = nCk * (n-k)/(k+1)
|
||||
* Since nC0 = 1, can start there and generate all the rest.
|
||||
*/
|
||||
public static BigInteger choose(final int N, final int K) {
|
||||
BigInteger nCk = BigInteger.ONE;
|
||||
for (int k = 0; k < K; k++) {
|
||||
nCk = nCk.multiply(BigInteger.valueOf(N-k))
|
||||
.divide(BigInteger.valueOf(k+1));
|
||||
}
|
||||
return nCk;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user