Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Summation

Summation

Overview
Summation is the addition
Addition
Addition is the mathematical process of combining quantities. It is signified by the plus sign . For example, in the picture on the right, there are 3 + 2 apples—meaning three apples and two other apples—which is the same as five apples. Therefore, 3 + 2 = 5...

 of a set of numbers; the result is their sum or total. An interim
Interim
Interim is an album by British rock band The Fall, compiled from live and studio material and released in 2004. It features the first officially released versions of "Clasp Hands", "Blindness" and "What About Us?" — all of which were later included on the band's next studio album Fall Heads Roll —...

 or present total of a summation process is termed the running total. The "numbers" to be summed may be natural number
Natural number
In mathematics, there are two conventions for the set of natural numbers: it is either the set of positive integers {, , , ...} according to the traditional definition or the set of non-negative integers {, 1, 2, ...} according to...

s, complex number
Complex number
A complex number, in mathematics, is a number comprising a real number and an imaginary number; it can be written in the form a + bi, where a and b are real numbers, and i is the standard imaginary unit, having the property that i2 = −1...

s, matrices
Matrix (mathematics)
In mathematics, a matrix is a rectangular array of numbers, such asEntries of a matrix are often denoted by a variable with two subscripts, as shown on the right. Matrices of the same size can be added and subtracted entrywise and matrices of compatible size can be multiplied...

, or still more complicated objects. An infinite sum is a subtle procedure known as a series
Series (mathematics)
In mathematics, given an infinite sequence of numbers { an }, a series is informally the result of adding all those terms together: a1 + a2 + a3 + · · ·. These can be written more compactly using the...

. Note that the term summation has a special meaning in the context of divergent series
Divergent series
In mathematics, a divergent series is an infinite series that is not convergent, meaning that the infinite sequence of the partial sums of the series does not have a limit....

 related to extrapolation
Extrapolation
In mathematics, extrapolation is the process of constructing new data points outside a discrete set of known data points. It is similar to the process of interpolation, which constructs new points between known points, but the results of extrapolations are often less meaningful, and are subject to...

.

The summation of 1, 2, and 4 is 1 + 2 + 4 = 7.
Discussion
Ask a question about 'Summation'
Start a new discussion about 'Summation'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
Summation is the addition
Addition
Addition is the mathematical process of combining quantities. It is signified by the plus sign . For example, in the picture on the right, there are 3 + 2 apples—meaning three apples and two other apples—which is the same as five apples. Therefore, 3 + 2 = 5...

 of a set of numbers; the result is their sum or total. An interim
Interim
Interim is an album by British rock band The Fall, compiled from live and studio material and released in 2004. It features the first officially released versions of "Clasp Hands", "Blindness" and "What About Us?" — all of which were later included on the band's next studio album Fall Heads Roll —...

 or present total of a summation process is termed the running total. The "numbers" to be summed may be natural number
Natural number
In mathematics, there are two conventions for the set of natural numbers: it is either the set of positive integers {, , , ...} according to the traditional definition or the set of non-negative integers {, 1, 2, ...} according to...

s, complex number
Complex number
A complex number, in mathematics, is a number comprising a real number and an imaginary number; it can be written in the form a + bi, where a and b are real numbers, and i is the standard imaginary unit, having the property that i2 = −1...

s, matrices
Matrix (mathematics)
In mathematics, a matrix is a rectangular array of numbers, such asEntries of a matrix are often denoted by a variable with two subscripts, as shown on the right. Matrices of the same size can be added and subtracted entrywise and matrices of compatible size can be multiplied...

, or still more complicated objects. An infinite sum is a subtle procedure known as a series
Series (mathematics)
In mathematics, given an infinite sequence of numbers { an }, a series is informally the result of adding all those terms together: a1 + a2 + a3 + · · ·. These can be written more compactly using the...

. Note that the term summation has a special meaning in the context of divergent series
Divergent series
In mathematics, a divergent series is an infinite series that is not convergent, meaning that the infinite sequence of the partial sums of the series does not have a limit....

 related to extrapolation
Extrapolation
In mathematics, extrapolation is the process of constructing new data points outside a discrete set of known data points. It is similar to the process of interpolation, which constructs new points between known points, but the results of extrapolations are often less meaningful, and are subject to...

.

Notation


