1/16
Loading...
🤔Let's calculate 2^13!
Exponentiation: multiplying a number by itself multiple times 2^13 = 2 × 2 × 2 × ... × 2 (13 times) Naive approach needs 12 multiplications. Is there a faster way?
Loading...
Exponentiation: multiplying a number by itself multiple times 2^13 = 2 × 2 × 2 × ... × 2 (13 times) Naive approach needs 12 multiplications. Is there a faster way?
Fast Exponentiation (Exponentiation by Squaring) computes a^n in O(log n). By halving the exponent and squaring, it's much faster than naive multiplication. Combined with modular arithmetic, it's used in cryptography.