0% found this document useful (0 votes)
43 views

14. Given f (n) = Θ (h (n) ) and g (n) = Θ (h (n) )

1. The statement is true. If f(n) and g(n) are both Θ(h(n)), then their sum f(n) + g(n) is also Θ(h(n)) since it will be bounded above and below by constants times h(n). 2. The statement is true. If f(n) is O(g(n)) and g(n) is O(f(n)), then f(n) and g(n) grow at the same rate, so f(n) is Θ(g(n)).

Uploaded by

jevanjunior
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

14. Given f (n) = Θ (h (n) ) and g (n) = Θ (h (n) )

1. The statement is true. If f(n) and g(n) are both Θ(h(n)), then their sum f(n) + g(n) is also Θ(h(n)) since it will be bounded above and below by constants times h(n). 2. The statement is true. If f(n) is O(g(n)) and g(n) is O(f(n)), then f(n) and g(n) grow at the same rate, so f(n) is Θ(g(n)).

Uploaded by

jevanjunior
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMP2101 / CS20S Discrete Mathematics Complexity analysis Determine whether each statement is true or false in Exercises 1 2 is true or false.

e. If the statement is false give a counterexample. Assume that the functions f, g and h take on only positive values. 1. 2.
f (n) (h(n)) and g (n) (h(n)), then f (n) g (n) (h(n)) f (n) ( g (n)) and g (n) ( f (n)), then f (n) ( g (n))

SOLN. 14. Given f(n) = (h(n)) and g(n) = (h(n)) Show that f(n) + g(n) = (h(n)) f(n) = (h(n)) C1 | h(n) | | f(n) | C2 | h(n) | where C1 and C2 are constants C4 | h(n) | where C3 and C4 are constants (C2 + C4) | h(n) |

g(n) = (h(n)) C3 | h(n) | | g(n) |

By Addition (C1 + C3) | h(n) | C5 | h(n) |

| f(n) | + | g(n) |

| f(n) | + | g(n) | C6 | h(n) | where C5 and C6 are constants As f, g and h take on only positive values | f(n) | + | g(n) | = | f(n) + g(n) | Therefore C5 | h(n) | | f(n) + g(n) | C6 | h(n) | f(n) + g(n) = (h(n))

15. Given f(n) = O(g(n)) and g(n) = O(f(n)) Show that f(n) = (g(n)) f(n) = O(g(n)) | f(n) | g(n) = O(f(n))

C1 | g(n) | C2 | f(n) | | f(n) | | f(n) |

where C1 is a constant where C2 is a constant

| g(n) |

| g(n) | / C2 ( 1 / C2 ) | g(n) | C3 | g(n) |

| f(n) | | f(n) | | f(n) | or

where C3 is a new constant | f(n) | C3 | g(n) | or f(n) = (g(n))

C3 | g(n) | C3 | g(n) |

C1 | g(n) |

OR As

f(n) = (g(n)) = (g(n))

f(n) = O(g(n)) and f(n) = (g(n))

f(n)

You might also like