In: Computer Science
If f(n) = 3n+2 and g(n) = n, then Prove that f(n) = O (g(n))
Explanation :
Topic : Big O Notation
If f(n) <= c.g(n) for n>=0,
for some c>0 and n>1
Substitute f(n) = 3n+2
3n+2 <= c(b)
When can be 3n+2 less than equal to c(n),
For above case the value of c can be anything above 4 is better.
Eg. if we take c=4 and substitute in above equation then,
3n+2 <= 4n
2<= 4n -3n
2n<= n
It means for every n>= 2 at c=4, f(n)<=c.g(n).
f(n)= O (g(n))