Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Extracting nested iterator values' topicStudent Support Forum > General > Archives > "Extracting nested iterator values"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
05/28/12 7:41pm

First step, instead of writing
Sum[Sum[Sum[..,{..}],{..}],{..}]
you can write this as
Sum[..,{..},{..},{..}]

Second step,
In[1]:= lst[m_,a_]:=Join[Table[{ToExpression["r"<>ToString[i]],ToExpression["r"<>ToString[i-1]], a+i},{i,m,2,-1}],{{r1,2,a+1}}];
lst[4,6]

Out[2]= {{r4,r3,10},{r3,r2,9},{r2,r1,8},{r1,2,7}}

Third step,
In[3]:= Sum[r3+r2+r1,Evaluate[Sequence@@lst[3,4]]]

Out[3]= -2(-7+r1)(13(8-r2)+r1(8-r2)-(-8+r2)(7+r2))

Now you need to study each of those pieces and try to understand how and why each of those is working. Then you need to check to make certain that I have not made any mistakes. And finally you need to try to adapt this to solve your problem.

URL: ,

Subject (listing for 'Extracting nested iterator values')
Author Date Posted
Extracting nested iterator values Eduardo Lopez 05/28/12 09:14am
Re: Extracting nested iterator values Bill Simpson 05/28/12 7:41pm
Re: Extracting nested iterator values Michael 05/28/12 8:23pm
Re: Extracting nested iterator values yehuda 05/29/12 07:38am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic