# That programming book you never finished Arik Originally published at creactiviti.com ・3 min read Tell me if this sounds familiar:

You walk into a bookstore, browse through some shelves and run into a programming book about a subject you always wanted to learn. Maybe it was about machine learning or algorithms or some other cool technology.

You read the back cover, the intro and you get really psyched. You think to yourself: "I think I can really get this". And, "when I'm done with this book I'm gonna have super powers" and "I'm gonna show the guys at work what a rock star I am" etc.

You get home, open the book that is about to change your life and 20 pages into it you're starting to fall asleep after seeing one too many mathy squiggly thingies.

Then you start thinking some other thoughts, such as "oh, not math again!" And "I'll never get this, I suck at math!" And "I guess I'm just stupid" and other such nonsense.

If I had a dollar for every time...anyway.

So I'm here to tell you that math has a dirty little secret that will help you get through these books: mathematicians like to use big scary words and symbols to describe small and simple concepts.

Let's look at an example. Chances are you ran into the scary looking Sigma symbol: I don't know if it's because it's big or because it looks like Egyptian hieroglyphs, but something about that symbol freaked me out the first time I saw it. But it turns out that it's almost idiotically simple.

Sigma simply means "sum up" or "add up". What do you sum up? The thing on the right (i*2 in this case). And you do that starting at the number below the Sigma (i=1 here) until the last number designated above the Sigma (100 here).

So this particular Sigma equals to:

1 * 2 + 2 * 2 + 3 * 2 ... + 100 * 2 = 10100


So the easiest way for me to think about Sigma is to think of it as a for loop, where the lower boundary of the loop is specified under the Sigma and the upper boundary of the loop is specified above the Sigma. Here's how it would look like in python:

def sum(i):
s = 0
for n in range(1,i+1):
s = s + (n*2)
return s


I know, it's almost disappointingly simple.

This may sound like over-simplifying the situation. That some math concepts are just impenetrable and beyond mere mortals grasp. Well if that's the case then I haven't ran into it yet.

On the other hand, this is not a "get math quick" scheme either. To understand these math concepts you'll sometimes have to drill in to other concepts that the original concept builds on — recursively. This can take hours, days or more to accomplish, depending on the concept.

But the point is the same. It's just fancy words and symbols. And as long as you keep going down that rabbit hole using dictionaries, tutorials, videos, whatever you can get your hands on, to define these words and symbols, you'll eventually get it. Try it sometimes.

Happy learning.

Posted on by: ### Arik

Got into computers back in the 80s and became so in love with programming that I remember wondering as a kid (and still today, really) how come not everybody wants to be a programmer.

### Discussion Based on the opening, I was looking for strategies on finishing books.

Yes.

I was expecting the same U_u

Me too

Try reducing computation by finding a closed form instead of writing a loop. Here, the closed form is f(n) = n*(n+1) (e.g. f(100) = 100*101 = 10100):

f(n) = S[1..n] 2*i     definition
= 2 * S[1..n] i   pull out the coefficient
= 2 * n*(n+1)/2   by triangular number formula
= n*(n+1)         cancel the twos


Personally I would think the following is the exact translation in Python of the math formula shown in the article:

  sum(2*i for i in range(1, 101))


(well... if you ignore the fact that the upper limit of range in not inclusive so I need to put 101 instead of 100)

So now that you know about Sigmas etc. you can read The Art of Computer Programming ;-)

Not the topic I expected, bit was a nice read anyway.

Mathematical Notation: A Guide for Engineers and Scientists
I bought this little jewel just for this situation:
amazon.com/Mathematical-Notation-G...

*Greek…

I 💖 Math.

I recommend this site brilliant.org for math and science stuff :)

github.com/Jam3/math-as-code is a "cheatsheet" explaining tons of math notation by showing equivalent JavaScript code, similar to how this article explained Σ.

Misleading headline. But now high school math is coming back to me...

The rabbit hole in question.

mathworld.wolfram.com

I'm surprised they're not teaching this in school anymore.  