A capital Greek sigma is the notation used for a summation statement, also called sigma notation. It looks like this:
Summation statements are powerful tools that let us examine how functions act
In order to use this powerful tool, we must define three things.
- What index to start at
- What index to stop at
- The thing we are iterating through Those things are placed in these respective spots:
Here is an example summation statement that will sum 1, 2, and 3.
We simply substitute our value of into the equation, evaluate it, and then add it to the sum total. We could also evaluate the sum of cubes the numbers 3 and 4.
Summation statements really are that simple!
If you are familiar with for loops in programming languages, then you are already familiar with the concept! This is an example for loop that is the same as summing 1, 2, and 3 together.
sum := 0
for i := 1; i <= 3; i++ {
sum += i
}
return sum