File Exchange

image thumbnail

Generate binomial table

version (1.62 KB) by David Holdaway
Very simple function to generate a table of all possible binomial coefficients below a cut off

1 Download

Updated 17 Jan 2012

View Version History

View License

Uses a recursion relation to generate all the binomial coefficients nchoosek(n,k) for a range n<=nmax, k<= n. This is much faster than using nchoosek to make this table.

The idea of this function is to be used when you have to evaluate large sums involving binomial coefficients, generating this table and sampling it would be much quicker than generating elements on the fly.

For this reason there is an inbuilt option that if the function is given two parameters it will generate a table of log(nchoosek) which is useful if it appears in summations where nchoosek may evaluate to inf.

Cite As

David Holdaway (2021). Generate binomial table (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)


David Holdaway

Edit: Modified recursion relation used to [n choose k] = [(n-1) choose k-1 ] + [n-1 choose k ]

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!