Code covered by the BSD License  

Highlights from
multcoef

3.5

3.5 | 2 ratings Rate this file 2 Downloads (last 30 days) File Size: 2.24 KB File ID: #6786

multcoef

by Antonio Trujillo-Ortiz

 

24 Jan 2005 (Updated 02 Oct 2006)

Multinomial coefficient.

| Watch this File

File Information
Description

This m-file returns the multinomial coefficient with parameter N at the values in X. Let {X1, X2, . . . , Xk}, k > 1, be a set of random variables, each of which can take the values 0, 1, . . . , n; such that for every set of k nonnegative integers {n1, . . . , nk} whose sum is n, the multinomial coefficient is,

C(n;n1,n2,...,nk) = (n1, n2,...,nk)! =
                    
        (n1 + n2 + ... nk)!
    --------------------------- .
    n1! × n2! × . . × nk!
 
It is possible to work with large factorials.

It needs to input n-number of trials and x-vector of the interested values.

File outputs the multinomial coefficient.

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
26 Jan 2005 Mukhtar Ullah

Please have a look at MULTINOMIAL in this file exchange, which also can compute the coefficicent for arrays of inputs.

27 Jan 2005 Mukhtar Ullah

Thank you for your comments on MULTINOMIAL. You are right; I am trying to improve it now.

28 Jun 2006 Daniel Giesy

Bug: multcoef(3,[1,2]) returns "2", correct answer is "3".
Fix: Replace "fix" in line 85 by "round"

03 Jul 2007 J. R. Harrison

Thanks to the authors. It works perfectly.

Please login to add a comment or rating.
Updates
26 Jan 2005

It was added an appropriate format to cite this file.

07 Apr 2005

Text was improved.

02 Oct 2006

"fix" in line 85 was replaced by "round".

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:40:08
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:40:08
multinomial Antonio Trujillo-Ortiz 22 Oct 2008 07:40:08
multinomial distribution Antonio Trujillo-Ortiz 22 Oct 2008 07:40:08
multinomial coefficient Antonio Trujillo-Ortiz 22 Oct 2008 07:40:08

Contact us at files@mathworks.com