Question

In: Computer Science

For each pair of functions f and g, write whether f is in O(g), Ω(g), or...

For each pair of functions f and g, write whether f is in O(g), Ω(g), or Θ(g). (latex format below)

       \begin{enumerate}
           \item $f = (n+1000)^4$, $g = n^4 - 3n^3$
           \item $f = \log_{1000} n$, $g = \log_2 n$
           \item $f = n^{1000}$, $g = n^2$
           \item $f = 2^n$, $g = n!$
           \item $f = n^n$, $g = n!$
       \end{enumerate}

Solutions

Expert Solution

The answer of the question is provided below, please comment if any doubts:

1.

f = (n+1000)^4

g = n^4 – 3n^3

Answer: f = Ω(g)

Proof:

  • For “f = Ω(g)” there exists constants c and n0 such that they are positive and ,
    • 0 <= c*g(n) <= f(n) for all n>n0
  • Here for all n>1, and for c=1, 0 <= n^4 – 3n^3 <= (n+1000)^4.
  • Hence f = Ω(g).

2.

f = log1000 (n)

g = log2 (n)

Answer: f = O(g)

Proof:

  • For “f = O(g)” there exists constants c and n0 such that they are positive and ,
    • 0 <= f(n) <= c*g(n) for all n>n0
  • Here for all n>1, and for c=1, 0 <= log1000 (n)<= log2 (n).
  • Hence f = O(g).

3.

f = n1000

g = n2

Answer: f = Ω(g)

Proof:

  • For “f = Ω(g)” there exists constants c and n0 such that they are positive and ,
    • 0 <= c*g(n) <= f(n) for all n>n0
  • Here for all n>1, and for c=1, 0 <= n^2 <= (n^1000).
  • Hence f = Ω(g).

4.

f = 2n

g = n!

Answer: f = O(g)

Proof:

  • For “f = O(g)” there exists constants c and n0 such that they are positive and ,
    • 0 <= f(n) <= c*g(n) for all n>n0
  • Here for all n>3, and for c=1, 0 <= 2n<= .n!
  • Hence f = O(g).

5.

f = nn

g = n!

Answer: f = Ω(g)

Proof:

  • For “f = Ω(g)” there exists constants c and n0 such that they are positive and ,
    • 0 <= c*g(n) <= f(n) for all n>n0
  • Here for all n>1, and for c=1, 0 <= n! <= nn
  • Hence f = Ω(g).

Related Solutions

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.
If f and g are both differentiable functions. If h = f g, then h'(2) is: ___________________
  If f and g are both differentiable functions. If h = f g, then h'(2) is: ___________________ Given the function: y=sin(4x)+e^-3x and dx/dt = 3 when x=0. Then dy/dt = ________________ when x=0. Let f(x) = ln (√x). The value of c in the interval (1,e) for which f(x) satisfies the Mean Value Theorem (i.e f'(c)= f(e)-f(1) / e-1 ) is: _________________________ Suppose f(x) is a piecewise function: f(x) = 3x^2 -11x-4, if x ≤ 4 and f(x) =...
Find the best possible relationship using one of the notations: O, Ω, Θ, o, ω, for...
Find the best possible relationship using one of the notations: O, Ω, Θ, o, ω, for the following pairs of functions: n 3 + 6n 1.5 + 3100 and n lg8 − 10n 1.6 − 9000; nlgn and n 1.01; 3n and (3.01)n ; 7n and n!. Justify each answer.
Argue with proof that whether following asymptotic notations are transitive, reflexive, or symmetric. O(n); o(n); Ω(n);...
Argue with proof that whether following asymptotic notations are transitive, reflexive, or symmetric. O(n); o(n); Ω(n); ω(n); ϴ(n)
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates...
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates to a new function. Both f and g will be functions that take one parameter and evaluate to some result. The returned function should be the composition of the two functions with f applied first and g applied to f's result. For example (combine add1 sub1) should evaluate to a function equivalent to (define (h x) (sub1 (add1 x))). You will need to use...
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 the following functions f and g : f(x, y) = e ax − (1 −...
For the following functions f and g : f(x, y) = e ax − (1 − a)lny a > 0 g(x, y, z) = −3x 2 − 3y 2 − 3z 2 + 2xy + 2xz + 2yz 1. Calculate the Hessian matrices of f and g noted Hf (x, y) and Hg(x, y, z) 2. Show that Hg(x, y, z) is define negativly for all (x, y, z) ∈ Dg 3. For what value o a is , Hf...
if f and g are the functions whose graphs are shown, let u(x) = f(x)g(x) and v(x) = f(x)/g(x).
if f and g are the functions whose graphs are shown, let u(x) = f(x)g(x) and v(x) = f(x)/g(x) (a) Find u'(1) (b) Find v'(5).
a. Define Ω(g(n)). b. Express 6n2 + 4n2 logn + 2n3/ 2 + 35 in O-notation....
a. Define Ω(g(n)). b. Express 6n2 + 4n2 logn + 2n3/ 2 + 35 in O-notation. c. Express 4log n + 5n1.63 + 3n in Ω-notation.
Let P(x) = F(x)G(x) and Q(x) = F(x)/G(x), where F and G are the functions whose graphs are shown.
Let P(x) = F(x)G(x) and Q(x) = F(x)/G(x), where F and G are the functions whose graphs are shown.(a) Find P ' (2)(b) Find Q ' (7)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT