Re: asking suggestions on the algorithm in compution.Thanks.

From: Rod (RodRodRodRod_at_Hotmail.com)
Date: 10/29/04


Date: Fri, 29 Oct 2004 08:13:36 GMT

Are there things about a(i) you have not told us, like being a +ve integer
or whatever?

"ZHANG Yan" <buaanupt@sina.com> wrote in message
news:9e847e5e.0410282003.2744438a@posting.google.com...
> Suppose that an integer k varies between 1 to 10000.
>
> There are an array variable a[1], a[2] ... a[k], so the size of the
> array depends on k. and the summary of a[i] (i=1,2...k) is equal to
> 10000-k. That is,
> SUM(i=1..k) a(i)=10000-k
>
> Now, there are k functions f_i,(i=1,2...,k). And, the input for
> function f_i is a[i].
>
> I have to compute the following expression:
>
> X = 0;
> for(k=1..10000)
> for each a[i] (i=1,2...k) satisfying a[1]+a[2]+...a[k]=10000-k
> X=X+ f_1(a[1]) * f_2(a[2]) * ...f_k(a[k])
> end
> end
>
>
> I found that it is almost impossible to compute this due to the large
> number of possible combinations in a[i] satisfying
> "a[1]+a[2]+...a[k]=10000-k".
>
> Can you please give some suggestions on how to compute this?Any
> comments are greatly appreciated. Thanks in advance.
>
> --
> Best Regards
> Y.ZHANG
> http://www.ntu.edu.sg/home5/pg01308021/