type/permlist - Help

type/permlist

check for an permutation in list form

 Calling Sequence type( expr, 'permlist' )

Parameters

 expr - anything; any Maple expression

Description

 • The call type( expr, 'permlist' ) returns true if expr is a permutation of the integers $\left\{1,2,...,n\right\}$, where $n=\mathrm{nops}\left(\mathrm{expr}\right)$, and returns false otherwise.
 • A permutation of $\left\{1,2,...,n\right\}$ is a list whose members are exactly these integer, in which each integer occurs exactly once.

Examples

 > $\mathrm{type}\left(\left\{1,2,3\right\},'\mathrm{permlist}'\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\left[1,2,3\right],'\mathrm{permlist}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\left[2,1,3\right],'\mathrm{permlist}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\left[2,1,2\right],'\mathrm{permlist}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(\left[\left[1,2\right],\left[3,4\right]\right],'\mathrm{permlist}'\right)$
 ${\mathrm{false}}$ (5)