<-- Previous || Up || Next -->

Permutations Function
Math Probability Class

Public Function Permutations( _
      ByVal vNumber As Variant _
    , ByVal vChosen As Variant _
    ) As Variant

Permutation of N things taken C at a time.

Summary: The number of ways that C things can be chosen from N things when the order in which they are chosen matters. To calculate how many possible first, second, and third place winners there are in a field of 10 people, use Permutations(10, 3).
    Permutations(1, 1) = 1
    Permutations(2, 1) = 2
    Permutations(2, 2) = 2
    Permutations(4, 1) = 4
    Permutations(4, 2) = 12
    Permutations(4, 3) = 24
    Permutations(4, 4) = 24
    Permutations(5, 4) = 120
    Permutations(5, 5) = 120
    Permutations(21, 9) = 106661318400
    IsNull(Permutations(9, 21)) = True
See also:
    Combinations Function
    CombinationsWithRepetitions Function
    Factorial Function
    PERMUT Function (Microsoft Excel)
vNumber: The number of unique items from which permutations can be constructed. Function returns Null if vNumber is Null, cannot be interpreted as a number, is less than or equal to zero (<=0), or is less than vChosen. vNumber will be rounded down to the nearest integer.
vChosen: The number of items which are to be combined each time some are selected. Function returns Null if vChosen is Null, cannot be interpreted as a number, or is less than zero (<0). vChosen will be rounded down to the nearest integer.
Note: Function will return Null instead of generating an error if any of its calculations cause Overflow or other types of errors.
    Factorial(N) / Factorial(N - C)
v1.5 Pro Note: The argument names and the implementation of this function has changed.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.