MathGroup Archive 2011

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

Search the Archive

Re: broadcasting of Equal ? (newbie question)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118185] Re: broadcasting of Equal ? (newbie question)
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 16 Apr 2011 07:31:50 -0400 (EDT)

This is covered in the documentation for Thread

Thread[f[{a, b, c}, x]]

{f[a, x], f[b, x], f[c, x]}

Let f be Equal

Thread[Equal[{a, b, c}, x]]

{a == x, b == x, c == x}

which is the same as

Thread[{a, b, c} == x]

{a == x, b == x, c == x}

Your question just uses a shorter list.


Bob Hanlon

---- Alan <alan.isaac at gmail.com> wrote: 

=============
One response I received off list suggested that I should not even
Solve with the first form, but rather should Thread it first:
Thread[{x + y - 1, 2 x + y - 2} == {0, 0}]. In fact, I was doing this
until I found I did not need to to get a correct response from Mathematica.

That just adds to my question: the forms I showed work.  Is that an
accident, or does it reflect a reliable rule?  Can you point me to the
the rule(s)?

Btw, Thread appears to allow the same kind of "broadcasting" behavior,
and again I could not anticipate that from the documentation I found.

In[7]:= Thread[{x + y - 1, 2 x + y - 2} == 0]

Out[7]= {-1 + x + y == 0, -2 + 2 x + y == 0}

So again, is this an accidental success, or a reliable rule? And if a
rule, what is it and where documented?

Thanks,
Alan Isaac




  • Prev by Date: Re: Trignometric rules
  • Next by Date: Coloring a ListSurfacePlot3D with a n x 4 matrix
  • Previous by thread: Re: broadcasting of Equal ? (newbie question)
  • Next by thread: Trignometric rules