I seem to have answered a similar
But different question.

a-:"2 (i.20)|."0 2 a
1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
   
Linda

-----Original Message-----
From: Programming <[email protected]> On Behalf Of Roger 
Hui
Sent: Wednesday, February 13, 2019 7:29 PM
To: [email protected]
Subject: Re: [Jprogramming] nubsieve modulo rotation

Idea k: a minimum vector necessarily begins with a minimum sub-sequence in 
x,(k-1){.x of length k , itself necessarily begins with the minimal item.


On Wed, Feb 13, 2019 at 9:52 AM Roger Hui <[email protected]> wrote:

> Yes, well, left as an exercise for the reader. :-)
>
> Idea: the minimum rotation of a vector necessarily begins with its 
> minimal item.
>
> On Wed, Feb 13, 2019 at 9:34 AM Henry Rich <[email protected]> wrote:
>
>> Yes; but now suppose the lines are very long.  Is there a way to find 
>> the signature (I would call it a canonical form) that doesn't require 
>> enumerating rotations?  (I haven't found a good way yet).
>>
>> Henry Rich
>>
>> On 2/13/2019 12:16 PM, Roger Hui wrote:
>> > For each row, find a "signature", then find the nub sieve of the 
>> > signatures.  The signature I use here is the minimum of all 
>> > possible rotations.
>> >
>> >     signature=: {. @ (/:~) @ (i.@# |."0 1 ])
>> >
>> >     ~: signature"1 a
>> > 1 1 1 1 1 0 1 1 1 1 1 0
>> >
>> >
>> >
>> >
>> > On Wed, Feb 13, 2019 at 8:55 AM R.E. Boss <[email protected]> wrote:
>> >
>> >> Let the 12 x 20 matrix be defined by
>> >> a=: 0 : 0
>> >>   1  4  4  1 _4 _4  1  1 _4 _1 _1 _4 _4 _1  4  4 _1 _1  4  1
>> >>   1  4  4  1 _4 _4  1  1 _4 _1 _1 _4 _4 _1  4  1  4 _1 _1  4
>> >>   1  4  4  1 _4 _1 _4  1  1 _4 _1 _4 _4 _1  4  1  4 _1 _1  4
>> >>   4  1  1  4 _1  4  1 _4 _4  1 _4 _1 _1 _4  1 _4 _1  4  4 _1
>> >>   4  1  1  4 _1  4  1 _4 _4  1  1 _4 _1 _1 _4 _4 _1  4  4 _1
>> >> _1  4  1  1  4  4  1 _4 _4  1  1 _4 _1 _1 _4 _4 _1  4  4 _1
>> >> _1  4  4 _1 _4 _4 _1 _1 _4  1  1 _4 _4  1  4  4  1  1  4 _1
>> >> _1  4  4 _1 _4 _4 _1 _1 _4  1  1 _4 _4  1  4 _1  4  1  1  4
>> >> _1  4  4 _1 _4  1 _4 _1 _1 _4  1 _4 _4  1  4 _1  4  1  1  4
>> >>   4 _1 _1  4  1  4 _1 _4 _4 _1 _4  1  1 _4 _1 _4  1  4  4  1
>> >>   4 _1 _1  4  1  4 _1 _4 _4 _1 _1 _4  1  1 _4 _4  1  4  4  1
>> >>   1  4 _1 _1  4  4 _1 _4 _4 _1 _1 _4  1  1 _4 _4  1  4  4  1
>> >> )
>> >>
>> >> Required is the nubsieve for the items modulo rotation.
>> >> So two arrays are considered to be equal if one is a rotation of 
>> >> the
>> other.
>> >>
>> >> The answer I found is
>> >> 1 1 1 1 1 0 1 1 1 1 1 0
>> >>
>> >>
>> >> R.E. Boss
>> >> ------------------------------------------------------------------
>> >> ---- For information about J forums see 
>> >> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fw
>> >> ww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C1224098d21c44d
>> >> 75bc6408d6921380fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63
>> >> 6857009797826451&amp;sdata=apkgmVfZxBk1w8eRKWyXOUeZKSZ%2BmDJvsJb5W
>> >> 4mQBrA%3D&amp;reserved=0
>> > -------------------------------------------------------------------
>> > --- For information about J forums see 
>> > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fww
>> > w.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C1224098d21c44d75
>> > bc6408d6921380fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63685
>> > 7009797826451&amp;sdata=apkgmVfZxBk1w8eRKWyXOUeZKSZ%2BmDJvsJb5W4mQB
>> > rA%3D&amp;reserved=0
>>
>>
>> ---
>> This email has been checked for viruses by AVG.
>> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww
>> .avg.com&amp;data=02%7C01%7C%7C1224098d21c44d75bc6408d6921380fc%7C84d
>> f9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636857009797826451&amp;sdata=
>> 7n%2BdphLF5YuUD6GZpmsdXZZJrqppMxw%2FEhBurUCpnIw%3D&amp;reserved=0
>>
>> ---------------------------------------------------------------------
>> - For information about J forums see 
>> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
>> jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C1224098d21c44d75bc64
>> 08d6921380fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63685700979
>> 7826451&amp;sdata=apkgmVfZxBk1w8eRKWyXOUeZKSZ%2BmDJvsJb5W4mQBrA%3D&am
>> p;reserved=0
>
>
----------------------------------------------------------------------
For information about J forums see 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C1224098d21c44d75bc6408d6921380fc%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636857009797826451&amp;sdata=apkgmVfZxBk1w8eRKWyXOUeZKSZ%2BmDJvsJb5W4mQBrA%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to