Cargando…
A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two
I present a new algorithm for computing binomial coefficients modulo 2(N). The proposed method has an O(N (3) · Multiplication(N) + N (4)) preprocessing time, after which a binomial coefficient C(P, Q) with 0 ≤ Q ≤ P ≤ 2(N) − 1 can be computed modulo 2(N) in O(N (2) · log(N) · Multiplication(N)) tim...
Autor principal: | |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
Hindawi Publishing Corporation
2013
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3856163/ https://www.ncbi.nlm.nih.gov/pubmed/24348186 http://dx.doi.org/10.1155/2013/751358 |
_version_ | 1782295033742884864 |
---|---|
author | Andreica, Mugurel Ionut |
author_facet | Andreica, Mugurel Ionut |
author_sort | Andreica, Mugurel Ionut |
collection | PubMed |
description | I present a new algorithm for computing binomial coefficients modulo 2(N). The proposed method has an O(N (3) · Multiplication(N) + N (4)) preprocessing time, after which a binomial coefficient C(P, Q) with 0 ≤ Q ≤ P ≤ 2(N) − 1 can be computed modulo 2(N) in O(N (2) · log(N) · Multiplication(N)) time. Multiplication(N) denotes the time complexity of multiplying two N-bit numbers, which can range from O(N (2)) to O(N · log(N) · log(log(N))) or better. Thus, the overall time complexity for evaluating M binomial coefficients C(P, Q) modulo 2(N) with 0 ≤ Q ≤ P ≤ 2(N) − 1 is O((N (3) + M · N (2) · log(N)) · Multiplication(N) + N (4)). After preprocessing, we can actually compute binomial coefficients modulo any 2(R) 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 2(N) with 0 ≤ Q′ ≤ P′ ≤ 2(N) − 1. |
format | Online Article Text |
id | pubmed-3856163 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2013 |
publisher | Hindawi Publishing Corporation |
record_format | MEDLINE/PubMed |
spelling | pubmed-38561632013-12-16 A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two Andreica, Mugurel Ionut ScientificWorldJournal Research Article I present a new algorithm for computing binomial coefficients modulo 2(N). The proposed method has an O(N (3) · Multiplication(N) + N (4)) preprocessing time, after which a binomial coefficient C(P, Q) with 0 ≤ Q ≤ P ≤ 2(N) − 1 can be computed modulo 2(N) in O(N (2) · log(N) · Multiplication(N)) time. Multiplication(N) denotes the time complexity of multiplying two N-bit numbers, which can range from O(N (2)) to O(N · log(N) · log(log(N))) or better. Thus, the overall time complexity for evaluating M binomial coefficients C(P, Q) modulo 2(N) with 0 ≤ Q ≤ P ≤ 2(N) − 1 is O((N (3) + M · N (2) · log(N)) · Multiplication(N) + N (4)). After preprocessing, we can actually compute binomial coefficients modulo any 2(R) 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 2(N) with 0 ≤ Q′ ≤ P′ ≤ 2(N) − 1. Hindawi Publishing Corporation 2013-11-06 /pmc/articles/PMC3856163/ /pubmed/24348186 http://dx.doi.org/10.1155/2013/751358 Text en Copyright © 2013 Mugurel Ionut Andreica. https://creativecommons.org/licenses/by/3.0/ This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. |
spellingShingle | Research Article Andreica, Mugurel Ionut A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title | A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title_full | A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title_fullStr | A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title_full_unstemmed | A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title_short | A Fast Algorithm for Computing Binomial Coefficients Modulo Powers of Two |
title_sort | fast algorithm for computing binomial coefficients modulo powers of two |
topic | Research Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3856163/ https://www.ncbi.nlm.nih.gov/pubmed/24348186 http://dx.doi.org/10.1155/2013/751358 |
work_keys_str_mv | AT andreicamugurelionut afastalgorithmforcomputingbinomialcoefficientsmodulopowersoftwo AT andreicamugurelionut fastalgorithmforcomputingbinomialcoefficientsmodulopowersoftwo |