When you want to add up the first 5 square integers (1,4,9,16 and 25) then you might write something like this in Python:
def a(k):
return k^2
def sum_list(l):
sum = 0
for k in [1, 2, 3, 4, 5]:
sum += a(k)
return sum
In math language you would use the ‘sigma notation’* shown in the image below:
The index k is just a way of cycling through a list of k distinct inputs. In this example, the index k starts at 1, ends at 5, and adds together the values a(1), a(2), a(3), a(4) and a(5) to get 1 + 4 + 9 + 16 + 25 = 55.
The function a(k) doesn’t have to explicitly mention the value k. In the board game Seven Wonders, the implied ‘sigma’ here is just to add up the scores for the seven distinct scoring criteria, where the function a(4) would just refer to the value in the fourth row.
Sometimes the symbolic language in math is off-putting and scary until you know what it actually stands for, at which point it becomes pretty tame. I hope that by now the appearance of some sigma notation won’t appear alien to anyone who’s read this.
That’s all for now. If I invoke sigma notation again in future, I’ll be sure to include a link to this primer!
*That’s actually an upper case sigma, for those who don’t know their Greek alphabet.