perms

permutation generator

Created by Panaiotis
© 2001 by Panaiotis. All rights reserved.

General

perms uses interval class transformations to generate unique permutations of unordered sets with 1 to 8 members.

Input

  bang in leftmost inlet: output most recent member index.
  int in leftmost inlet: set index value. Triggers output of corresponding universal set member.
  int in1 values 1 to 8 are used to indicate the universal set size.
  int in2 interval class index. Range is 0 to MAXindex where MAXindex is determined by the universe and class size.
  int in3 octave restrain. When set to 0, perms will generate index values beyond the range of a single set membership. Turning it on (1) will restrict output to modulo universe size.
  int in4 bass member value. Determines which set member index the permutation class starts from.
  int in5 mode or rotation. Range is 0 to maxRotations where maxRotations is determined by the universe size, class size, and array index.
  int in6 normal/inverted form of the array. Has no effect if the array is non-invertible. Values are 0 (normal) and 1 (inverted).
  int in7 normal/retrograde form of the array. Has no effect if the array is symmetrical. Values are 0 (normal) and 1 (retrograde).
  U arg1 in left inlet. arg is the universe size. Range is 1 to 8.
  list spray-type list. Like sending values to the inlets.
  analyze arg In analysis mode (analyze 1), perms outputs descriptive information about the permutation each time a transformation value or set is changed (see output for details). In Performance mode (analyze 0), this information is suppressed to speed up performance.

Arguments

none

Output

From left to right:

  perm out generated when perms receives an integer in left inlet. Set member index
  interval generated when perms receives an integer in left inlet. Interval between previous output and current.
  maxNdx one less than the number of classes for a given class size. Used to set a max limit on class index input.
  rotations one less than the number of unique modes or cyclic rotations for the interval array. Used to set a max limit on mode input.
  invertible 0 if interval array inversion is non-unique, 1 if unique. < 1 1 1 :1 > is invertible since < -1 -1 -1 :-1 > (which is equivalent to <3 3 3 :3>) yields a unique set of permutations.
  symmetrical

0 if interval array is symmetrical, 1 if asymmetrical. The first asymmetrical permutation class array is 6-2: <1 1 2 1 4 :3>. Its retrograde form <1 1 3 4 1 :2> yields a unique set of permutations.

  elemAnal

Analysis output: member value of the subset.

  intrvlAnal

Analysis output: interval between previous member and current member.

  analNdx Analysis output: member index position of the subset.

Examples

The unordered set {$, &, ¥, %} has 24 permutations. They can be represented by 2 permutation patterns using index interval arrays:

{$, &, ¥, %} set
{0, 1, 2, 3} indexed set
4-0 < 1 1 1 :1 > yields 8 permutations

    < 1 1 1 :1 >

< 3 3 3 :3 >

bass 0 0 0, 1, 2, 3 0, 3, 2, 1
    $, &, ¥, % $, %, ¥, &
  1 1 1, 2, 3, 0

1, 0, 3, 2

  2 2 2, 3, 0, 1

2, 1, 0, 3

  3 3 3, 0, 1, 2

3, 2, 1, 0

4-1 < 1 2 3 :2 > yields 16 permutations

  mode 0 mode 1 mode 2 mode 3
  <1 2 3 :2 > <2 3 2 :1> <3 2 1 :2> <2 1 2 :3>
bass 0 0, 1, 3, 2 0, 2, 1, 3 0, 3, 1, 2 0, 2, 3, 1
bass 1 1, 2, 0, 3 1, 3, 2, 0 1, 0, 2, 3 1, 3, 0, 2
* * * etc.        

Each member of the permutation set can be accessed by its index position:

{n0, n1, n2, n3}.

A permutation of 4-1 with bass 2 in mode 1 will generate the permutation set:

{2, 0, 3, 1}, which references the objects: {¥, $, %, &}.

Input to perms:

input output
0 2 ¥
1 0 $
2 3 %
3 1 &

See also

sets, perms.help, and publication Handbook of set and permutation classes by Panaiotis, which lists all permutation classes of 1 to 8 members with characterizations of each one.

Send requests to panaiotis@aol.com or Panatorium Press, 448 Banyon Tree Cir #206, Maitland FL 32751