Welcome to our community

Be a part of something great, join today!

MathJax to write summation decreasing index

kaliprasad

Well-known member
Mar 31, 2013
1,259
Bangalore india
how to write a summation with decreasing index

say for adding from index 1 to n for $x_k$ we write $\sum^{n}_{k=1}x_k$.

how do we write the above for index to go from n to 1 down wards
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
8,597
Leiden
Mathematically they are identical, aren't they?
$k$ really iterates over a set of elements, which is unordered.
So there wouldn't be a separate mathematical notation for it.

Improvising, we might write:
$$\sum^{1}_{k=n}x_k$$
or:
$$\sum_{k=n,...,1}x_k$$
or:
$$\left|\begin{array}{}
s \leftarrow 0 \\
\text{for }k\leftarrow n \text{ downto } 1 \\
\quad s \leftarrow s + x_k \\
s
\end{array}\right.$$
 

MarkFL

Pessimist Singularitarian
Staff member
Feb 24, 2012
13,634
St. Augustine, FL.
You could also write:

\(\displaystyle \sum_{k=1}^n x_{n-k+1}\)