Hi Peter,

I see that Raul has already answered, but here is my two cents, since I had 
approached your question in a different way.

    A. 3 2 4 1  NB. Monadic A. (Anagram Index) returns the permutation for 3 2 
4 1
15
   15 A. 0 1 2 3  NB. Dyadic A. (Anagram) returns the permutation applied to 0 
1 2 3 (0 origin makes things a little clearer)
2 1 3 0
    15 A.^:_1 [ 2 1 3 0  NB. inverse using power conjunction ^:_1
0 1 2 3
   15 A.^:1 [ 0 1 2 3  NB. apply once using power conjunction ^:1
2 1 3 0
   15 A.^:2 [ 0 1 2 3  NB. apply twice using power conjunction ^:2
3 1 0 2
   15 A.^:3 [ 0 1 2 3  NB. apply three times using power conjunction (back to 
original) ^:3
0 1 2 3
   C.  2 1 3 0  NB. Monadic C. (Cycle) reveals cycles of the permutation
┌─┬─────┐
│1│3 0 2│
└─┴─────┘

Also, Roger covers some of this ground in the Idiosyncratic Introduction to J 
lab as one of his lessons.

Cheers, bob

> On Oct 16, 2019, at 10:24 AM, Raul Miller <[email protected]> wrote:
> 
> That example wouldn't be a permutation in J, because J indices start
> at 0. But let's assume you meant to subtract 1 from each of those
> values...
> 
> Anyways, I think you are asking about this:
> 
> https://www.jsoftware.com/help/dictionary/dccapdot.htm
> 
> "If p is a permutation of the atoms of i.n, then p is said to be a
> permutation vector of order n, and if n=#b, then p{b is a permutation
> of the items of b ."
> 
> So "a permutation" would a list of indices p such that (i.#p)-:/:~p
> 
> And, an inverse permutation would be a list of indices ip such that 
> (i.#p)-:ip{p
> 
> So a function which produces the inverse of a permutation is /:
> 
> And, a function composing two permutations into one is {
> 
> Does this help?
> 
> Thanks,
> 
> -- 
> Raul
> 
> On Wed, Oct 16, 2019 at 12:53 PM <[email protected]> wrote:
>> 
>> Hello again,
>> 
>> To my understanding an example of the usual representation of a
>> permutation is 3 2 4 1, meaning the permutation takes 3 to 1, 2 to 2,
>> 4 to 3 and 1 to 4. The inverse is 4 2 1 3.  OK?
>> 
>> In J,
>> what is a function producing the inverse of a permutation?
>> what is a function composing two permutations into one?
>> 
>> Thanks,                 ... Peter E.
>> 
>> 
>> 
>> 
>> 
>> --
>> https://en.wikibooks.org/wiki/Medical_Machines
>> Tel: +1 604 670 0140            Bcc: peter at easthope. ca
>> 
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to