 
 
 
 
 
 
Re: Intersection @ Complement
- To: mathgroup at smc.vnet.net
- Subject: [mg58116] Re: Intersection @ Complement
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Sun, 19 Jun 2005 03:43:19 -0400 (EDT)
- References: <d90tcg$99f$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Zak Seidov wrote:
> Some crazy thing Mmca does with
> Intersection/Complement:
> 
> s1={1,2,5,7,4,4,1};s2={1,6,3,5,7,7,1,6};
> Intersection[s1,s2]
> {1,5,7} (* not {1,1,5,7} ?!*)
> Complement[s1,s2]
> {2,4} (* not {2,4,4} ?!*)
> Complement[s2,s1]
> {3,6} (* not {3,6,6,7} ?!*)
> 
> Interestingly, in both cases Mmca Help
> says that the result is SORTED list,
> while actually it's UNION not SORT that works?!
> And note that in the last case 7 is absent at all ?!
> what d'u think about this? thanks a lot, zak
> 
These are SET operations - they are meant to work on lists of distinct 
objects - if you give them lists with repeats, the arguments are 
subjected to Union first.
David Bailey
http://www.dbaileyconsultancy.co.uk