The summation of 1, 2, and 4 is 1 + 2 + 4 = 7. The sum is 7. Since addition is associative, it does not matter whether we interpret "1 + 2 + 4" as (1 + 2) + 4 or as 1 + (2 + 4); the result is the same, so parentheses are usually omitted in a sum. Finite addition is also commutative, so the order in which the numbers are written does not affect its sum. (For issues with infinite summation, see absolute convergence
Absolute convergence
In mathematics, a series of numbers is said to converge absolutely if the sum of the absolute value of the summand or integrand is finite....

.)

If a sum has too many terms to be written out individually, the sum may be written with an ellipsis
Ellipsis
Ellipsis is a mark or series of marks that usually indicate an intentional omission of a word or a phrase from the original text. An ellipsis can also be used to indicate a pause in speech, an unfinished thought, or, at the end of a sentence, a trailing off into silence...

 to mark out the missing terms.
Thus, the sum of all the natural numbers from 1 to 100 is 1 + 2 + ... + 99 + 100 = 5050. This sum can be achieved using the formula for an arithmetic sequence, where a is the first term (1), d is the common difference (1) and n is the number to which the sequence is summed (100).

Capital-sigma notation


Mathematical notation has a special representation for compactly representing summation of many similar terms: the summation symbol ∑ (U+2211), a large upright capital Sigma. This is defined thus:

The subscript gives the symbol for an index variable
Index (mathematics)
The word index is used in variety of senses in mathematics.* In perhaps the most frequent sense, an index is a superscript or subscript to a symbol. Superscript indices are often, but not always, used to indicate powers. Subscript indices are usually used to identify an element of a set or array...

, i. Here, i represents the index of summation; m is the lower bound of summation, and n is the upper bound of summation. Here i = m under the summation symbol means that the index i starts out equal to m. Successive values of i are found by adding 1 to the previous value of i, stopping when i = n. An example:.

Informal writing sometimes omits the definition of the index and bounds of summation when these are clear from context, as in.

One often sees generalizations of this notation in which an arbitrary logical condition is supplied, and the sum is intended to be taken over all values satisfying the condition. For example:
is the sum of f(k) over all (integer) k in the specified range,
is the sum of f(x) over all elements x in the set S, and
is the sum of μ(d) over all integers d dividing n.

There are also ways to generalize the use of many sigma signs. For example,
is the same as

A similar notation is applied when it comes to finding multiplicative products
Product (mathematics)
In the a mathematics, a product is the result of multiplying, or an expression that identifies factors to be multiplied. The order in real or complex numbers are multiplied has no bearing on the product; this is known as the commutative law of multiplication...

; the same basic structure is used, with ∏, or the capital pi
Pi (letter)
Pi is the sixteenth letter of the Greek alphabet, representing . In the system of Greek numerals it has a value of 80...

, replacing the ∑.

Programming language notation


Summations can also be represented in a programming language
Programming language
A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine, to express algorithms precisely, or as a mode of human...

.
Some languages use a notation for summation similar to the mathematical one. For example, this is Python
Python (programming language)
Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

:

sum(x[m:n+1])

and this is the Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall, a linguist working as a systems administrator for NASA, in 1987, as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone...

 equivalent of the above Python:

use List::Util 'sum';
sum($m..$n);

and this is Fortran
Fortran
Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

 (or MATLAB
MATLAB
MATLAB is a numerical computing environment and fourth generation programming language. Developed by The MathWorks, MATLAB allows matrix manipulation, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs in other languages...

):

sum(x(m:n))


and this is J
J (programming language)
The J programming language, developed in the early 1990s by Ken Iverson and Roger Hui, is a synthesis of APL and the FP and FL function-level languages created by John Backus....

:
+/x

and this is Haskell:

sum

and this is Scheme
Scheme programming language
Scheme is one of the two main dialects of the programming language Lisp. Unlike Common Lisp, the other main dialect, Scheme follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension...

:

(apply + x)

In other languages loops are used, as in the following Visual Basic
Visual Basic
Visual Basic is the third-generation event-driven programming language and integrated development environment ' from Microsoft for its COM programming model...

/VBScript
VBScript
VBScript is an Active Scripting language, developed by Microsoft, which uses the Component Object Model to access elements of the environment within which it is running...

 program
Computer program
Computer programs are instructions for a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions...

:

