Math Fundamentals18 sections · 814 units
Open in Course

Lessons from Power Function

summary

Three things to remember:

1.1. Squaring reduces the problem size by half, giving you O(logn)O(\log n) instead of O(n)O(n)

2.2. Odd exponents need one extra multiplication by the base

3.3. Negative exponents flip to reciprocals using the rule xn=1/xnx^{-n} = 1/x^n

This pattern appears in modular exponentiation, matrix exponentiation, and other divide-and-conquer algorithms. Halving the work repeatedly is a powerful trick.