Re: A Functional Programming Question

• To: mathgroup at smc.vnet.net
• Subject: [mg24756] Re: [mg24705] A Functional Programming Question
• From: "Richard Finley" <rfinley at medicine.umsmed.edu>
• Date: Wed, 9 Aug 2000 02:32:24 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```David,
here is one way to get what you want, although it doesn't explicitly do the division...but it wasn't clear from your specification if that was essential....

In[2} := (#[[1, 2]] == 0) & /@ eqns

Out[2] := {x == 0, y == 0, z == 0}

If for some reason I cannot see, the division is important you could use:

(#[[1]]/#[[1, 1]] == 0) & /@ eqs

regards,   RF

>>> "David Park" <djmp at earthlink.net> 08/03/00 11:19PM >>>
Dear MathGroup,

Suppose I have three equations.

eqns = {a x == 0, b y == 0, c z == 0};

I want to divide out the constants a, b, and c. I can do it this way:

eqns[[1]] = (#1/a & ) /@ eqns[[1]];
eqns[[2]] = (#1/b & ) /@ eqns[[2]];
eqns[[3]] = (#1/c & ) /@ eqns[[3]];
eqns

{x == 0, y == 0, z == 0}

Is there a simpler method for doing the calculation in one statement with
functional programming, say using MapThread over eqns and {a,b,c}? Is there
any other simple approach?

David Park