In python's itertools, there is a function called permutations. It returns the number of ways to arrange x number of variables into a given space.
permutations("ABC", 2) == [('A', 'B'), ('A', 'C'), ('B', 'A'), ('B', 'C'), ('C', 'A'), ('C', 'B')]
The first argument is the number of variables, and the second is the size of each group.
This concept is similar to factorial, but you don't use every variable in each group.
Side question: Is there a mathematical term for all of the differnt permuation size added up all the way to factorial, e.g, permutations("ABC", 1)+permutations("ABC", 2)+permutations("ABC", 3)
Sorry if this is a silly question. I am just a HS student.