A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two
Open Access
- 1 January 2013
- journal article
- research article
- Published by Wiley in The Scientific World Journal
- Vol. 2013 (1) , 751358
Abstract
I present a new algorithm for computing binomial coefficients modulo 2N. The proposed method has an O(N3 · Multiplication(N) + N4) preprocessing time, after which a binomial coefficient C(P, Q) with 0 ≤ Q ≤ P ≤ 2N − 1 can be computed modulo 2N in O(N2 · log(N) · Multiplication(N)) time. Multiplication(N) denotes the time complexity of multiplying two N‐bit numbers, which can range from O(N2) to O(N · log (N) · log (log (N))) or better. Thus, the overall time complexity for evaluating M binomial coefficients C(P, Q) modulo 2N with 0 ≤ Q ≤ P ≤ 2N − 1 is O((N3 + M · N2 · log (N)) · Multiplication(N) + N4). After preprocessing, we can actually compute binomial coefficients modulo any 2R with R ≤ N. For larger values of P and Q, variations of Lucas’ theorem must be used first in order to reduce the computation to the evaluation of multiple (O(log (P))) binomial coefficients C(P′, Q′) (or restricted types of factorials P′!) modulo 2N with 0 ≤ Q′ ≤ P′ ≤ 2N − 1.Keywords
This publication has 13 references indexed in Scilit:
- On the Connection Coefficients of the Chebyshev‐Boubaker PolynomialsThe Scientific World Journal, 2013
- A new entropy upper boundApplied Mathematics Letters, 2012
- Calculating the numbers of representations and the Garsia entropy in linear numeration systemsMonatshefte für Mathematik, 2012
- Entropy and Information Theory2011
- Finite Precision Number Systems and Arithmetic2010
- Error Correction Coding2005
- On the Residues of Binomial Coefficients and Their Products Modulo Prime PowersActa Mathematica Sinica, English Series, 2002
- Binomial Distribution Handbook for Scientists and Engineers2001
- A Binomial Coefficient Congruence Modulo Prime PowersJournal of Number Theory, 1993
- Schnelle Multiplikation großer ZahlenComputing, 1971