Permutation set ... cont
Date: 01/26/06
(Algorithms) Keywords: no keywords
Earlier I asked about printing all N! combination of set of N elements ...
Now if I don't want to print all N! permutations but rather have a set s from 1 .... n but only want all the permutations of size k . Forget about the actual algorithm, how many will there permutation will there be ?
for example s = 1 2 3 4 and k is 2 so the avail sets are 1 2 , 1 3 , 1 4 , 2 1 , 2 3 , 2 4 , 3 1 , 3 2 , 3 4, 4 1 , 4 2 , 4 3 . It seems it will be n choose k * k! where n is the number of elements in s and k is the permutation size. Is that correct ?
Source: http://community.livejournal.com/algorithms/71982.html