Summation is the operation of adding a sequence of numbers; the result is their sum or total.
Often mathematical formulae require the addition of many variables. Summation or sigma notation is a convenient and simple form of shorthand used to give a concise expression for a sum of the values of a variable. A summation is simply the act or process of adding.
Examples of summations:
Write a summation that represents the value of a variable.
Download PDFSummations and algorithm analysis of programs with loops goes hand in hand. You can use summations to figure out your program or functions runtime. There are some particularly important summations, which you should probably commit to memory (or at least remember their asymptotic growth rates). For example:The summation from i=1 to n of i = n(n+1) / 2 ==> Θ(n2)
Download PDF/* C Program for a simple summation */ # include <stdio.h> int main(void) { int n = 5, sum = 0, sum2; int i; // A summation can be written as a for loop. Here the loop represents a summation from i=1 to n. for( i=1; i<=n; i++) sum += i; // You can also use the formula to give an answer for sum. sum2 = n * (n + 1) / 2; printf("sum = %d, and sum2 = %d, they are the same number\n", sum, sum2); //Comment out the system("pause") if you are not using Windows system("pause"); }