Re: Peculiar output from Union ?
- To: mathgroup at smc.vnet.net
- Subject: [mg108509] Re: Peculiar output from Union ?
- From: rafscipio <scipionedalferro at yahoo.it>
- Date: Sun, 21 Mar 2010 02:05:19 -0500 (EST)
- References: <ho1ui0$hov$1@smc.vnet.net>
On 20 Mar, 08:47, Jack L Goldberg 1 <jackg... at umich.edu> wrote: > Hi Folks, > > Can anyone explain this: > > In[1]:= Union[ 1 < x < 2, 3 < x < 5 ] > > Out[1]= 5 < x > > ?? > > I am using a MacBook Pro, OS 10.6.2 > > Thanks, > > Jack Hi, As u can read on help of Union function in Generalization and Extension par., "Union works with any head, not just List": In[1]:= Union[f[a, x, b], f[c, x, d]] Out[1]= f[a, b, c, d, x] In your case, considering the internal representation of the expressions, it results: In[2]:= 1 < x < 2 // FullForm Out[2]//FullForm= Less[1,x,2] In[3]:= 3 < x < 5 // FullForm Out[3]//FullForm= Less[3,x,5] Hence using formula [1] the result of your union is equivalent to: Less[1,2,3,5,x] ...and it's equivalent to 1<2<3<5<x ...and so to to 5<x Scipione