Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
aa:lab:notations [2016/11/02 18:07] dalex |
aa:lab:notations [2016/11/02 18:18] (current) dalex |
||
---|---|---|---|
Line 109: | Line 109: | ||
Let $math[f(n) = \log(n)] and $math[g(n) = n]\\ | Let $math[f(n) = \log(n)] and $math[g(n) = n]\\ | ||
We see that, for $math[c = 1, n_0 = 1 \Rightarrow 0 \le \log(n) \le n]\\ | We see that, for $math[c = 1, n_0 = 1 \Rightarrow 0 \le \log(n) \le n]\\ | ||
- | for $math[c = 10, n_0 = 64 \Rightarrow 0 \le 10\log(n) \le n]\\ | + | for $math[c = 10, n_0 = 64 \Rightarrow 0 \le 10 \log(n) \le n]\\ |
- | for $math[c = 100, n_0 = 1024 \Rightarrow 0 \le 100\log(n) \le n]\\ | + | for $math[c = 100, n_0 = 1024 \Rightarrow 0 \le 100 \log(n) \le n]\\ |
etc.\\ | etc.\\ | ||
Thus, $math[g(n) \in \omega(f(n))] | Thus, $math[g(n) \in \omega(f(n))] | ||
Line 127: | Line 127: | ||
Note that equations are not symmetric and should only be read from left to right. Consider: | Note that equations are not symmetric and should only be read from left to right. Consider: | ||
$$\Theta(n) = O(n)$$ | $$\Theta(n) = O(n)$$ | ||
- | While it is true that, for any function in $math[\Theta(n)] there is a function equal to it in $math[O(n)], we can clearly see that there are functions in $math[O(n)] for which there is no correspondent in $math[\Theta(n)] (e.g. $math[f(n) = 1, $f(n) = \log(n)] etc.) | + | While it is true that, for any function in $math[\Theta(n)] there is a function equal to it in $math[O(n)], we can clearly see that there are functions in $math[O(n)] for which there is no correspondent in $math[\Theta(n)] (e.g. $math[f(n) = 1, f(n) = \log(n)] etc.) |
As a rule, each asymptotic notation on the left side of the equal sign should be read as an **universally quantified** function ($math[\forall f]) from that class and each asymptotic notation on the right should be read as an **existentially quantified** function ($math[\exists g]) from that class. | As a rule, each asymptotic notation on the left side of the equal sign should be read as an **universally quantified** function ($math[\forall f]) from that class and each asymptotic notation on the right should be read as an **existentially quantified** function ($math[\exists g]) from that class. | ||
Line 133: | Line 133: | ||
$$\left(\frac{\omega(n^2)}{\Theta(n)}\right) = \Omega(n) + o(n)$$ | $$\left(\frac{\omega(n^2)}{\Theta(n)}\right) = \Omega(n) + o(n)$$ | ||
- | $math[\forall f \in \omega(n^2)\ and\ \forall g \in \Theta(n),\ \exists h \in \Omega(n)] and $math[\exists j \in o(n)] such that | + | $math[\forall f \in \omega(n^2)\ and\ |
+ | \forall g \in \Theta(n),\ \exists h \in \Omega(n)] and $math[\exists j \in o(n)] such that | ||
$math[\left(\frac{f(n)}{g(n)}\right) = h(n) + j(n),\ \forall n \in \mathbb{R}^{+}] | $math[\left(\frac{f(n)}{g(n)}\right) = h(n) + j(n),\ \forall n \in \mathbb{R}^{+}] | ||
Line 151: | Line 152: | ||
* $math[\log(n\cdot \log(n))\in\Theta(\log(n))] | * $math[\log(n\cdot \log(n))\in\Theta(\log(n))] | ||
* $math[\sqrt{n}\in\omega(\log(n))] | * $math[\sqrt{n}\in\omega(\log(n))] | ||
- | * $math[f(n) + g(n) \in O(n\cdot\log(n))$ for $f(n)\in\Theta(n)$ and $g(n)\in O(n\cdot\log n)] | + | * $math[f(n) + g(n) \in O(n\cdot\log(n))] for $math[f(n)\in\Theta(n)] and $math[g(n)\in O(n\cdot\log n)] |
===== Exercises (syntactic sugars) ===== | ===== Exercises (syntactic sugars) ===== |