public static double binaryShannonEntropy(double p) {
		if (p > 1.0) throw new IllegalArgumentException("The probabiliy, " + p + ",  must be less than or equal to 1");
		if (p < 0.0) throw new IllegalArgumentException("The probabiliy, " + p + ",  must be greater than or equal to 0");
		double entropy = 0.0D;
		if (p > 0.0D && p < 1.0D) {
			entropy = -p * Fmath.log2(p) - (1 - p) * Fmath.log2(1 - p);
		}
		return entropy;
	}