Difference between revisions of "TADM2E 2.36"

From Algorithm Wiki
Jump to: navigation, search
(Undo revision 250 by Mardurhack (talk))
Line 1: Line 1:
<math>\sum\limits_{i=1}^{n/2} \sum\limits_{j=i}^{n-i} \sum\limits_{k=1}^{j} 1</math>
+
(n^3) / 8
 
 
The innermost summation is just j since the distance in the progression in 1.
 
 
 
<math>\sum\limits_{i=1}^{n/2} \sum\limits_{j=i}^{n-i} j</math>
 
 
 
For the middle summation we can use Gauss' rule.
 
 
 
<math>\sum\limits_{i=1}^{n/2} \frac{1}{2} * (n - i) * (n - i + i) = \sum\limits_{i=1}^{n/2} \frac{1}{2} * (n - i) * (n)</math>
 
 
 
We can rule out the constants.
 
 
 
<math>n*\frac{1}{2}*\sum\limits_{i=1}^{n/2} (n - i)</math>
 
 
 
We can now use the linearity of summations to get simpler ones.
 
 
 
<math>n*\frac{1}{2}*[\sum\limits_{i=1}^{n/2} n - \sum\limits_{i=1}^{n/2} i]</math>
 
 
 
In the first summation n is just a constant so we can bring it outside and the for the second summation we use, once again, Gauss' rule. The first summation turns into <math>\frac{n}{2}</math>.
 
 
 
<math>n^{2}*\frac{1}{2}*[\frac{n}{2} - (\frac{n}{2}*(\frac{n}{2} + 1))*\frac{1}{2}] = \frac{n^3}{16}</math>
 

Revision as of 00:35, 13 December 2014

(n^3) / 8