I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.70
sub units 3.12
+
0

Multinomial Gamma

Calculates the multinomial coefficient with the given arguments.
Controller: CodeCogs

Dependents

Info

Interface

C++

Multinomial Gamma

 
intmultinomial_gammaintn
int*factors )
This function calculates the multinomial coefficient with the given arguments \inline  k_1, k_2, \ldots k_n given by

Large values of the factors may be given without the fear that computer overflow would occur during intermediate calculations. This is possible with the use of the logarithm of the Gamma function.

References:

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

Example 1

#include <codecogs/maths/combinatorics/arithmetic/multinomial_gamma.h>
#include <iostream>
int main()
{
  int factors[4] = {1, 2, 5, 3};
  std::cout << "In the case of the following factors" << std::endl;
  for (int i = 0; i < 4; i++)
    std::cout << factors[i] << "  ";
  std::cout << std::endl << "the multinomial coefficient is" << std::endl;
  std::cout << Maths::Combinatorics::Arithmetic::multinomial_gamma(4, factors) << std::endl;
  return 0;
}
Output:
In the case of the following factors
1  2  5  3
the multinomial coefficient is
27720

Parameters

nthe number of arguments
factorsthe factors of the multinomial, given as an array

Returns

the multinomial coefficient based on the values of the factors

Authors

Lucian Bentea (August 2005)
Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.