Two ways of making graph, fixed bug with thresholds

This commit is contained in:
2021-11-10 09:15:03 -06:00
parent 8280382ca7
commit 93cac1d38a
2 changed files with 100 additions and 75 deletions

View File

@@ -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;
}
}