In a rush as Liz wants to leave this WiFi spot....
The first cuts down on the number of rotations...
sig =: 3 : 0
min =. {. @: (/:~) y
imin =. I. y = min
{./:~ imin |."0 1 y
)
This second looks at pairs. Unchecked as rushing off...
sig2 =: 3 : 0
min =. {./:~ ~.2 ,/\r =. (,{.) y
imin =. I. r = {.min
{./:~ imin |."0 1 y
)
All til this time tomorrow!
Mike
Sent from and worked on with my iPad
> On 13 Feb 2019, at 17:16, Roger Hui <[email protected]> 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 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