NMULTICHOOSEK

版本 1.0.0.0 (1.6 KB) 作者: Peter (PB) Bodin
Fast unordered samples with or without repetition.
1.9K 次下载
更新时间 2005/11/17

查看许可证

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

引用格式

Peter (PB) Bodin (2024). NMULTICHOOSEK (https://www.mathworks.com/matlabcentral/fileexchange/9029-nmultichoosek), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14SP3
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Equation Solving 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

changed category.