TADM2E 2.35

From Algorithm Wiki
Revision as of 18:24, 11 September 2014 by Algowikiadmin (talk | contribs) (Recovering wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1. Summations:

  for i=1 to n do
    for j=i to 2*i do
       output foobar

$ \begin{align} &T(n)=\sum_{i=1}^{n}\sum_{j=i}^{2*i}1\\ \end{align} $


2. Simplification:

$ \begin{align} &T(n)=\sum_{i=1}^{n}\sum_{j=i}^{2*i}1=\sum_{i=1}^{n}(2i-i+1)= \sum_{i=1}^{n}(i+1)=\frac{n(n+1)}{2}+n \end{align} $