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.

  • $\begingroup$ 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. $\endgroup$ – Dan Uznanski Aug 20 '14 at 3:08
  • $\begingroup$ You want $ \sum_{i = 1}^{n}{^nP_i} $ $\endgroup$ – hjpotter92 Aug 20 '14 at 3:10
  • $\begingroup$ 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. $\endgroup$ – David Greydanus Aug 20 '14 at 3:10
  • 2
    $\begingroup$ $k$-permutations. That's it en.wikipedia.org/wiki/Permutation#k-permutations_of_n $\endgroup$ – Ehsan M. Kermani Aug 20 '14 at 3:17
  • 1
    $\begingroup$ I would call these "partial permutations". $\endgroup$ – 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 \]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.