0
$\begingroup$

I'm using Wolfram | Alpha Pro; I have a function

f[n] = 351n^(-0.7);

How do I apply it to each element of a list like {2, 9, 22}?

f/@{2, 9, 22} just results in showing {f(2), f(9), f(22)} without calculating the values. Thanks.

$\endgroup$
  • 3
    $\begingroup$ I have no idea what is possible in W|A Pro, but when it takes real Mathematica syntax, then you should try to define your function as f[n_]:=351n^(-7/10) $\endgroup$ – halirutan Feb 2 '16 at 1:00
2
$\begingroup$
f[n_] = 351 n^(-0.7);

f /@ {2, 9, 22}

(*  {216.066, 75.3941, 40.3284}  *)

Or, using a pure function

351 #^(-0.7) & /@ {2, 9, 22}

(*  {216.066, 75.3941, 40.3284}  *)

In WolframAlpha use the pure function

WolframAlpha["351 #^(-0.7)&/@{2,9,22}"]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Bob, this works, thank you so much. $\endgroup$ – Strychnine Feb 2 '16 at 3:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.