Dispositions with repetitions; dispositions without repetitions; combinations with repetitions.

Good morning,
I use Matlab version 7.9 ; I already know the functions nchoosek(v,k) or combnk(v,k) to generate vectors of k components taking all the possible combinations without repetitions of k components among the n components of the vector v.
Now I need to do the same thing to generate vectors of k components:
  • taking all the possible combinations with repetitions of k components among the n components of the vector v;
  • taking all the possible dispositions without repetitions of k components among the n components of the vector v;
  • taking all the possible dispositions with repetitions of k components among the n components of the vector v.
Are there any functions for doing these things? If not, it is possible to do these things writing a short m-file?
Thank you.
Bussoli Lorenzo (Ph.d student in mathematics at the university of Florence).

3 Comments

I do not recall hearing "dispositions" used in this context. Could you briefly define it?
Sorry, I wrote the wrong word: I meant exactly "permutations" (that are combinations but considering the order); I wrongly wrote "dispositions" because in italian we call them "disposizioni".
Lorenzo Bussoli

Sign in to comment.

 Accepted Answer

Assuming that you want "permutation", there are some corresponding functions in the FEX:

1 Comment

Thanks very much Jan Simon, this is what I was looking for; in the question I wrote the wrong word "disposition" when I wanted to say "permutations"; the reason was because in italian we call them "disposizioni".
Lorenzo Bussoli

Sign in to comment.

More Answers (0)

Categories

Asked:

on 16 Sep 2011

Community Treasure Hunt

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

Start Hunting!