Here's a few examples that relate to how I think of A. ...

   (i.6) A. i.3
0 1 2
0 2 1
1 0 2
1 2 0
2 0 1
2 1 0

The number of permutations is the factorial of the number of items
being permuted.

   (0,~.!i.6) A. i.6
0 1 2 3 4 5
0 1 2 3 5 4
0 1 2 4 3 5
0 1 3 2 4 5
0 2 1 3 4 5
1 0 2 3 4 5

Permutation numbers which are factorials move a value one place to the
right and the value that was at that location gets moved one place to
the right. (It's a simple swap.) The larger the factorial, the farther
from the right it is where this swap occurs.

   0,(,*/)!3 5
0 6 120 720
   (0,(,+/)!3 5) A. i.8
0 1 2 3 4 5 6 7
0 1 2 3 5 4 6 7
0 1 3 2 4 5 6 7
0 1 3 2 5 4 6 7

Independent permutations compose additively.

This could also be thought of as true of overlapping permutations, but
addition is commutative and permutations are not, so for you'd need to
impose some sort of canonical ordering constraint for that abstraction
to make sense when phrased that way.

   (!4) A. (!5) A. i. 8
0 1 3 4 2 5 6 7
   (!5) A. (!4) A. i. 8
0 1 4 2 3 5 6 7

And that's probably more than most anyone wanted to know about this topic.

-- 
Raul


On Fri, Sep 12, 2014 at 3:31 PM, Dan Bron <[email protected]> wrote:
> Brian Schott wrote:
>>  1 A. b transposes the last two items of b
>
> A. is really cool. The problem with using it is coming up with the correct
> left-hand argument (code) for the permutation you want. A few special ones
> are easy to remember (particularly 0 for "do nothing", _1 for "reverse",
> and 1 for "swap")*, but outside of these, the codes are quite obscure.
>
> The most straightforward method for identifying the anagram code you want
> is by creating the desired permutation vector manually, then applying the
> *monad* A. to it, and using the resulting output as a LHA to the dyad A.
> against your real argument later.
>
> The real high road would be to study and understand the model of A. Roger
> provided [1], but that's been on my to-do list for just about a decade.
> Don't have much hope it'll get done in the next one, either (though I find
> the /:^:2@:,/ for "direct cycle representation from anagram code" part
> intriguing!).
>
> -Dan
>
> * One example that sticks in my mind of where these special anagram codes
> came in quite handy was the "zig zag matrix" puzzle. I once wrote up an
> explanation of it (including the A. parts) on RosettaCode:
>
>      http://rosettacode.org/wiki/Talk:Zig-zag_matrix#anti-diagonals
>
> [1] Roger's model of A., including the interpretation and calculation of
> "anagram codes" (i.e. the results of monad A., and the LHA to dyad A.):
>     http://www.jsoftware.com/pipermail/general/1999-September/002352.html
>
>
> ----------------------------------------------------------------------
> 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