In: Computer Science
Prove that 2n+10 +n is O(2n)
because 2n+10 +n is O(2n) doesn't makes sense
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 2^(n+10) + n = O(2^n) => 2^(n+10) + n <= c(2^n) Let's assume c = 1025 => 2^(n+10) + n <= c(2^n) => 2^(n+10) + n <= 1025(2^n) => 2^10*2^n + n <= 1025(2^n) => 1024(2^n) + n <= 1025(2^n) => n <= (2^n) it's true for all n >= 1 so, 2^(n+10) + n = O(2^n) given c = 1025 and n0 = 1 2) In case if it is just 2n+10 +n is O(2n), use this 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 +n is O(2n) => 3n+10 is O(2n) => 3n+10 <= c(2n) Let's assume c = 2 => 3n+10 <= c(2n) => 3n+10 <= 2(2n) => 3n+10 <= 4n => 10 <= n it's true for all n >= 10 so, 2n+10 +n is O(2n) given c = 2 and n0 = 10