Find and return Binomial Coefficients (BCs) in a matrix up to N.

This function can return N choose K (K <= N) as well as a BC matrix up to N choose N.
188 download
Aggiornato 30 dic 2011

Visualizza la licenza

The function BINOMIND(N,K,SPEED) does not use loops (apart from a redundant check) or division nor indeed factorials to generate the Binomial Coefficients (BCs). It simply constructs the lower-triangular Pascal matrix and does a simple lookup to get the desired BC.

BINOMIND is much faster than NCHOOSEK at creating matrices of BCs if you set SPEED to TRUE and also has a basic integrity check to compare it with nchoosek. It can return 3 lots of data: comb,binTable, errorRate but you can just use it to find combinations by default.

Cita come

Bruce Raine (2024). Find and return Binomial Coefficients (BCs) in a matrix up to N. (https://www.mathworks.com/matlabcentral/fileexchange/34375-find-and-return-binomial-coefficients-bcs-in-a-matrix-up-to-n), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2011a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Discrete Math in Help Center e MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.2.0.0

Fixed one bug in the 'if nargin' statement on line 43 and improved 'if k > n' error message on line 49.

1.1.0.0

I added more input parameter checking, an extra input parameter, SPEED as well as a warning message for COMB values above a predefined tolerance limit. I also improved the documentation of the function.

1.0.0.0