MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Distribute

  • To: mathgroup at smc.vnet.net
  • Subject: [mg2808] Distribute
  • From: "Arnold Seiken" <SEIKENA at gar.union.edu>
  • Date: Tue, 19 Dec 1995 02:41:01 -0500

What is the rhyme or reason to the way Distribute works?
 In[57]:=
Distribute[h[{a,b,c}, {1,2,3}], List]
Out[57]=
{h[a, 1], h[a, 2], h[a, 3], h[b, 1], h[b, 2], h[b, 3], h[c, 1], h[c, 2], 
 
  h[c, 3]}
In[58]:=
%/.h->Plus
Out[58]=
{1 + a, 2 + a, 3 + a, 1 + b, 2 + b, 3 + b, 1 + c, 2 + c, 3 + c}
But,
In[59]:=
Distribute[Plus[{a,b,c}, {1,2,3}], List]
Out[59]=
{{1 + a, 2 + b, 3 + c}}
and,
In[56]:=
Distribute[Plus[{a,b,c}, {1,2,3,4}], List]
Thread::tdlen: Objects of unequal length in {a, b, c} + {1, 2, 3, 4}
     cannot be combined.
Out[56]=
{1 + a, 2 + a, 3 + a, 4 + a, 1 + b, 2 + b, 3 + b, 4 + b, 1 + c, 2 + c, 3 + c, 
 
  4 + c}



  • Prev by Date: Re: Re: Bug ListPlot?
  • Next by Date: Re: Re: Oh why is life never easy? Need help with |vector|
  • Previous by thread: Distribute
  • Next by thread: Re: Distribute