Contents
Deep Breakdown
What it tells me (Situation Awareness): When a product of two (or more) factors is raised to a power, you can distribute the exponent across each factor. . This is how exponentiation distributes over multiplication — the same way multiplication distributes over addition. It comes up when working with compound rates (e.g., total rate = rate_A × rate_B, then raise both to a power), scaling transformations in feature engineering, and simplifying expressions in log-space.
Flowchart
Real-world use
Where it is used
Decomposing compound probability expressions, distributing scale factors in transformations, and simplifying expressions where a product is repeatedly squared or cubed (e.g., in Mahalanobis distance or covariance matrix scaling).
Problem it solves
Without this rule, computing for large requires expanding the full product. The rule lets you compute and independently and multiply — useful when and are each simpler to evaluate alone.
How it solves the problem
By rearranging multiplication (which is associative and commutative): .
Example in a business
An e-commerce revenue model: daily revenue = price × volume. If both price and volume grow by factor per month, after months total revenue scales as . Using the power-of-a-product rule: — you can audit each factor's contribution separately before combining.
The formula, piece by piece
- : first factor in the product
- : second factor in the product
- : the exponent applied to the entire product
- : the product raised to power
- : each factor raised to power individually
- Generalizes: for any number of factors Full rule: for any real , , and
The formula in words
"If you raise a product to a power, you can raise each factor to that power separately and then multiply." Verify directly: . Same result.
Critical Concepts
- Only distributes over multiplication, not addition. . This is one of the most common algebra errors. The binomial theorem handles .
- Works for any number of factors: .
- Works for negative and fractional exponents: .
- Inverse direction: — you can collapse separate powers into one combined base when exponents match.
- Useful for standardization: scaling a vector by scalar — comes from this rule.
Step-by-step calculation (tiny example)
Step 1: Identify the product and the exponent Expression: . Product = , exponent = .
Step 2: Distribute the exponent to each factor .
Step 3: Evaluate and verify , , product . Direct check: . Confirmed.
Code examples
Beginner example (Python)
# Power of a product: (a*b)^m = a^m * b^m
a = 2
b = 3
m = 4
result_product_first = (a * b) ** m # compute product, then power
result_distribute = (a**m) * (b**m) # distribute exponent first
print(f"a={a}, b={b}, m={m}")
print(f"(a*b)^m = ({a}*{b})^{m} = {result_product_first}")
print(f"a^m * b^m = {a}^{m} * {b}^{m} = {a**m} * {b**m} = {result_distribute}")
print(f"Match: {result_product_first == result_distribute}") # Common mistake demo: (a+b)^m != a^m + b^m
print(f"\nCommon mistake: (a+b)^m vs a^m + b^m")
print(f" ({a}+{b})^{m} = {(a+b)**m}")
print(f" {a}^{m} + {b}^{m} = {a**m + b**m} <-- WRONG, not the same!")Beginner example (R)
# Power of a product: (a*b)^m = a^m * b^m
a <- 2
b <- 3
m <- 4
result_product_first <- (a * b)^m
result_distribute <- (a^m) * (b^m)
cat(sprintf("a=%d, b=%d, m=%d\n", a, b, m))
cat(sprintf("(a*b)^m = (%d*%d)^%d = %d\n", a, b, m, result_product_first))
cat(sprintf("a^m * b^m = %d^%d * %d^%d = %d\n", a, m, b, m, result_distribute))
cat(sprintf("Match: %s\n", result_product_first == result_distribute))
cat(sprintf("\nCommon mistake: (%d+%d)^%d = %d vs %d^%d + %d^%d = %d (not equal!)\n", a, b, m, (a+b)^m, a, m, b, m, a^m + b^m))Professional example (Python)
import numpy as np
import pandas as pd
# Scenario: L2 norm scaling — how norm changes when features are scaled
# || c * x ||^2 = c^2 * || x ||^2 (power of a product rule)
np.random.seed(42)
FEATURE_DIM = 5
num_samples = 100
X = np.random.randn(num_samples, FEATURE_DIM) # raw feature matrix
scales = [0.5, 1.0, 2.0, 5.0, 10.0]
results = []
for c in scales:
X_scaled = c * X
norm_sq_direct = np.sum((X_scaled)**2, axis=1).mean() # ||c*x||^2
norm_sq_rule = (c**2) * np.sum(X**2, axis=1).mean() # c^2 * ||x||^2
results.append({
"scale_c": c,
"norm_sq_direct": norm_sq_direct,
"norm_sq_rule": norm_sq_rule,
"match": np.isclose(norm_sq_direct, norm_sq_rule),
})
df = pd.DataFrame(results)
print("L2 Norm Scaling: ||c * x||^2 = c^2 * ||x||^2")
print("(Power of a product rule: (c * x_i)^2 = c^2 * x_i^2)")
print()
print(df.to_string(index=False))
print(f"\nAll match: {df['match'].all()}")Professional example (R)
# L2 norm scaling: ||c*x||^2 = c^2 * ||x||^2
set.seed(42)
FEATURE_DIM <- 5
num_samples <- 100
X <- matrix(rnorm(num_samples * FEATURE_DIM), nrow = num_samples)
scales <- c(0.5, 1, 2, 5, 10)
results <- lapply(scales, function(c) {
X_scaled <- c * X
norm_sq_direct <- mean(rowSums(X_scaled^2))
norm_sq_rule <- c^2 * mean(rowSums(X^2))
data.frame(scale_c = c, norm_sq_direct = norm_sq_direct, norm_sq_rule = norm_sq_rule,
match = abs(norm_sq_direct - norm_sq_rule) < 1e-10)
})
df <- do.call(rbind, results)
cat("L2 Norm Scaling: ||c*x||^2 = c^2 * ||x||^2\n")
print(df)
cat(sprintf("\nAll match: %s\n", all(df$match)))Source: MRAF