Question

In: Computer Science

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

Solutions

Expert Solution

1)
f(n) = O(g(n)) means there are positive constants c and n0, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0

2n + 10 = O(n)
=>  2n + 10 <= c(n)
Let's assume c = 3
=>  2n + 10 <= c(n)
=>  2n + 10 <= 3n
=>  10 <= n
it's true for all n >= 10

so, 2n + 10 = O(n)

2)
f(n) = Θ (g(n)) means there are positive constants c1, c2, and k, such that 0 ≤ c1g(n) ≤ f(n) ≤ c2g(n) for all n ≥ n0. The values of c1, c2, and n0 must be fixed for the function f and must not depend on n.

5n^2 – 15n + 100 is Θ(n^2)

=>  c1(n^2) <= 5n^2 – 15n + 100 <= c2(n^2)
Let's assume c1 = 1 and c2 = 5
=>  c1(n^2) <= 5n^2 – 15n + 100 <= c2(n^2)
=>  1(n^2) <= 5n^2 – 15n + 100 <= 5(n^2)
=>  n^2 <= 5n^2 – 15n + 100 <= 5n^2
=>  n^2 <= 5n^2 – 15n + 100 and 5n^2 – 15n + 100 <= 5n^2
=>  0 <= 4n^2 – 15n + 100 and 100 <= 15n
These are true for all n >= 1

so, 5n^2 – 15n + 100 is Θ(n^2) given c1 = 1, c2 = 5 and n0 = 1

3)
No, 5n^2 is not O(n)




Related Solutions

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))
For f: N x N -> N defined by f(m,n) = 2m-1(2n-1) a) Prove: f is...
For f: N x N -> N defined by f(m,n) = 2m-1(2n-1) a) Prove: f is 1-to-1 b) Prove: f is onto c) Prove {1, 2} x N is countable
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
Algorithm problem 4 [3.1-4] Is (2^(n+1))∈O(2^n)? Is (2^(2n))∈O(2^n)?
Algorithm problem 4 [3.1-4] Is (2^(n+1))∈O(2^n)? Is (2^(2n))∈O(2^n)?
Prove the following by induction: 2 + 4 + 6 + …+ 2n = n(n+1) for...
Prove the following by induction: 2 + 4 + 6 + …+ 2n = n(n+1) for all integers n Show all work
Prove the upper and lower bound of T(n) = T(n/3) + T(2n/3) + O(n)
Prove the upper and lower bound of T(n) = T(n/3) + T(2n/3) + O(n)
Calculate Δ G ∘ rxn for the following reaction: 4CO(g)+2N O 2 (g)→4C O 2 (g)+...
Calculate Δ G ∘ rxn for the following reaction: 4CO(g)+2N O 2 (g)→4C O 2 (g)+ N 2 (g) . Use the following reactions and given Δ G ∘ rxn values: 2NO(g)+ O 2 (g)→2N O 2 (g) , Δ G ∘ rxn = - 72.6 kJ 2CO(g)+ O 2 (g)→2C O 2 (g) , Δ G ∘ rxn = - 514.4 kJ 1 2 O 2 (g)+ 1 2 N 2 (g)→NO(g) , Δ G ∘ rxn = 87.6...
By induction: 1. Prove that Σni=1(2i − 1) = n2 2. Prove thatΣni=1 i2 = n(n+1)(2n+1)...
By induction: 1. Prove that Σni=1(2i − 1) = n2 2. Prove thatΣni=1 i2 = n(n+1)(2n+1) / 6 .
Prove these scenarios by mathematical induction: (1) Prove n2 < 2n for all integers n>4 (2)...
Prove these scenarios by mathematical induction: (1) Prove n2 < 2n for all integers n>4 (2) Prove that a finite set with n elements has 2n subsets (3) Prove that every amount of postage of 12 cents or more can be formed using just 4-cent and 5-cent stamps
(1)Prove 6^(2n)-4^(2n) must be a mutiple of 20 (2)Prove 6^(2n)+4^(2n)-2 must be a multiple of 50
(1)Prove 6^(2n)-4^(2n) must be a mutiple of 20 (2)Prove 6^(2n)+4^(2n)-2 must be a multiple of 50
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT