Intuition The one core idea
A big problem of size n can sometimes be cracked by splitting it into a few smaller copies of the same problem , solving those, and cheaply gluing the answers back together. Divide and conquer is nothing more than this bet — split + glue is cheaper than brute force — plus the bookkeeping (a recurrence) that tells us exactly how fast the bet pays off.
Before you can read a single line of the parent note , you need to own every symbol it throws at you. This page builds each one from the ground up: plain words → a picture → why the topic even needs it. Nothing is assumed.
n = the size of the input
n is a single whole number that measures how big the thing you must process is . For a list to sort, n is how many items are in the list. For two numbers to multiply, n is how many digits each has.
The picture: imagine a row of boxes. Count them. That count is n .
Intuition Why we need a "size"
Every claim about speed — "this is fast", "this is slow" — is meaningless unless we say fast for what size? Sorting 3 items is trivial; sorting 3 billion is not. The whole subject is about how the effort grows as n grows , so n must be named first.
When we divide, two separate numbers describe the split. Do not confuse them.
a = how many pieces you make
After splitting, you end up with a smaller subproblems that you must actually solve. Mergesort makes a = 2 pieces. Karatsuba makes a = 3 .
b = the shrink factor (how much smaller each piece is)
Each subproblem has size about n / b . If you cut a list in half, each half has size n /2 , so b = 2 . Here b is the number you divide the size by — it is about size , not count.
Common mistake Steel-man: "
a and b are the same number — you make 2 halves, so both are 2."
Why it feels right: in mergesort you cut into 2 halves and recurse on both, so a = 2 and b = 2 happen to match.
Why it's wrong: they measure different things. In Karatsuba you cut each number into 2 halves (b = 2 ) but only do 3 multiplications (a = 3 ). In binary search you cut in half (b = 2 ) but throw one half away, recursing on just 1 piece (a = 1 ).
Fix: ask two separate questions — "how much smaller?" gives b ; "how many do I keep and solve?" gives a .
Definition Recursion = a procedure that calls itself
A recursive procedure solves a problem by asking a smaller copy of itself to solve smaller pieces , then using those answers. The picture is a set of nested boxes: each box's job is to run smaller boxes and combine their outputs.
Definition Base case = the smallest problem, answered directly
The base case is a size so small the answer needs no recursion — a list of length 1 is already sorted, so you just return it. It is the floor that stops the nesting.
Intuition Why the base case is not optional
Without a floor, the boxes nest forever — the program either runs endlessly or crashes (a stack overflow , when the pile of paused calls grows past memory). The base case is the only thing that guarantees the recursion ever stops . The parent note's first "steel-man" is entirely about this trap.
You will meet full recursion machinery again in Mathematical Induction and see it powering Mergesort , Quicksort , and Binary Search .
Definition Combine = gluing sub-answers into the whole answer
Once the a subproblems return their answers, you still have to build the final answer from them. In mergesort this is the merge : walking two sorted halves and interleaving them into one sorted list.
f ( n ) = the non-recursive work at one level
f ( n ) is the cost of everything that is not a recursive call: the work to split (divide) plus the work to glue (combine), for a problem of size n . It is one bundled number so the recurrence stays clean.
Intuition Why bundle divide and combine together?
When we later add up the cost, only two kinds of work exist: work done inside recursive calls , and work done here, now, at this level . Calling the second kind f ( n ) lets the recurrence read cleanly as "my time = my subcalls' time + my own local work."
T ( n ) = worst-case time on an input of size n
T is a function: feed it a size n , it returns "how many basic steps, in the worst case." "Worst case" means we assume the unluckiest possible input, so the answer is a guarantee , never an underestimate.
You will learn to actually solve such equations in Recurrence Relations .
log b n = how many times you divide n by b to reach 1
Start at n . Divide by b . Divide by b again. Keep going until you hit 1 . The number of divisions is log b n (read "log base b of n ").
Concrete: with b = 2 and n = 8 : 8 → 4 → 2 → 1 takes 3 steps, so log 2 8 = 3 .
Intuition Why logs appear everywhere here
Splitting repeatedly by b builds a tree of levels . The height of that tree — how deep the nesting goes before hitting the base case — is exactly the number of halvings, log b n . So the log is not some abstract math import; it is literally "how tall is the recursion?" That is the tool we need, and no simpler tool answers "how many times can I halve?"
a i = a multiplied by itself i times
At depth i in the recursion tree, each box spawned a children, so the number of boxes multiplies by a each level: level 0 has 1 , level 1 has a , level i has a i .
Intuition The watershed in one sentence
Every recurrence is a tug-of-war between the leaves (many tiny problems, cost n l o g b a ) and the local work f ( n ) . Whichever grows faster with n wins and sets T ( n ) 's speed — that is all the three Master Theorem cases are testing.
Definition The three growth symbols
These describe how a cost grows with n , ignoring constant factors and small terms.
O ( g ) — grows no faster than g (upper bound / ceiling).
Ω ( g ) — grows no slower than g (lower bound / floor).
Θ ( g ) — grows exactly like g (both at once — a tight sandwich).
Intuition Why ignore constants?
A step taking 3 n or 10 n basic operations both grow as a straight line in n ; the slope differs but the shape — the thing that decides who wins as n → ∞ — is the same. Stripping constants lets us compare shapes , which is what scaling is about. Full details live in Big-O Notation .
log base b of n = tree height
watershed exponent log base b of a
Divide and Conquer analysis
Everything upstream feeds the two things the parent note actually does : prove correctness (via recursion = Mathematical Induction ) and find speed (via the recurrence + Master Theorem , applied to Mergesort , Binary Search , Karatsuba , Strassen Matrix Multiplication , and contrasted with Dynamic Programming ).
Test yourself — cover the right side and answer out loud.
What does n measure? The size of the input (e.g. number of items in the list).
What is a ? The number of subproblems you actually solve after splitting.
What is b ? The factor the input size shrinks by; each subproblem has size n / b .
Why can a = b ? They count different things — b is how much smaller each piece is, a is how many pieces you recurse on (e.g. binary search has b = 2 , a = 1 ).
What is a base case and why is it required? The smallest input, answered without recursion; it is the floor that stops the nesting so the program terminates.
What is f ( n ) ? The non-recursive local work at one level: divide cost plus combine cost.
Read the recurrence T ( n ) = a T ( n / b ) + f ( n ) in words. The time for size n equals a copies of the time for size n / b , plus the local divide-and-combine work.
What does log b n equal, pictorially? The number of times you divide n by b to reach 1 — the height of the recursion tree.
What is c crit = log b a ? The watershed exponent; n l o g b a is the number of leaves (smallest boxes), the leaf cost you compare f ( n ) against.
What do O , Ω , Θ mean? Grows no faster than (ceiling), no slower than (floor), and exactly like (tight) the given function.
Recall Quick self-quiz
If n = 16 and b = 2 , how many levels does the recursion have? ::: log 2 16 = 4 .
If a = 3 and there are log 2 n levels, how many leaves? ::: 3 l o g 2 n = n l o g 2 3 ≈ n 1.585 .