Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

The p-sized partitioning algorithm for fast computation of factorials of numbers

Published: 01 October 2006 Publication History

Abstract

Computing products of large numbers has always been a challenging task in the field of computing. One such example would be the factorial function. Several methods have been implemented to compute this function including naive product, recursive product, Boiten split, and prime factorization, and linear difference. The method presented here is unique in the sense that it exploits finite order differences to reduce the number of multiplications necessary to compute the factorial. The differences generated are regrouped into a new sequence of numbers, which have at most half as many elements of the original sequence. When the terms of this new sequence are multiplied together, the factorial value is obtained. The cardinality of the new sequence can further be reduced by partitioning. The sequence is computed by using several difference tables that assist in establishing the pattern that determines the sequence. An analysis of the algorithm is presented. The analysis shows that the execution time can be reduced significantly by the algorithm presented.

References

[1]
1. Cormen TH, Leiserson CE, Rivest RL, Stein C (2001) Introduction to algorithms, 2nd edition. McGraw-Hill.
[2]
2. Sedgewick R (1992) Algorithms in C++. Addison-Wesley.
[3]
3. National Institute of Standards and Technology. 'Dictionary of Algorithms and Data Structures, http://www.nist.gov/dads/. 2005.
[4]
4. Borwein P (1985) On the complexity of computing factorials. J Algorithms 6:376-380.
[5]
5. Boiten A (1992) Factorisation of the factorial--An example of inverting the flow of computation. Periodica Polytechnica Ser El Eng 35(2):77-99.
[6]
6. Paul R (2000) SPARC architecture, assembly language programming, and c, 2nd edition. Prentice Hall.
[7]
7. Chaudhuri R (2003) Do the arithmetic operations really execute in constant time? The SIGCSE Bulletin 35(2):43-44.
[8]
8. Aho AV, Hopcroft JE, Ullman JD (1974) The design and analysis of computer algorithms. Addison-Wesley.
[9]
9. Thompson H, Ugur A (2004) Fast computation of factorials of numbers. In: Proceedings of The 2004 International Conference on Algorithmic Mathematics and Computer Science (AMCS'04). CSREA Press, Vol.II, pp. 419-422.
[10]
10. Brualdi RA (1999) Introductory combinatorics, 3rd edition. Prentice Hall.

Recommendations

Reviews

Harvey Cohn

The authors present an algorithm for calculating n! in fewer than the (naive) n-1 multiplications. The idea is to partition the sequence {1, ... , n} into approximately n/p sections whose product is given by a polynomial of degree p. The values of each subproduct are given by a difference scheme (as determined by p2 steps). Thus, n! would involve only n/p + p2 steps (optimized when n=2p3), leading to the order of n(2/3) multiplications. Computations verify the economy of the algorithm.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image The Journal of Supercomputing
The Journal of Supercomputing  Volume 38, Issue 1
October 2006
103 pages

Publisher

Kluwer Academic Publishers

United States

Publication History

Published: 01 October 2006

Author Tags

  1. Fast factorial computation
  2. Partitioning

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media