Function partialPermutation

  • This method calculates the number of ordered subsets of k elements taken from a set of n elements.

    Parameters

    • n: number

      Number of elements in set.

    • k: number

      Number of elements in subset.

    Returns f64

    • The number of ordered subsets of k elements taken from a set of n elements.
    • If k > n : the value of n!.

    Remarks

    • The method uses the formula P(n,k) = n!/(n-k)! to calculate the number of permutations.
    • Requires n > k >= 0 to work properly. If k > n, the method returns the value of n!.

Generated using TypeDoc