Learn

Short finite summations, or partial sums, are common in computer science. For example, one of the most common uses occurs with loop counters. Here is a Python example:

i = 0 while i < 10: i = i + 1 print(i)

The while loop will not stop unless we sum up the value of “i” and test that value. Please note in this particular example, the symbolism in mathematics looks like this:

i=110k\sum\limits_{i=1}^{10}k

where k = 1. Our while loop test value is nk = 10. Also, notice that the value “10” at the top of the summation symbol tells us we have a finite summation.

With some problems, the value of n may be so gigantic as to be costly to calculate. This condition is often called “uncountably finite.”

Instructions

1.

When you add up the dollars in your wallet, is that a summation?

Set checkpoint_1 to "yes" or "no".

2.

Find the partial sum of:

i=142i\sum\limits_{i=1}^{4}2i

Assign your answer to checkpoint_2 in the code editor.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?