Exponents & Roots
Powers, roots, and exponent rules. Learn x^a × x^b = x^(a+b) and how to simplify expressions.
Lessons
1. Intro
The Goal
2. What Are Exponents?
Repeated multiplication
3. Vocabulary - Base and Exponent
The two parts
4. Small Examples
Building intuition
5. Quiz: Basic Exponents
Knowledge check
6. Exponent of 0
Always equals 1
7. Exponent of 1
Just the base
8. Product Rule
Adding exponents
9. Quotient Rule
Subtracting exponents
10. Power of a Power
Multiplying exponents
11. Quiz: Exponent Rules
Knowledge check
12. Negative Exponents
Reciprocal of positive power
13. Fractional Exponents
Roots in disguise
14. Square Roots
Inverse of squaring
15. Cube Roots and Higher
Generalizing roots
16. Why Learn Exponents?
Practical applications
17. Problem - Power Function
LeetCode 50
18. Power - Naive Approach
Loop n times
19. Power - The Idea
Squaring reduces work
20. Power - Recursion
Breaking down the exponent
21. Power - Implementation
Fast exponentiation
22. Power - Walkthrough
Tracing the algorithm
23. Lessons from Power Function
summary
24. Perfect Squares
Integers with integer roots
25. Problem - Valid Perfect Square
LeetCode 367
26. Perfect Square - Binary Search
Finding the root
27. Perfect Square - Implementation
Binary search solution
28. Lessons from Perfect Square
summary
29. Modular Exponentiation
Computing large powers
30. Problem - Power Modulo
Fast exponentiation with mod
31. Power Modulo - Algorithm
Iterative approach
32. Power Modulo - Implementation
Bit-by-bit squaring
33. Power Modulo - Walkthrough
Tracing the algorithm
34. Lessons from Modular Exponentiation
summary
35. Problem - Count Good Numbers
LeetCode 1922
36. Count Good Numbers - Counting Pattern
Positions alternate
37. Count Good Numbers - Exponent Calculation
Half positions, ceiling trick
38. Count Good Numbers - Implementation
Using modular exponentiation
39. Lessons from Count Good Numbers
summary
40. Problem - Super Pow
LeetCode 372
41. Super Pow - Breaking Down the Exponent
Decomposition trick
42. Super Pow - Modular Exponentiation Rules
Apply modulo properties
43. Super Pow - Implementation
Recursive approach
44. Lessons from Super Pow
summary
45. Common Exponent Values
Powers of 2
46. Exponents in Big-O
Algorithm complexity
47. Exponents and Bit Manipulation
Powers of 2 everywhere
48. Roots and Precision
Floating-point issues
49. Section Recap
What we learned