Here you can find the source of binomial(int n, final int k)
public static long binomial(int n, final int k)
//package com.java2s; //License from project: Open Source License public class Main { public static long binomial(int n, final int k) { final int min = (k < n - k ? k : n - k); long bin = 1; for (int i = 1; i <= min; i++) { bin *= n;/* w w w . j a v a 2 s . c om*/ bin /= i; n--; } return bin; } }