Code covered by the BSD License  

Highlights from
NMULTICHOOSEK

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 1.58 KB File ID: #9029

NMULTICHOOSEK

by Peter (PB) Bodin

 

14 Nov 2005 (Updated 17 Nov 2005)

Fast unordered samples with or without repetition.

| Watch this File

File Information
Description

NMULTICHOOSEK(N,K) finds the number of multisets of length k on n symbols. NMULTICHOOSEK can take vector or scalar input.

NMULTICHOOSEK(N,K,'single') is the same as NCHOOSEK (unordered samples WITHOUT repetition), except that it accepts vector inputs for both n and k.

NMULTICHOOSEK(N,K,'multi') is the same as NMULTICHOOSEK(N,K).

Examples:
   N = nmultichoosek(5,1:5)

   finds the number of multisets of
   length 1 to 5 from a 5 symbol set

   N = nmultichoosek(5,1:5,'single')

   is the same as:

   for k=1:5
      N(k) = nchoosek(5,k);
   end

MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements Tested in R14 SP3 but should work earlier versions.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
15 Nov 2005

Corrected a typo in the help.

17 Nov 2005

changed category.

Tag Activity for this File
Tag Applied By Date/Time
binomial Peter (PB) Bodin 22 Oct 2008 08:06:13
combinations Peter (PB) Bodin 22 Oct 2008 08:06:13
nchoosek Peter (PB) Bodin 22 Oct 2008 08:06:13
mathematics Peter (PB) Bodin 22 Oct 2008 08:06:13
general Peter (PB) Bodin 22 Oct 2008 08:06:13

Contact us at files@mathworks.com