How quickly can we calculate the binomial coefficient, ? This question is important to answer because we will apply the bounds derived later to real problems, and this application will require calculation of Binomial coefficients and Binomial tails.
The answer is: not very fast. It is an open problem to calculate in time not exponential in and (the representation length of and ). In general, this problem is intractable. For example, we note that which has an asymptotic representation length of . Since it takes time to write the answer, we can not hope to compute the answer in less than time. The problem is more difficult than this though - even calculating the most significant bits of the appears to take time.
Our real goal is not merely calculating binomial coefficients but rather calculating the probability of a tail, . How can we calculate the tail probability quickly? For all approaches, it is necessary to calculate rather than to avoid underflow issues. This is generally possible because we can calculate given and without losing precision.
There are several possible approaches of increasing sophistication:
Approaches (1) and (2) both require work while approaches (3) and (4) require merely work. We will use approach (4) here. Yet, as noted in the beginning of this section, is still sometimes too expensive for us. Luckily, there exist some quick approximations which can reduce the computation to constant time (or time depending on your computational model).