A=: 1 2 3 3 3
B=:3 3 3 3 3 4 5 6
A IS_reb B
3 3 3
A=:1 2 3 3 3
B=:3 3 3 3 3 4 5 6
us=: 13 :'(+./"2 x=/x,y)#x,y'
A us B
1 2 3 3 3 3 3 3 3 3
is=: 13 :'(+."1/x=/y)#y'
A is B
3 3 3 3 3
Linda
-----Original Message-----
From: Programming <[email protected]> On Behalf Of Don
Guinn
Sent: Tuesday, October 30, 2018 12:32 PM
To: Programming forum <[email protected]>
Subject: Re: [Jprogramming] Intersection and Union of (multi)sets
Yes. The killer is p: . But this got me curious. I finally remembered that the
inverse of q: was */ but I was surprised to find that the inverse of */ was q:
*/ b._1
q:
*/^:_1]12 2 2 3
But this is an error.
+/ b._1
|domain error
| +/b._1
Granted, the inverse of sum has no meaning. And the inverse of */ to be q:
makes a useful tool. But information is lost.
(]&.(*/))3 4
2 2 3
So I was thinking that */^:_1 should be an error. Then again,
*: b._1
%:
(]&.*:)_4 4
4 4
----------------------------------------------------------------------
For information about J forums see
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7Cf37820c18ca64486fce808d63e85341c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636765139156867865&sdata=PXJVvRemk4pIj9%2B1AwEwBDX9W4vA0b3bEyZpFJp%2FjNs%3D&reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm