Skip to main content

Fast computation of multinomial coefficients

Abstract

In a previous publication, we have used the discrete Fourier transform to compute the binomial coefficients. In the present paper, we extend the previously proposed method to compute the multinomial coefficients, analyse its precision and performance. The other methods, analysed in our previous publication, are also extended to the multinomial case. The FFT method presents the best performance to compute all multinomial coefficients at a given level.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Notes

  1. 1.

    The On-Line Encyclopedia of Integer Sequences (OEIS), created by Neil Sloane, is an online database of integer sequences. It is found at https://oeis.org/.

  2. 2.

    The type of a sequence is its empirical histogram, which adds up to the number of occurrence of each symbol in a sequence. The type of a sequence of length n is defined by the m-tuple \(\left (\frac {k_{1}}{n},\ldots ,\frac {k_{m}}{n}\right )\), which describes the number of occurrences kj of each j th symbol in an alphabet of size m.

  3. 3.

    Octave documentation states that “by default numeric constants are represented within Octave by IEEE 754 double precision (binary64) floating-point format” [5] which uses 1 bit for sign, 11 to represent the exponent and 52 to the significant (53 bit precision) [1, 20].

References

  1. 1.

    IEEE: Standard for floating-point arithmetic (2008)

  2. 2.

    Araujo, L.: Bincoeff. https://github.com/leolca/bincoeff (2019)

  3. 3.

    Araujo, L.C., Sansȧo, JP.H., Vale-Cardoso, A.S.: Fast computation of binomial coefficients. Numerical Algorithms https://doi.org/10.1007/s11075-020-00912-x (2020)

  4. 4.

    Comtet, L.: Advanced Combinatorics: The art of finite and infinite expansions. D. Reidel. ISBN 9027703809 (1974)

  5. 5.

    Eaton, J.W.: Gnu octave (version 5.1.0). https://octave.org/doc/v5.1.0/Numeric-Data-Types.html (2018)

  6. 6.

    Goldberg, D.: What every computer scientist should know about floating-point arithmetic. ACM Comput. Surveys (CSUR) 23 (1), 5–48 (1991)

    Article  Google Scholar 

  7. 7.

    Hoggatt, V.E., Alexanderson, G.L.: A property of multinomial coefficients. Fibonacci Quarter. 9, 351–356 (1971)

    MathSciNet  MATH  Google Scholar 

  8. 8.

    Izsȧk, F.: Maximum likelihood estimation for constrained parameters of multinomial distributions–application to zipf–mandelbrot models. Comput Stat Data Anal 51(3), 1575–1583 (2006). https://doi.org/10.1016/j.csda.2006.05.008

    MathSciNet  Article  Google Scholar 

  9. 9.

    Kochurkin, I.: How do i compute multinomials efficiently? Mathematics Stack Exchange. https://math.stackexchange.com/q/204150. (version: 2012-09-28) (2012)

  10. 10.

    Hornik, K.: Bincoeff function in GNU Octave (1994)

  11. 11.

    Manolopoulos, Y.: Binomial coefficient computation. ACM SIGCSE Bull 34(4), 65 (2002). https://doi.org/10.1145/820127.820168

    Article  Google Scholar 

  12. 12.

    McKeeman, B.: Matlab performance measurement. Technical report, Mathworks. https://www.mathworks.com/matlabcentral/fileexchange/18510-matlab-performance-measurement. [Online; Accessed 03 Feb 2020] (2008)

  13. 13.

    Muller, J.-M., Brisebarre, N., de Dinechin, F., Jeannerod, C.-P., Lefėvre, V., Melquiond, G., Revol, N., Stehlė, D., Torres, S.: Handbook of Floating-Point Arithmetic. Birkhäuser, Boston (2010)

    Book  Google Scholar 

  14. 14.

    Netto, E.: Lehrbuch Der Kombinatorik. Chelsea, New York (1958)

    MATH  Google Scholar 

  15. 15.

    Osler, T.J.: Fermat’s little theorem from the multinomial theorem. College Math. J. 33(3), 239 (2002). https://doi.org/10.2307/1559040

    Article  MATH  Google Scholar 

  16. 16.

    Pinote, T.S.: Investigations in computer-aided mathematics:experimentation, computation, and certification. PhD dissertation, Université Paris-Saclay (2018)

  17. 17.

    Rolfe, T.: Binomial coefficient recursion. ACM SIGCSE Bull. 33 (2), 35 (2001). https://doi.org/10.1145/571922.571950

    Article  Google Scholar 

  18. 18.

    Schatzman, J.C.: Accuracy of the discrete Fourier transform and the fast Fourier transform. SIAM J. Sci. Comput. 17(5), 1150–1166 (1996)

    MathSciNet  Article  Google Scholar 

  19. 19.

    Wells, D.: The penguin dictionary of curious and interesting numbers. Penguin Books. ISBN 0140080295 (1987)

  20. 20.

    Wikipedia contributors: Double-precision floating-point format - Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Double-precision_floating-point_format. [Online; Accessed 20 Mar 2020] (2020a)

  21. 21.

    Wikipedia contributors: Floating-point arithmetic. https://en.wikipedia.org/wiki/Floating-point_arithmetic. [Online; Accessed 26 Mar 2020] (2020b)

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Leonardo C. Araujo.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Araujo, L.C., Sansão, J.P.H. & Vale-Cardoso, A.S. Fast computation of multinomial coefficients. Numer Algor 88, 837–851 (2021). https://doi.org/10.1007/s11075-020-01059-5

Download citation

Keywords

  • Multinomial coefficient
  • Discrete Fourier transform
  • FFT
  • Numerical analysis