I'm trying to prove (or disprove) that if $f$ and $g$ are monotonic increasing, then $f(n)=O(g(n))$ or $g(n)=O(f(n))$ but with no success. Can someone help me with this? thanks.
Asked
Active
Viewed 104 times
1
-
2Hint: try to construct a counter-example with $f(n)=ng(n)$ if $n$ is even, and $g(n)=nf(n)$ if $n$ is odd. – TonyK Sep 08 '19 at 11:41
-
I tried to, but I guess I didn't fully understand it – Noa1996 Sep 08 '19 at 11:54
1 Answers
2
The following is a disproof:
Put $f(k):=k!$ $(k\geq1)$ and $$g(3m+j):=(3m)!\qquad(m\geq1, \ -1\leq j\leq 1)\ .$$ Then $f(3m)=g(3m)$ $(m\geq1)$ and $${f(3m+1)\over g(3m+1)}=3m+1,\qquad {g(3m-1)\over f(3m-1)}=3m\qquad(m\geq1)\ .$$
Christian Blatter
- 226,825