PERM Function

Computes the number of permutations of n items that are taken r at a time.

Category: Combinatorial

Syntax

PERM(n<,r> )

Required Argument

n

is an integer that represents the total number of elements from which the sample is chosen.

Optional Argument

r

is an integer value that represents the number of chosen elements. If r is omitted, the function returns the factorial of n.

Restriction rn

Details

The mathematical representation of the PERM function is given by the following equation:
P E R M ( n , r ) = n ! ( n - r ) !
with n ≥ 0, r ≥ 0, and nr.
If the expression cannot be computed, a missing value is returned. For moderately large values, it is sometimes not possible to compute the PERM function.

Example

The following SAS statements produce these results.
SAS Statement
Result
x=perm(5,1);
5
x=perm(5);
120
x=perm(5,2)
20