Permutations (Function) — Skript
Addon: Skript · Category: Function
Syntax
permutations(options: number, selected: number) :: numberDescription
Get the number of possible ordered arrangements from 1 to 'options' with each arrangement having a size equal to 'selected' For example, permutations with 3 options and an arrangement size of 1, returns 3: (1), (2), (3) Permutations with 3 options and an arrangement size of 2 returns 6: (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2) Note that the bigger the 'options' and lower the 'selected' may result in approximations or even infinity values. Permutations differ from combinations in that permutations account for the arrangement of elements within the set, whereas combinations focus on unique sets and ignore the order of elements. Example: (1, 2) and (2, 1) are two distinct permutations because the positions of '1' and '2' are different, but they represent a single combination since order doesn't matter in combinations.
Examples
permutations(10, 2) = 90
permutations(10, 4) = 5040
permutations(size of {some list::*}, 2)