Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Summation and its condition
Date: Mon, 16 Feb 2009 11:58:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 38
Message-ID: <gnbkc9$poe$1@fred.mathworks.com>
References: <gnbahb$4id$1@fred.mathworks.com> <gnbftq$m42$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1234785481 26382 172.30.248.38 (16 Feb 2009 11:58:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 16 Feb 2009 11:58:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1715507
Xref: news.mathworks.com comp.soft-sys.matlab:518554

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gnbftq$m42$1@fred.mathworks.com>...
> "akihiro mizutani" <aki.mizutani@gmail.com> wrote in message <gnbahb$4id$1@fred.mathworks.com>...
> > Hello.
> > 
> > I&#8217;ve just started to use matlab.
> > And I&#8217;m stacked in the problem on summation condition.
> > 
> > Now I&#8217;m writing a code to get the result of following summation
> > 
> > Sum[(Aj*Ak-Bj*Bk)(Am*An-Bm*Bn)]
> > 
> > Where An and Bn are arrays respectively and length(An)=length(Bn)=N.
> > And the summation should be carried out only for those combinations of indices j, k, m, n that satisfy following conditions;
> > 
> > J+k=m+n, j<k, m<n, j<m.
> > 
> > At this, the indices may take any integer value but from 1 to N only.
> > 
> > Does anyone know how to define such conditions and carry out the summation for all combinations which satisfy the conditions?
> > I would be grateful if someone gave me a tip for solving the problem.
> 
> If N is at all large, this will be difficult. It
> involves O(N^4) terms in the combinatorial
> sum, at least if I did my arithmetic correctly.
> 
> So how large is N?
> 
> John

Thank you very much for a kind reply.
The number of N is up to 2024.

Even if it is difficult to solve the problem with such a big number, N,
I would be grateful if you show me your idea!

Thanks a lot.

Akihiro