Difference between revisions of "TADM2E 2.36"

From Algorithm Wiki
Jump to: navigation, search
(Recovering wiki)
 
Line 1: Line 1:
(n^3) / 8
+
<math>\sum\limits_{i=1}^{n/2} \sum\limits_{j=i}^{n-i} \sum\limits_{k=1}^{j} 1</math>
 +
 
 +
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:32, 13 December 2014

$ \sum\limits_{i=1}^{n/2} \sum\limits_{j=i}^{n-i} \sum\limits_{k=1}^{j} 1 $

The innermost summation is just j since the distance in the progression in 1.

$ \sum\limits_{i=1}^{n/2} \sum\limits_{j=i}^{n-i} j $

For the middle summation we can use Gauss' rule.

$ \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) $

We can rule out the constants.

$ n*\frac{1}{2}*\sum\limits_{i=1}^{n/2} (n - i) $

We can now use the linearity of summations to get simpler ones.

$ n*\frac{1}{2}*[\sum\limits_{i=1}^{n/2} n - \sum\limits_{i=1}^{n/2} i] $

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 $ \frac{n}{2} $.

$ n^{2}*\frac{1}{2}*[\frac{n}{2} - (\frac{n}{2}*(\frac{n}{2} + 1))*\frac{1}{2}] = \frac{n^3}{16} $