Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'It seems really really easy, but I cant' topicStudent Support Forum > General > "It seems really really easy, but I cant"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ha
12/29/05 09:24am

Let f(k)=1/k

To get the list
{f(1),f(1)+f(2),f(1)+f(2)+f(3), ... ,f(1)+f(2)+f(3)+...f(100)}}, Mathematica calculate almost 1+2+3+...+99=4950 times. (Count the number of symbol + used in the list.)

Suppose we calculate this manually. We calculate f(1)+f(2), than we add f(3)to f(1)+f(2), so we get f(1)+f(2)+f(3), then we add f(4) to get f(1)+f(2)+f(3)+f(4)... by doing this, we only calculate 99 times to get the list. This is 50 times faster than the former way.

How can I command mathematica to calculate in the latter way ??

URL: ,

Subject (listing for 'It seems really really easy, but I cant')
Author Date Posted
It seems really really easy, but I cant Ha 12/29/05 09:24am
Re: It seems really really easy, but I cant Alek 12/29/05 2:39pm
Re: It seems really really easy, but I cant yehuda ben-s... 12/30/05 04:38am
Re: It seems really really easy, but I cant david 12/30/05 09:10am
Re: It seems really really easy, but I cant Ha 01/05/06 10:43am
Next Comment >Help | Reply To Topic