# What is the mathamatical term for this programming concept?

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.

For example,

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.

• So you want a name for {(), (A), (B), (C), (A,B), (A,C), (B,A), (B,C), (C,A), (C,B), (A,B,C), (A,C,B), (B,A,C), (B,C,A), (C,A,B), (C,B,A)}? Idunno, but you got me curious. – Dan Uznanski Aug 20 '14 at 3:08
• You want $\sum_{i = 1}^{n}{^nP_i}$ – hjpotter92 Aug 20 '14 at 3:10
• I was wondering if there is a name for ('A', 'B'), ('A', 'C'), ('B', 'A'), ('B', 'C'), ('C', 'A'), ('C', 'B'), But if there is a name for that sequence, I would be interested in that to. – David Greydanus Aug 20 '14 at 3:10
• $k$-permutations. That's it en.wikipedia.org/wiki/Permutation#k-permutations_of_n – Ehsan M. Kermani Aug 20 '14 at 3:17
• I would call these "partial permutations". – Jair Taylor Aug 20 '14 at 18:40

If $f(n)$ is the sum of k-permutations of n, then $f(n)=\sum_{i=1}^{n} \frac{n!}{(n-i)!},\ \mbox{for}\ n\ge1$