Here is a pure function with multiple slots:
(#1^2 + #2^2)&[3, 4]
25
But how can I map that pure function over lists of values? For example, say I want to map (#1^2 + #2^2)& over x = {1, 2, 4} and y = {3, 4, 6}. I have tried the following expressions, but none of them work:
Map[(#1^2 + #2^2) &, {1, 2, 4}, {3, 4, 6}]
Map[(#1^2 + #2^2) &, {{1, 2, 4}, {3, 4, 6}}]
Map[(#1^2 + #2^2) &, {{1, 3}, {2, 4}, {4, 6}}]
The result I expect is obviously {10, 20, 52}.
Could some one help me with this?
x^2+y^2works, too. – Corey Kelly Jun 27 '13 at 16:00