Sum = 0
For I = M To N
Sum = Sum + X(I)
Next I

or the following C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

/C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features...

/C#/Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 code, which assumes that the variables m and n are defined as integer types no wider than int, such that m ≤ n, and that the variable x is defined as an array of values of integer type no wider than int, containing at least m − n + 1 defined elements:

int i;
int sum = 0;
for (i = m; i <= n; i++) {
sum += x[i];
}


In some cases a loop can be written more concisely, as in this Perl code:

$sum += $x[$_] for ($m..$n);

or these alternative Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto...

 expressions:

x[m..n].inject{|a,b| a+b}
x[m..n].inject(0){|a,b| a+b}

or in C++, using its standard library:

std::accumulate(&x[m], &x[n + 1], 0)

when x is a built-in array or a std::vector.

Note that most of these examples begin by initializing the sum variable to 0, the identity element
Identity element
In mathematics, an identity element is a special type of element of a set with respect to a binary operation on that set. It leaves other elements unchanged when combined with them...

 for addition. (See "special cases" below).

Also note that the traditional ∑ notation allows for the upper bound to be less than the lower bound. In this case, the index variable is initialized with the upper bound instead of the lower bound, and it is decremented instead of incremented. Since addition is commutative, this might also be accomplished by swapping the upper and lower bound and incrementing in a positive direction as usual.

Also note that the ∑ notation evaluates to a definite value, while most of the loop constructs used above are only valid in an imperative programming language's statement context, requiring the use of an extra variable to hold the final value. It is the variable which would then be used in a larger expression.

The exact meaning of ∑, and therefore its translation into a programming language, changes depending on the data type of the subscript and upper bound. In other words, ∑ is an overloaded symbol
Overloaded expression
In computer science, especially the languages Ada and C++, overloaded expression means that an ambiguous operator expression can only be understood based on the context: see overloading....

.

In the above examples, the subscript of ∑ was translated into an assignment statement to an index variable at the beginning of a for loop. But the subscript is not always an assignment statement. Sometimes the subscript sets up the iterator for a foreach loop, and sometimes the subscript is itself an array, with no index variable or iterator provided. Other times, the subscript is merely a Boolean
Boolean
Boolean , as a noun or an adjective, may refer to:* Boolean algebra , a logical calculus of truth values or set membership* Boolean algebra , a set with operations resembling logical ones...

 expression that contains an embedded variable, implying to a human, but not to a computer, that every value of the value should be used where the Boolean expression evaluates to true.

In the example below:
is an iterator, which implies a foreach loop, but is a set, which is an array-like data structure that can store values of mixed type. The summation routine for a set would have to account for the fact that it is possible to store non-numerical data in a set.

The return value of ∑ is a scalar
Scalar (computing)
In computing, a scalar is a variable or field that can hold only one value at a time; as opposed to composite variables like array, list, record, etc. In some contexts, a scalar value may be understood to be numeric. A scalar data type is the type of a scalar variable...

 in all examples given above.

Special cases


It is possible to sum fewer than 2 numbers:
  • If one sums the single term x, then the sum is x.
  • If one sums zero terms, then the sum is zero
    0 (number)
    0 is both a number and the numerical digit used to represent that number in numerals. It plays a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures. As a digit, zero is used as a placeholder in place value systems...

    , because zero is the identity
    Identity element
    In mathematics, an identity element is a special type of element of a set with respect to a binary operation on that set. It leaves other elements unchanged when combined with them...

     for addition. This is known as the empty sum
    Empty sum
    In mathematics, the empty sum, or nullary sum, is the result of adding no numbers, in summation for example. Its numerical value is zero.This fact is especially useful and helpful in discrete mathematics and algebra....

    .


These degenerate cases are usually only used when the summation notation gives a degenerate result in a special case.
For example, if m = n in the definition above, then there is only one term in the sum; if m > n, then there is none.

Approximation by definite integrals


Many such approximations can be obtained by the following connection between sums and integral
Integral
Integration is an important concept in mathematics which, together with differentiation, forms one of the main operations in calculus. Given a function ƒ of a real variable x and an interval [a, b] of the real line, the definite integralis defined informally...

s, which holds for any:

increasing
Monotonic function
In mathematics, a monotonic function is a function which preserves the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order theory....

 function f:
