question about a big oh notation
Q1) Show, by applying the definition of the O-notation, that each of the
following is true.
- If f(n)= n(n-1)/2, then f(n) = O(n^2).
- If f(n)= n+ log n, then f(n) = O(n).
- 1+ n+ n^2 + n^3 = O(n^3).
Q2) State without proof whether each of the following is True or False.
- 7 = O(1).
- n + n^4 = O(n^3).
- For any polynomial T(n), T(2n) = O(T(n)).
- For any function T(n), T(2n) = O(T(n)).
Q3) Show, by the definition of the O-notation, that n^3 != O(n^2).
(Note != means not-equal.)
Q4) Let T1(n)= O(f(n)) and T2(n)= O((g(n)). Prove by the definition of
the O-notation, this implies T1(n) + T2(n)= O(f(n) + g(n)).
Q5) Let T1(n)= O(f(n)) and T2(n)= O((g(n)). Prove by the definition of
the O-notation, this implies T1(n) * T2(n)= O(f(n) * g(n)).
answer
body preview (3 words)
xxxxx attached file.......
file1.docx preview (739 words)
Q1) xxxxx by xxxxxxxx xxx definition xx the xxxxxxxxxxx that each xx the following xx xxxxx
x xx f(n)= xxxxxxxxx xxxx f(n) x O(n^2). - xx f(n)= n+ log xx xxxx xxxx = xxxxxxx 1+ n+ xxx x xxx = O(n^3).
xxxxxxxx
F(n) = n(n-1)/2 < xxx - xx = n^2 – n < n^2 xxx all x >x
Hence, f(n) < n^2 xxx xxx n > 1
xxxxxx by definition of xxxxxxxxxx , f(n) x xxxxxx
xxxx x n x logn xxx xx xxxx xxxx x > xxxxxx xxx xxx n > x {this xx xxxxxxx e^n > n and by taking log xx xxxx xxxxx we xxxx x > logn}
xxxxxx f(n) < n x x = 2n == > xxxx < xx for xxx x>x where C = 2
Hence, by definition xx xxxxxxxxxx, f(n) = O(n)
xxxxxxxx (1 x x + n^2 x xxxx < xxxx + n^3 + n^3 x n^3) xxx all x>1
Hence, xx + x + n^2 + n^3) < xxxx for xxx n > x where x x 4
Hence, xx definition of xxxxxxxxxxx (1 + x x xxx
- - - more text follows - - -
Try it before you buy it |



on Sun, 2012-05-20 23:37