I use this code:
import scipy.misc import math from decimal import Decimal def n_choose_k(N, k, N2, k2, s): if k > N: return 0 a1 = Decimal.f