decreasing
Monotonic function
In mathematics, a monotonic function is a function which preserves the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order theory....

 function f:
For more general approximations, see the Euler–Maclaurin formula.

For functions that are integrable
Riemann integral
In the branch of mathematics known as real analysis, the Riemann integral, created by Bernhard Riemann, was the first rigorous definition of the integral of a function on an interval. While the Riemann integral is unsuitable for many theoretical purposes, it is one of the easiest integrals to define...

 on the interval [a, b], the Riemann sum
Riemann sum
In mathematics, a Riemann sum is a method for approximating the total area underneath a curve on a graph, otherwise known as an integral. It mayalso be used to define the integration operation...

 can be used as an approximation of the definite integral. For example, the following formula is the left Riemann sum with equal partitioning of the interval:
The accuracy of such an approximation increases with the number n of subintervals, such that:

Identities


The following are useful identities:
, where 'C' is a distributed constant. (See Scalar multiplication
Scalar multiplication
In mathematics, scalar multiplication is one of the basic operations defining a vector space in linear algebra . In an intuitive geometrical context, scalar multiplication of a real Euclidean vector by a positive real number multiplies the magnitude of the vector without changing its direction...

)

, where 'C' is a constant.









, definition of multiplication where n is an integer multiplier to x

(See Harmonic number
Harmonic number
In mathematics, the n-th harmonic number is the sum of the reciprocals of the first n natural numbers:This also equals n times the inverse of the harmonic mean of these natural numbers....

)
(see arithmetic series)

(Special case of the arithmetic series)









where is the kth Bernoulli number
Bernoulli number
In mathematics, the Bernoulli numbers are a sequence of rational numbers with deep connections to number theory. They are closely related to the values of the Riemann zeta function at negative integers....

.


(see geometric series
Geometric series
In mathematics, a geometric series is a series with a constant ratio between successive terms. For example, the seriesis geometric, because each term except the first can be obtained by multiplying the previous term by ....

)

(special case of the above where m = 0)










(see binomial coefficient
Binomial coefficient
In mathematics, the binomial coefficient is the coefficient of the x k term in the polynomial expansion of the binomial power  n....

)


















(See Product of a series)



(See Infinite limits)

, for binomial expansion










Growth rates


The following are useful approximation
Approximation
An approximation is an inexact representation of something that is still close enough to be useful. Although approximation is most often applied to numbers, it is also frequently applied to such things as mathematical functions, shapes, and physical laws.Approximations may be used because...

s (using theta notation
Big O notation
In mathematics, computer science, and related fields, big O notation describes the limiting behavior of a function when the argument tends towards a particular value or infinity, usually in terms of simpler functions...

):

for real c greater than −1

(See Harmonic number
Harmonic number
In mathematics, the n-th harmonic number is the sum of the reciprocals of the first n natural numbers:This also equals n times the inverse of the harmonic mean of these natural numbers....

)

for real c greater than 1

for nonnegative
Negative and non-negative numbers
Being negative or non-negative is a property of a number which is real, or a member of a subset of real numbers such as rational and integer numbers. A negative number is one that is less than zero, such as −, -1.414, -1. A positive number is one that is greater than zero, such as , 1.414, 1...

 real c

for nonnegative real c, d

for nonnegative real b > 1, c, d


See also

  • Einstein notation
    Einstein notation
    In mathematics, especially in applications of linear algebra to physics, the Einstein notation or Einstein summation convention is a notational convention useful when dealing with coordinate formulas...

  • Checksum
    Checksum
    A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. The integrity of the data can be checked at any later time by recomputing the checksum and...

  • Product (mathematics)
    Product (mathematics)
    In the a mathematics, a product is the result of multiplying, or an expression that identifies factors to be multiplied. The order in real or complex numbers are multiplied has no bearing on the product; this is known as the commutative law of multiplication...

  • Kahan summation algorithm
    Kahan summation algorithm
    In numerical analysis, the Kahan summation algorithm significantly reduces the numerical error in the total obtained by adding a sequence of finite precision floating point numbers, compared to the obvious approach...

  • Iterated binary operation
    Iterated binary operation
    In mathematics, an iterated binary operation is an extension of a binary operation on a set S to a function on finite sequences of elements of S through repeated application. Common examples include the extension of the addition operation to the summation operation, and the extension of the...


Further reading


External links