Index Ai Academy
Foundation · Foundation mathNumbers

Powers and roots

About 43 minLooking ahead: some prerequisites aren't done yet

Why this matters

A power is a short way to write repeated multiplying, and a root undoes it. Powers describe how fast things grow: doubling ten times multiplies by about a thousand. In machine learning, errors are squared before they're added up, and the sums inside attention are scaled down by a square root. This lesson builds the three laws of powers from written-out factors, so you can see why they're true instead of memorizing them.

  • Read a power as repeated multiplying, and use the three laws of powers
  • Explain why a⁰ = 1 and a⁻ⁿ = 1/aⁿ, and turn roots into powers
  • Compute powers and roots in Python with ** and math.sqrt, and improve a guess for a square root
  • Work out squared errors and the 1/√d scale used in attention
Quick check
Have a guess before you start. Which is bigger, 2¹⁰ or 10²?

The math: repeated multiplying

Purpose. Multiplying the same number again and again is common enough to get its own short form.

25=2×2×2×2×2=322^5 = 2 \times 2 \times 2 \times 2 \times 2 = 32

In plain words: the big number, 2, is the base. The small raised number, 5, is the exponent: it counts how many 2s are multiplied.

Read 2⁵ as "2 to the power 5". A power of 2 is called squared (side × side for a square) and a power of 3 cubed (side × side × side for a cube). The picture draws both, then shows what each extra factor does.