Re: Multiple sum with iterators that cannot equal
- To: mathgroup at smc.vnet.net
- Subject: [mg19590] Re: Multiple sum with iterators that cannot equal
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 4 Sep 1999 01:34:26 -0400
- Organization: University of Western Australia
- References: <7pl714$cgd@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Eric Spahr wrote: > Using multiple summmation signs with condition 'i "not > equal" j', evaluation stops immediately as 'i' starts as > 1 as does 'j'. My formula requires that the 'i's' and > 'j's' together: > > Sum[Sum[f,{j,1,n}],{i,1,n}] ignore cases where i = j. > > Or as copied from my notebook: > > \!\(\(\(\[Sum]\+\(i = 1\)\%n\[Sum]\+\(j = 1\)\%n\)\+\(i > != j\)\) \(w\_i\) > w\_j\) > > How do I solve this without some cumbersome loops. Two suggestions: [1] If there is no singularity if i==j then you could use \!\(\[Sum]\+\(i = 1\)\%n\(\[Sum]\+\(j = 1\)\%n w\_i\ w\_j\) - \[Sum]\+\(i = 1\)\%n w\_i\%2\) [2] Alternatively, \!\(\[Sum]\+\(i = 1\)\%n w\_i\ \((\[Sum]\+\(j = 1\)\%\(i - 1\)w\_j + \[Sum]\+\(j = i + \ 1\)\%n w\_j)\)\) ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________
- Follow-Ups:
- Re: Re: Multiple sum with iterators that cannot equal
- From: Eric Spahr <rspahr@worldnet.att.net>
- Re: Re: Multiple sum with iterators that cannot equal