Recurrence Relations & Master Theorem Flashcards

1
Q

What is a recurrence relation?

A

A recurrence relation is a recursively-defined function
Suppose that the runtime of a program is T(n), then a recurrence relation will express T(n) in terms of its values at other, smaller values of n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the general pattern for recurrence?

A

Start from base case, use the recurrence to work out many cases by directly substituting and working upwards in values of n
Inspect results, then look for the pattern and make a hypothesis for the general results
Attempt to prove said hypothesis - using proof by induction
The extract the large n behaviour using big-Oh family

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Master Theorem’s General Formula?

A

T(n) = a T(n/b) + f(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is case 1 for the Master Theorem?

A

T(n) is big-Theta(n^log_b(a)) if c < log_b(a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is case 2 for the Master Theorem?

A

T(n) is big-Theta(n^c * (log n)^(k+1)) if:
f(n) is big-Theta(n^c * (log n)^k) and c = log_b(a) & k >= 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is case 3 for the Master Theorem?

A

T(n) is big-Theta(f(n)) if f(n) is big-Omega with c > log_b(a) & f(n) satisfies the regularity condition:
a f(n/b) <= k(f(n)) for a k < 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly