| perm | R Documentation |
Calculates the total number of ways to arrange k items selected from n distinct items, i.e., the number of permutations A(n, k) = n! / (n - k)!. This function is intended for moderate n and k. For very large numbers, consider supporting the 'gmp' package.
perm(n, k)
n |
Integer. Total number of items (non-negative integer). |
k |
Integer. Number of items selected for permutation (non-negative integer, must be <= n). |
Numeric. The permutation count A(n, k) (returns Inf for very large n).
perm(8, 4) # 1680
perm(5, 2) # 20
perm(10, 0) # 1
perm(5, 6) # 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.