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(log⁡n)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 x−n=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.