code: private static double entropy(double count, double sum) {
          double p = count / sum;
          return Math.log(p) * p;
      }
docs: Computes the entropy of a raw count given a particular summation using
  the natural log.