code: public static Rational binomial(Rational n, BigInteger m) {
          if (m.compareTo(BigInteger.ZERO) == 0) {
              return Rational.ONE;
          }
          Rational bin = n;
          for (BigInteger i = BigInteger.valueOf(2); i.compareTo(m) != 1; i = i.add(BigInteger.ONE)) {
              bin = bin.multiply(n.subtract(i.subtract(BigInteger.ONE))).divide(i);
          }
          return bin;
      }
docs: binomial (n choose m).
  
  @param n the numerator. Equals the size of the set to choose from.
  @param m the denominator. Equals the number of elements to select.
  @return the binomial coefficient.