Friday, October 9, 2015

asymptotics - Can I disprove the following statement with this example?




I do not know much about O notation so could you please help me, I have to prove or disprove the following statment:



$\forall f,g: \mathbb{N} \rightarrow \mathbb{R}_{\geq 0} \text{ }f=O(g) \text{ or } f=\Omega(g)$



Can I disprove this statement with $f = \sin(x) + 1 $ and $ g = \cos(x) + 1$?



Thanks in advance!
Cheers


Answer



Your proposed example will do the job in a fairly straightforward way if you measure angles in degrees.




If you are working in radians, which is the usual convention in mathematics unless one says otherwise, it can be done. But we need to find out quite a lot about how sine and cosine behave at the integers. Not easy! Replacing the $n$ in $\sin n$ and $\cos n$ by $\frac{\pi n}{2}$ will work.



There are simpler examples that disprove the assertion. We can let $f(n)=0$ when $n$ is even, $f(n)=1$ when $n$ is odd, and let $g(n)=1-f(n)$.



Or for an example that is slightly more realistic in a computing context, let $f(n)=n$ when $n$ is even, $f(n)=n^2$ when $n$ is odd, and let $g(n)=n^2$ when $n$ is even, $g(n)=n$ when $n$ is odd.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...