MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Sum problem

  • To: mathgroup at
  • Subject: [mg65285] Sum problem
  • From: Majka Arkadiusz <Arkadiusz.Majka at>
  • Date: Fri, 24 Mar 2006 00:59:42 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hi ,

I have a problem that drives me crazy. In order to sum a (long) list of
elements (random numbers), say tab

tab = Table[Random[], {10^7}];

we use 



....but to check Sum we get


Part specification K$30 is neither an 
    integer nor a list of integers.

There is no problem for 

Sum[tab[[i]], {i, 1, 10^6}]

...and for

Sum[tab[[i]], {i, 1, 5*10^6}]

So Sum is ok. for number of elements of tab less than certain number that is
< Length[tab]

I also tested recursion methods (doSum[k_]:=doSum[k]=doSum[k-1] ...... Etc)
and got the same : fine but not for many elements (of course I set
$RecursiveLimit and $IterationLimit as Infinity)

I understand that to sum a list of elements we use Plus, Total  etc but
nevertheless I want understand what I explained above.



  • Prev by Date: Re: How to sample a 2-dim. r.v. with known density function?
  • Next by Date: Re: Re: A question concerning Show and PlotLegend
  • Previous by thread: Re: Plot equations and inequalities together
  • Next by thread: Re: Sum problem