I am learning Big O and Big theta notation and confused the certain case.
I have two functions,
function 1(f1)
$$ n * n^{1/2} $$
function 2(f2)
$$ 1.001^n $$
in smaller cases (10,000) f1 is much faster than f2, however, it is vice versa for bigger case (10,000,000). For the smaller case, I can say
$$ f2 = O(f1) $$
In the bigger case, I can say
$$ f1 = O(f2) $$
and I think this case is,
$$ f1 = \theta(f2) $$
(If ^ this is wrong, please let me know)
At this case, can I say ??
$$ f1 \equiv f2 $$
-
$\begingroup$ What do you mean with "smaller" and "bigger" "cases"? Are you trying to say, for example, $f_1(n) > f_2(n)$ for $n = 10 \; 000$ and $f_1(n) < f_2(n)$ for $n = 10 \; 000 \; 000$? Finally, what do you mean by $f_1 \equiv f_2$? Is this some sort of (asymptotic) equivalence relation or simply equality for functions? $\endgroup$dkaeae– dkaeae2019年02月09日 20:14:47 +00:00Commented Feb 9, 2019 at 20:14
-
$\begingroup$ Also, big O notation indicates asymptotic behavior. It is irrelevant what happens for the first few cases, even if "few" means numbers in the order of 10ドル^7$. I suggest you review the respective definitions. $\endgroup$dkaeae– dkaeae2019年02月09日 20:16:05 +00:00Commented Feb 9, 2019 at 20:16
1 Answer 1
No, you can't say that, because $O$ doesn't mean "For small inputs, [something] happens" and $\Theta$ doesn't mean "For some inputs, one of the functions is bigger and, for other inputs, the other one is." In mathematics, it is essential to use the actual definition of the concepts that you're working with, and to prove that the definition applies in your situation.
-
$\begingroup$ I noticed that I made mistake to write my problem. Can you look at it again? $\endgroup$jayko03– jayko032019年02月09日 17:34:14 +00:00Commented Feb 9, 2019 at 17:34
-
1$\begingroup$ @jaykodeveloper David's main point still applies, you are not using the correct definitions of $O$ and $\Theta$. In particular, you should take a good look at the precise definition of $O$. $\endgroup$2019年02月09日 18:57:54 +00:00Commented Feb 9, 2019 at 18:57
-
$\begingroup$ @jaykodeveloper Your edit doesn't change my answer. $\endgroup$David Richerby– David Richerby2019年02月09日 19:01:25 +00:00Commented Feb 9, 2019 at 19:01