Question

In: Computer Science

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

Solutions

Expert Solution

1)
2^(n+1) = O(2^n)
This is true.
let's prove it.

f(n) = O(g(n)) means there are positive constants c and n0, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0
2^(n+1) = O(2^n)
=>  2^(n+1) <= c(2^n)
=>  2*2^n <= c(2^n)
Let's assume c = 2
=>  2*2^n <= c(2^n)
=>  2*2^n <= 2(2^n)
=>  2*2^n <= 2*2^n
it's true for all n >= 1

so, 2^(n+1) = O(2^n) given c = 2 and n0 = 1

2)
2^2n = O(2^n)
This is not correct.
let's prove 2^(2n) is not O(2^n).

f(n) = O(g(n)) means there are positive constants c and n0, such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0
assume 2^2n = O(2^n)
=>  2^2n <= c(2^n)
=>  2^n <= c
2^2n can be O(2^n) only if c >= 2^n

for f(n) = O(g(n)) then c must be a constant. here c >= 2^n which is not a constant
so, f(n) is not O(g(n))

hence 2^(2n) is not O(2^n)


Answer:
---------
Is (2^(n+1))∈O(2^n) Yes 
Is (2^(2n))∈O(2^n) No



Related Solutions

Prove that 2n+10 +n is O(2n)
Prove that 2n+10 +n is O(2n)
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
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)?
(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
Show by induction that for all n natural numbers 0+1+4+9+16+...+ n^2 = n(n+1)(2n+1)/6.
Show by induction that for all n natural numbers 0+1+4+9+16+...+ n^2 = n(n+1)(2n+1)/6.
1. Use the ę notation to prove the following limits: lim n→∞ [n^2+ 3ncos(2n+1)+2] / [n^2−nsin(4n+3)+4]...
1. Use the ę notation to prove the following limits: lim n→∞ [n^2+ 3ncos(2n+1)+2] / [n^2−nsin(4n+3)+4] = 1 2. Let {an} a sequence converging to L > 0. Show ∃N ∈ N, ∀n ∈ N, n ≥ N, an > 0 3.Let {an} a sequence converging to L. Let {bn} a sequence such that ∃Nb ∈ N, ∀n ∈ N, n ≥ Nb, an = bn. Show that {bn} converges to L as well. Thank you. Please complete proofs fully.
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
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)
Prove by induction that: 1) x^n - 1 is divisible by x-1 2)2n < 3^n for...
Prove by induction that: 1) x^n - 1 is divisible by x-1 2)2n < 3^n for all natural numbers n
Given an array A of n integers, describe an O(n log n) algorithm to decide if...
Given an array A of n integers, describe an O(n log n) algorithm to decide if the elements of A are all distinct. Why does your algorithm run in O(n log n) time?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT