28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

nchoosek<br />

2nchoosek<br />

Purpose Binomial coefficient or all combinations<br />

Syntax C = nchoosek(n,k)<br />

C = nchoosek(v,k)<br />

Description C = nchoosek(n,k) where n and k are nonnegative integers, returns<br />

n! ⁄ ( ( n – k)!<br />

k! ) . This is the number of combinations of n things taken k at a<br />

time.<br />

2-1518<br />

C = nchoosek(v,k), where v is a row vector of length n, creates a matrix whose<br />

rows consist of all possible combinations of the n elements of v taken k at a<br />

time. Matrix C contains n! ⁄ ( ( n – k)!<br />

k! ) rows and k<br />

columns.<br />

Examples The command nchoosek(2:2:10,4) returns the even numbers from two to ten,<br />

taken four at a time:<br />

2 4 6 8<br />

2 4 6 10<br />

2 4 8 10<br />

2 6 8 10<br />

4 6 8 10<br />

Limitations This function is only practical for situations where n is less than about 15.<br />

See Also perms

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!