Prove by showing:
f(n) = n^2 + 4n is O(n)
I am not quite sure what you mean by O(n)
f(n) is of order n^2, not n, as n-> infinity
Yes it is suppose to be
f(n) = n^2 + 4n is O(n^2)
This is what I have:
n^2 = n^2 + 4n^2 = 5n, but that all I have and don't know what else to do, can you help. Thanks
I am as puzzled by your notation as drwls was.
how did you get n^2 = n^2 + 4n^2 = 5n
from f(n) = n^2 + 4n is O(n^2) ???
BTW, in the original you had O(n)
Oh okay, I am sorry for typing error. It is definely suppose to be
f(n) = n^2 + 4n is O(n^2)
I am typing to fast bc my answer was suppose to read
n^2 = n^2 + 4n <= n^2 + 4n^2 = 5n^2
Does this make any sense. Please Help!
nope, sorry, makes no sense at all
how did f(n) which is a function notation, become n^2 ??
how did the term 4n suddenly turn into 4n^2 ??
I have certainly never seen a notation such as O(n^2) used in that kind of setting.
okay, well it is suppose to read Big O of n^2
how about this question
what is the theta class for
f(n) = n^2 + 4n x lg(n)
I am sorry not to be able to help you.
I have never seen that kind of question before.
What level of math is this supposed to be, and whose curriculum are you studying?
Thanks anyway! :)
Yes it is suppose to be
f(n) = n^2 + 4n is O(n^2) :
Hi,
I assume n>1.
let g(n)=n^2
This is straight forward according to big O notation.
f(n) = n^2 + 4n
<= n^2 + 4n^2 = 5n^2
That means |f(n)|<=C|g(n)| where C is a constant.
According to big O definition
f(n) is O(n^2)
To prove that f(n) = n^2 + 4n is O(n), we need to show that there exist positive constants c and k such that for all values of n greater than or equal to k, f(n) ≤ c * n.
First, let's simplify the expression of f(n) = n^2 + 4n:
f(n) = n^2 + 4n
= n(n + 4)
Now, let's choose c = 5 and k = 1. We need to show that for all values of n greater than or equal to 1, f(n) ≤ 5n.
For n ≥ 1:
f(n) = n(n + 4) ≤ n(2n) = 2n^2
≤ 5n^2
So, we have shown that for all values of n greater than or equal to 1, f(n) ≤ 5n^2.
This implies that f(n) = n^2 + 4n is O(n) with c = 5 and k = 1, because for all values of n greater than or equal to 1, f(n) ≤ 5n.