Comments

Thank you!

Why is the cost of the 4th iteration not $$$1 + 2 \times 2 + 8$$$?

I guess there are some typos after the sentence

will then be equal to our new value

Those $$$p_j$$$ here should be $$$p_i$$$