Friday, May 13, 2011

How would I sum the integers from 1 to 100, or from 1 to n?This is a question for my math homework and this is the only one I have having isues...

To calculate the sum, 1+2+3+4+......+98+99+100.


Let S be the sum of integers from 1 to 100.


Then,


S=1+    2+ 3+  4+ 5+.......+98+99+100. ---(1). Also if you reverse right side you get:


S=100+99+98+97+96....    + 3+ 2+   1-----(2)


Both (1) and (2) have 100 terms each on right side.


Add (1) and (2) vertically, term by term on tright side, we get:


2s=101+101+101+101+101+......101+101+101, There are 100 terms each being 101


Threfore,


2s=101*100


Divide both sides by 2 we get the required sum s:


2s/2 =101*100/2=


s= 101*50=5050.



Part (2): To calculate 1+2+3+4+5+.....(n-4)+.(n-3)+(n-2)+(n-1)+n.


Let s= 1+2+3+4+5+.......(n-2)+(n-1)+n           (1)


There are n terms. Rach term increase by 1 from the previous term. This is an arithmetic progression with a starting term 1 and common difference 1 and the number of terms  being n.


Reverse the right side of (1) as below:


s= n+(n-1)+(n-2)+(n-3)+(n-4)+...3+2+1           (2)


Add (1) and (2), particularly the right side vertically term by term:


2s= (n+1)+(n+1)+(n+1)+(n+1)+(n+1).......(n+1)+(n+1)+(n+1) .   There are n  terms like (n+1), whose sum is (n+1)*n. So,


2s=(n+1)n.


Divide both sides by 2 to get


2s/2=(n+1)n/2  or


s=n(n+1)/2. Therefore,


1+2+3+.....+n = n(n+1)/2

No comments:

Post a Comment