- Published on
The Algorithm Design Manual (3rd) Exercise Solution 'E2-17'
Table of Contents
Introduction
This series is my solutions for algorithm exercises in'The Algorithm Design Manual' 3rd edition.
It's my solutions, not model answers, so if you find some mistakes or more sophisticated solutions, please post in comment area below.
Repository
Exercise 2-17
Question
For each of the following pairs of functions f(n) and g(n), give an appropriate positive constant such that for all .
(a)
(b)
(c)
Solution
Question(a)
Combine and consider a new function:
Function decreases monotonically with n. So If the inequation holds when , it holds for all .
Solve the equation below and we get the result c value.
Question(b)
Combine and consider a new function:
By the same discussion used in question(a) (Monotonically decreasing trend), c is determined as below:
Question(c)
Combine and consider a new function:
The numerator has the maximum when and the denominator has the minimum at the same time.
So If the inequation holds when , it holds for all .