Sub topic 3
What an Exponent Means
Assume you can add, subtract, multiply, and divide integers and fractions. This chapter introduces exponents so you can read and simplify expressions before applying the full order of operations.
Repeated multiplication
An exponent tells you how many times to use a number as a factor. In the expression a^n, a is the base, and n is the exponent or power.
For a positive whole-number exponent:
a^n = a × a × ... × aThe base appears as a factor n times. For example:
3^4 = 3 × 3 × 3 × 3 = 81The expression 3^4 does not mean 3 × 4. The exponent counts factors; it is not itself a factor.
| Expression | Expanded form | Value |
|---|---|---|
| `5^2` | `5 × 5` | 25 |
| `2^3` | `2 × 2 × 2` | 8 |
| `(-2)^3` | `(-2) × (-2) × (-2)` | -8 |
An even number of negative factors produces a positive result. An odd number produces a negative result.
Exponents and the order of operations
Exponentiation has higher precedence than multiplication, division, addition, and subtraction. Precedence is the rule that determines which operation is performed first.
print(2 + 3 * 4 ** 2) # 50
print((2 + 3) * 4 ** 2) # 80In the first expression, calculate 4 ** 2 first:
4 ** 2 = 163 * 16 = 482 + 48 = 50
Parentheses can change the grouping. In the second expression, calculate 2 + 3 first.
Exponents with fractions
A fraction can be the base of a power. Parentheses make the base clear:
(2/3)^2 = (2/3) × (2/3) = 4/9Both the numerator and denominator are squared. In general:
(a/b)^n = a^n / b^nThis rule applies when b is not zero.
Zero and negative exponents
For every nonzero base:
a^0 = 1For a negative integer exponent, take the reciprocal:
a^(-n) = 1/a^nFor example:
from fractions import Fraction
print(5 ** 0) # 1
print(Fraction(2, 3) ** -2) # 9/4The second result follows this sequence:
(2/3)^(-2) = 1/(2/3)^2 = 1/(4/9) = 9/4Exercise
Evaluate (-3)^2 and (-3)^3. Explain why their signs differ.
Show answer
(-3)^2 = 9 because two negative factors make a positive result. (-3)^3 = -27 because three negative factors make a negative result.