I would like to find k-element variations of n elements with repetition not allowed as defined in this document. I found several posts considering combinations and permutations but non dealing with variations. From the cited document, "variations are arrangements of selections of objects, where the order of the selected objects matters." I cannot find suitable function in the combinat
package. I want to achieve result equivalent to this answer but for variations, not combinations.
An example: We have n=4 elements and want to find the k=2 element variations. There should be 12 possible variations:
1 and 2; 1 and 3; 1 and 4;
2 and 1; 2 and 3; 2 and 4;
3 and 1; 3 and 2; 3 and 4;
4 and 1; 4 and 2; 4 and 3.