Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Variable Coefficients' topicStudent Support Forum > General > Archives > "Variable Coefficients"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Toen
10/02/10 08:19am

g'day,

x0 = Sin[Pi/3 k];
x12 = Cos[Pi/4 k];
Sum[Binomial[12, k] x0 x12, {k, 0, 12}]

seems to do the trick, with example functions inserted into definitions of x0, x12.

Or you could treat x0 and x12 as functions of k:

Clear[x0, x12];

x0[k_] := Sin[Pi/3 k];
x12[k_] := Cos[Pi/4 k];
Sum[Binomial[12, k] x0[k] x12[k], {k, 0, 12}]

And if x0 and x12 only matter in the immediate context of this evaluation, you can define them locally:

Module[{x0, y0},
x0[k_] := k!;
x12[k_] := 2^-k;
Sum[Binomial[12, k] x0[k] x12[k], {k, 0, 12}]]

Note that this ignores any other definition of x0 and x12, and if you ran either of the top two code snippets first then x0 and x12 would still be defined as previously.


cheers,
toen

URL: ,

Subject (listing for 'Variable Coefficients')
Author Date Posted
Variable Coefficients Alex Z 09/28/10 1:54pm
Re: Variable Coefficients Daniel Z-S 09/30/10 12:01pm
Re: Variable Coefficients Toen 10/02/10 08:19am
< Previous CommentHelp | Reply To Comment | Reply To Topic