For time complexity I get that:
O(n) = worst case
$\Omega$(n) = best case
$\Theta$(n) = exactly (best and worse)
But I'm facing the following:
"State weather the statement is true or false. If true, provide justification, and if false, give the correct relation."
- $f(n) = log\ n, g(n) = \sqrt n\ $and $ f = O(g)$
- $f(n) = 2^n$, $g(n) = 4^n$, and $f = \Omega(g)$
- $f(n) = n^3 - n^2$, $g(n) = n^2$, and $f = O(g)$
- $f(n) = 2n + log\ n$, $g(n) = 2n\ log\ n$, and $f = \Theta(g)$
- $f(n) = log_2\ n$, $g(n) = log_{10}\ n$, and $f = \Theta(g)$
Is this anything more complicated than plugging in values for n to see which one grows faster?
E.g.
- True. E.g. if $n = 256$, both $log_2$ and $log_{10}$ of 256 (8, 2.4) are $ < 16$,
- False. $f = O(g)$ because $g(n) > f(n)$ for all positive values of $n$.
- False. $f = \Omega(g)$ At large values of $n, n^3$ will dwarf $n^2$.
- False $f = O(g)$ since $2n + log\ n$ is much smaller than $2n log\ n$.
- True. Regardless of the log base they will both grow at the same rate.
Am I doing this right? Or am I missing something?