code: private double getExpectedProbability(int successes)
      {
          double prob = Math.pow(p, successes) * Math.pow(1 - p, n - successes);
          BigDecimal coefficient = new BigDecimal(binomialCoefficient(n, successes));
          return coefficient.multiply(new BigDecimal(prob)).doubleValue();
      }
docs: This is the probability mass function
  (http://en.wikipedia.org/wiki/Probability_mass_function) of
  the Binomial distribution represented by this number generator.
  @param successes The number of successful trials to determine
  the probability for.
  @return The probability of obtaining the specified number of
  successful trials given the current values of n and p.