Courses / Computer Science I
Discrete Mathematics

Recurrence Relations

Computer Science I 225 words Free to read

Defining Recurrence Relations

A recurrence relation defines each term of a sequence using earlier terms, paired with initial conditions to start. Without initial conditions, the sequence is undetermined, just like a recursive function without a base case.

ComponentDescriptionExample
Recursive RuleHow a term depends on earlier onesF(n)=F(n1)+F(n2)F(n) = F(n-1) + F(n-2)
Initial ConditionsThe starting values needed to beginF(0)=0,F(1)=1F(0) = 0, F(1) = 1

To unfold a recurrence, you compute it forward from the initial conditions. A closed form is a direct formula for F(n)F(n) avoiding earlier terms, such as a(n)=2na(n) = 2^n for a(n)=2a(n1)a(n) = 2\,a(n-1) with a(0)=1a(0) = 1.

Why Recurrences Matter

Recurrences model processes building on previous states, mirroring recursion in programming. They are central to algorithm analysis, describing running times like T(n)=2T(n/2)+nT(n) = 2\,T(n/2) + n.

TaskMethodOutcome
EvaluationUnfolding forwardExact sequence values
SolvingCharacteristic equation or Master TheoremClosed-form complexity (nlognn \log n)

Common Pitfall: Supplying too few initial conditions. A recurrence reaching back kk steps needs kk starting values. F(n)=F(n1)+F(n2)F(n) = F(n-1) + F(n-2) requires two starting values, or the sequence remains undefined.

Recurrence Relations

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

9practice questions
2interactive scenes

Discrete Mathematics