Question

In: Computer Science

If f(n) = 3n+2 and g(n) = n, then Prove that f(n) = O (g(n))

If f(n) = 3n+2 and g(n) = n, then Prove that f(n) = O (g(n))

Solutions

Expert Solution

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))

Related Solutions

1.)Prove that f(n) = O(g(n)), given: F(n) = 2n + 10; g(n) = n 2.)Show that...
1.)Prove that f(n) = O(g(n)), given: F(n) = 2n + 10; g(n) = n 2.)Show that 5n2 – 15n + 100 is Θ(n2 ) 3.)Is 5n2 O(n)?
Prove why f(n)=big omega(g(n)) then f(n)=o(g(n)) is NEVER TRUE. Prove why f(n) +g(n) =Theta(max(f(n),g(n)) is ALWAYS...
Prove why f(n)=big omega(g(n)) then f(n)=o(g(n)) is NEVER TRUE. Prove why f(n) +g(n) =Theta(max(f(n),g(n)) is ALWAYS TRUE
How to prove f(n)=O(n) for any integer ⩾1, if f(1)=1 and f(n)=2f(⌊n/2⌋)+1 for n⩾2? Do you...
How to prove f(n)=O(n) for any integer ⩾1, if f(1)=1 and f(n)=2f(⌊n/2⌋)+1 for n⩾2? Do you need induction? If so, how do you do it?
1- Show that (n^3+3n^2+3n+1) / (n+1) is O (n2 ). Use the definition and proof of...
1- Show that (n^3+3n^2+3n+1) / (n+1) is O (n2 ). Use the definition and proof of big-O notation. 2- Prove using the definition of Omega notation that either 8 n is Ω (5 n ) or not. please help be with both
Calculate the Big-O time complexity. Show work 1. n^2 + 3n + 2 2. (n^2 +...
Calculate the Big-O time complexity. Show work 1. n^2 + 3n + 2 2. (n^2 + n)(n ^2 + π/2 ) 3. 1 + 2 + 3 + · · · + n − 1 + n
Prove or disprove each of the followings. If f(n) = ω(g(n)), then log2(f(n)) = ω(log2g(n)), where...
Prove or disprove each of the followings. If f(n) = ω(g(n)), then log2(f(n)) = ω(log2g(n)), where f(n) and g(n) are positive functions. ω(n) + ω(n2) = theta(n). f(n)g(n) = ω(f(n)), where f(n) and g(n) are positive functions. If f(n) = theta(g(n)), then f(n) = theta(20 g(n)), where f(n) and g(n) are positive functions. If there are only finite number of points for which f(n) > g(n), then f(n) = O(g(n)), where f(n) and g(n) are positive functions.
1. a) Prove that if n is an odd number then 3n + 1is an even...
1. a) Prove that if n is an odd number then 3n + 1is an even number. Use direct proof. b) Prove that if n is an odd number then n^2+ 3 is divisible by 4. Use direct proof. 2. a) Prove that sum of an even number and an odd number is an odd number. Use direct proof. b) Prove that product of two rational numbers is a rational number. Use direct proof. 3. a) Prove that if n2is...
Prove that 2n+10 +n is O(2n)
Prove that 2n+10 +n is O(2n)
if a in G (group ) such as o(a)=mn prove the existence of g and h...
if a in G (group ) such as o(a)=mn prove the existence of g and h in G such as a=gh=hg and o(g)=m o(h)=n
Prove and give a counterexample: If N ⊲ G and G ⊲ H, then N ⊲...
Prove and give a counterexample: If N ⊲ G and G ⊲ H, then N ⊲ H. Please write an explanation with some details
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT