Building a product through recursive calls.
Factorial and power both work the same way: multiply one factor at each level and let the result propagate back up.
Multiplicative recursion builds a product by combining one factor at each level of recursion. Factorial multiplies n by (n - 1)!; power multiplies base by base^(exp - 1). Each return value carries the partial product upward.
The base case usually returns 1, because 1 is the multiplicative identity — multiplying by 1 doesn't change the running product.
On the AP exam, factorial is the canonical first recursion FRQ, and power is its near-twin.
Multiply at each level; base case returns 1.
Each call contributes one factor to the product.
Factorial
public int factorial(int n) {
if (n <= 1) return 1; // base case
return n * factorial(n - 1); // multiply n by smaller factorial
}
The recursive case multiplies n by the result of factorial(n - 1). The base case returns 1 because 0! = 1 and 1! = 1 by convention.
Power
public int power(int base, int exp) {
if (exp == 0) return 1;
return base * power(base, exp - 1);
}
Each call peels off one factor of base. The exponent counts down toward 0.
Return-value propagation
Each call multiplies its factor by what the smaller call returns. The returns "bubble up" the stack: the innermost call (base case) returns 1, then the next level multiplies that by its factor, then the next, and so on — until the outermost call has the full product.
Why base case returns 1
Returning 0 would zero out the entire product. Returning 1 is the multiplicative identity: x * 1 = x, so multiplying by the base case's return doesn't change the running product. This is the mathematical mirror of the additive base case (0).
Multiplicative recursion vocabulary.
Used in product-building problems.
- Factorial —
n! = n * (n - 1) * ... * 1. - Power —
base^expbuilt by repeated multiplication. - Return propagation — each call passes its product up.
- Multiplicative identity — 1; doesn't change the running product.
- Call stack — the stacked unfinished calls waiting for inner returns.
- Unwinding — the process of inner returns flowing back to outer calls.
How multiplicative recursion is tested.
Base case value and trace direction dominate.
- Base case returns 1. Not 0 — that would zero out the product.
- Multiplication in the recursive case.
n *the inner call. - Return the recursive call's result. Don't ignore it.
- Negative inputs. Most AP factorial/power problems assume non-negative inputs.
MCQ patterns: trace factorial(4) or power(2, 5) call by call.
Trace factorial(4) and power(2, 3) visually.
Two product chains.
factorial(4) — calls down:
factorial(4) = 4 * factorial(3)
= 4 * (3 * factorial(2))
= 4 * (3 * (2 * factorial(1)))
= 4 * (3 * (2 * 1)) <-- base case
= 4 * (3 * 2)
= 4 * 6
= 24
Returns up: factorial(1) = 1; factorial(2) = 2; factorial(3) = 6; factorial(4) = 24.
power(2, 3) — calls down:
power(2, 3) = 2 * power(2, 2)
= 2 * (2 * power(2, 1))
= 2 * (2 * (2 * power(2, 0)))
= 2 * (2 * (2 * 1)) <-- base case
= 2 * (2 * 2)
= 2 * 4
= 8
Why this matters. Each call sits paused, waiting for its inner call to return. Once the base case returns 1, the chain "unwinds" upward, multiplying at each level.
Multiplicative pitfalls.
Most are about the base case value.
- Base case returns 0. Zeros out the entire product.
- Adding instead of multiplying. Wrong operation for product-building.
- Missing the recursive return.
factorial(n - 1);alone ignores the result. - Counting up instead of down.
factorial(n + 1)never reaches the base. - Base at
n == 1only. Usen <= 1to handle 0 as well.
Multiplicative recursion at a glance.
Base value and operator.
Multiplicative Recursion Reference
AP Quick Reference| Method | Base case | Recursive case |
|---|---|---|
| factorial(n) | n <= 1: return 1 | n * factorial(n - 1) |
| power(b, e) | e == 0: return 1 | b * power(b, e - 1) |
| Identity | 1 | Multiplicative. |
| Direction | Toward 0 or 1 | One factor per level. |
How to master multiplicative recursion.
Write the trace; respect the base value.
Use the three practice tools below this lesson in order:
- MCQ Practice — for each option, trace small inputs (n = 3 or 4) call by call.
- Java Lab — implement factorial and power; print the unwind values to verify propagation.
- FRQ Practice — always start the method with "if base, return 1; else return n * inner".
If you can sketch the call chain on paper and trace returns upward, this pattern is locked in.
Practice — attempt these now.
AP-style assessments aligned to this lesson. Time them.
AP CSA Unit 11 Topic 02 Multiplicative Recursion FRQ Practice
AP-style topic practice assessment