- #1
lemonthree
- 51
- 0
Let \(\displaystyle \mid h \mid \)< 1. Which of the following functions are O(h)? Explain.
\(\displaystyle -4h \)
\(\displaystyle h+h^2 \)
\(\displaystyle \mid h \mid ^{0.5} \)
\(\displaystyle h + cos (h) \)
Based on my notes, f(h) = O(h) only if \(\displaystyle \mid f \mid \) ≤ C \(\displaystyle \mid h \mid \), where C is a constant independent of h.
I can only solve for the first function -4h, as I can take C = -4 to give \(\displaystyle \mid f \mid \) = -4 \(\displaystyle \mid h \mid \)
For the rest, I am not very sure how I should go about solving since I cannot get C to be a constant independent of h. Are there any tips to solving them? Although I am guessing that the remaining functions are not O(h) anyways...
I tried searching the net but the results led me to general cases of O(h), O(log(h)) type which does not go into detail the math part behind it.
\(\displaystyle -4h \)
\(\displaystyle h+h^2 \)
\(\displaystyle \mid h \mid ^{0.5} \)
\(\displaystyle h + cos (h) \)
Based on my notes, f(h) = O(h) only if \(\displaystyle \mid f \mid \) ≤ C \(\displaystyle \mid h \mid \), where C is a constant independent of h.
I can only solve for the first function -4h, as I can take C = -4 to give \(\displaystyle \mid f \mid \) = -4 \(\displaystyle \mid h \mid \)
For the rest, I am not very sure how I should go about solving since I cannot get C to be a constant independent of h. Are there any tips to solving them? Although I am guessing that the remaining functions are not O(h) anyways...
I tried searching the net but the results led me to general cases of O(h), O(log(h)) type which does not go into detail the math part behind it.