What is Dynamic Programming?

In this lesson, we will learn the ideology behind dynamic programming.

Chances are you’ve seen the following quote espoused to dynamic programming before:

Those who cannot remember the past are condemned to repeat it

~ George Santayana

Why do we need to remember the past?

Let’s do a small exercise and see what it evaluates too.

x = 2*2*2*2*2*2*2

Now evaluate the following equation.

x = x*2

You had to count all the 2s in the first equation, which took some time. But you were able to evaluate the second one much quicker because you remembered ...