UtilCombinatoricsCalculatePermutations(Int32, Int32, Boolean) Method

Calculates the amount of permutations that can be generated with the specified character set and string length.

Definition

Namespace: DevCase.Core.Math.Combinatorics
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static long CalculatePermutations(
	int charsetLength,
	int stringLength,
	bool allowRepetition
)

Parameters

charsetLength  Int32
The length of the chararacter set. That is, the amount of elements in the set.
stringLength  Int32
The desired string length of each permutation.
allowRepetition  Boolean
A value indicating whether permutation repetition is allowed.

Return Value

Int64
The resulting amount of permutations that can be generated.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Exceptions

ArgumentOutOfRangeException stringLength; The value of 'stringLength' must be smaller than 'charsetLength'.

See Also