Permutationa

Description

Minimum Origin Version Required: 2019 SR0

This function is used to calculate the number of permutations (with repetitions) for a specified k elements from a given set with n elements, denoted by:

 Permutationa_{k,n} = n^{k}

Please note that this function takes both the repetitions and the internal order of the sub-set into account. For example, in the 3 elements of "a, b, c", there are 9 permutations with repetitions for 2 elements: "'a, ab, ac, bb, bc, cc, cb, ca, ba".

Syntax

double Permutationa( int n, int k )

Parameters

n

The number of elements in a given set. It must be a positive integer.

k

The number of elements in each permutation. It must be a positive integer and k < n.

Return

Return the number of k-permutations from a given set with n elements.

Example

permutationa(4, 2) = ;  // returns 16
permutationa(8, 2) = ;  // returns 64

See Also

Combine, Combina, Permut