Powers and roots
Be able to compute with powers, the laws of exponents and square roots.
Practise in Mattegrafen ↗ · Matematik 1cPrerequisites
Everyday explanation
A power is a short way of writing repeated multiplication.
| Part | Name |
|---|---|
| 2 | the base — the number being multiplied |
| 5 | the exponent — how many times |
The square root goes the other way: because .
Why it is worth knowing: powers make it possible to write very large and very small numbers briefly.
| Written as a power | Written out |
|---|---|
| 1 000 000 000 (a billion) | |
| 0.000001 (a millionth) | |
| 1 750 000 000 000 |
A large language model has roughly parameters and is trained on roughly tokens. Writing those numbers out would be unmanageable.
Intuition
The laws of exponents — all of them follow from writing the multiplication out:
| Law | Example | Why |
|---|---|---|
| 3 twos times 4 twos = 7 twos | ||
| two twos cancel | ||
| 3 twos, twice | ||
| and also 1 | ||
| it continues the pattern downwards | ||
The row about surprises many people. Look at the pattern: , , , — every step down halves, so the next one is 1. And then .
Two common errors:
| Wrong | Right |
|---|---|
| — the base does not change | |
The second is one of the most common errors in all school mathematics. Check it with numbers: , but .
Code
import math
print(2 ** 5, math.sqrt(49), 49 ** 0.5) # 32 7.0 7.0
# The laws of exponents, checked numerically
assert 2**3 * 2**4 == 2**7
assert 2**5 / 2**2 == 2**3
assert (2**3) ** 2 == 2**6
assert 7**0 == 1
assert 2**-3 == 1 / 8
assert abs(9 ** 0.5 - math.sqrt(9)) < 1e-12
print("all the laws of exponents hold")
# The pattern that explains a⁰ = 1
for e in range(3, -4, -1):
print(f"2^{e:>2} = {2.0 ** e}")
# 2^ 3 = 8.0
# 2^ 0 = 1.0
# 2^-3 = 0.125
# The classic error — check it with numbers
a, b = 1, 2
print((a + b) ** 2, a**2 + b**2) # 9 5 ← not the same thing!
print((a + b) ** 2, a**2 + 2*a*b + b**2) # 9 9 ← right
# Large and small numbers
print(f"{10**11:,} parameters") # 100,000,000,000
print(f"{1.75e12:,.0f} tokens") # 1,750,000,000,000
print(2 ** 10, 2 ** 20, 2 ** 30) # 1024 1048576 1073741824
# ↑ kilo ↑ mega ↑ giga (in the computers' powers of two)
Mastery means
- Computes with powers and the laws of exponents
- Handles negative exponents and the zero exponent
- Uses square roots and powers of ten
Sign in to do the exercises and build your mastery up.
Sources
- Matteboken (Mattecentrum) — free to read, non-profit association
- Khan Academy — matematik — CC BY-NC-SA 3.0
- The Python documentation (PSF licence) — PSF