asymptotics (1)
asymptotics (1)
1 Definitions
Which of the following is the correct English description of f (n) = O(g(n))?
For every constant c > 0, there is an n0 , such that for all n ≥ n0 , we have f (n) ≤ c · g(n).
There is some c > 0 and some n0 , such that for all n ≥ n0 we have f (n) ≤ c · g(n).
For every n0 , there is some constant c > 0 such that for all n ≥ n0 we have f (n) ≤ c · g(n).
Correct
Suppose that g(n) > 0 for all integers n. Then is f (n) = O(g(n)) equivalent to the following
simpler definition that avoids n0 ? Note the implicit assumption that f (n) and g(n) are functions over
nonnegative integers.
∃c > 0 : ∀n f (n) ≤ c · g(n)
Yes
No
Correct
Suppose that f (n) = O(g(n)). Which of the following is implied by this fact?
g(n) = Ω(f (n))
g(n) = O(f (n))
Both
Neither
Correct
If f (n) = O(g(n)), is it true that 2f (n) = O 2g(n) ?
Yes
No
Correct
2 Examples
What is the smallest exponent x such that
n2 + n3 − n = O(nx )?
Correct
Which of the following describes n(n + 1)(n + 2)/6?
O(n4 )
O(n3 )
Θ(n3 )
Ω(n2 )
All of the above
Correct
For which exponents x is n(n + 1)/2 = Θ(nx )?
1
2
3
All of the above
Correct
For which function g(n) is it true that n2 = O(g(n))?
g(n) = 1.01n
g(n) = 2n · sin(πn/2)
g(n) = 2n · cos(πn/2)
All of the above
Correct