combinat
numbperm
Count the number of permutations
Calling Sequence
Parameters
Description
Examples
numbperm(n)
numbperm(n, r)
n
-
a list/set of objects or an integer
r
(optional) integer
If n is a list or set, then numbperm counts the permutations of the elements of n taken r at a time. If n is a non-negative integer, it is interpreted in the same way as a list of the first n integers. If r is not specified, it is taken to be r=numelems⁡n.
The count of permutations takes into account duplicates in n. In the case where there are no duplicates, the count is given by the formula n!n−r!. Otherwise the generating function is used.
The function permute will compute the number of permutations. Thus numbperm(n, r) = numelems(permute(n, r)).
The command with(combinat,numbperm) allows the use of the abbreviated form of this command.
with⁡combinat,numbperm
numbperm⁡3
6
numbperm⁡3,2
numbperm⁡a,b
2
numbperm⁡a,b,c,2
numbperm⁡a,a,b,2
3
See Also
combinat[permute]
Download Help Document