Roger, you had two ideas that allowed me to correct my solution.  Thanks!

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


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

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://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.j
> software.com%2Fforums.htm&amp;data=02%7C01%7C%7Ce491480ff04546a321cf08
> d691d7000d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C63685674993273
> 6014&amp;sdata=ddN6WvSdLIR7Y3KdJxxMYTCOebg%2BNgMT%2BGYXSxaNZBM%3D&amp;
> reserved=0
----------------------------------------------------------------------
For information about J forums see 
https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7Ce491480ff04546a321cf08d691d7000d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636856749932736014&amp;sdata=ddN6WvSdLIR7Y3KdJxxMYTCOebg%2BNgMT%2BGYXSxaNZBM%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to