Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

permutations function

All the orderings of a list.

How to write it

permutations(list)

list
The list. Takes a list.

Examples

  • permutations⁡([1,2,3])=(123132213231312321)\displaystyle \operatorname{permutations}(\left[ 1, 2, 3 \right]) = \begin{pmatrix} 1 & 2 & 3 \\ 1 & 3 & 2 \\ 2 & 1 & 3 \\ 2 & 3 & 1 \\ 3 & 1 & 2 \\ 3 & 2 & 1 \end{pmatrix}
    permutations([1, 2, 3])

    In the solver, permutations([1, 2, 3]) gives [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]].

    Open in the solver