University of Manitoba
COMP 3170, Winter 2018
Assignment 1
Due Date: Wednesday, January 24, at 8:00pm
All problems are written problems; submit your solutions electronically as a PDF files
via UMlearn. Most question
...
University of Manitoba
COMP 3170, Winter 2018
Assignment 1
Due Date: Wednesday, January 24, at 8:00pm
All problems are written problems; submit your solutions electronically as a PDF files
via UMlearn. Most questions include an example accompanied with an answer which is
aimed to provide some guideline on how the solutions should look like. Think of them as
a tool for reviewing the material. Your solutions do not necessarily need to look
like provided answers. There are 63 marks available. The assignment will be marked
out of 60. Please read http://www.cs.umanitoba.ca/~kamalis/comp3170/info.pdf for
guidelines on academic integrity.
Throughout the assignment, all logarithms are based 2 logarithms, i.e., log x = log2
(x).
Problem 1 [4+4+4+4+4=20 marks]
Provide a complete proof of the following statements from first principles (i.e., using the
original definitions of order notation).
Ex.) 15n
3 + 10n
2 + 20 ∈ O(n
3
)
Consider M := 15 + 10 + 20 = 45 and n0 := 1. Then 0 ≤ 15n
3 + 10n
2 + 20 ≤ Mn3
for
all n ≥ n0.
a) n
2 +
3n
2
2+cos(n)
∈ O(n
2
)
For any value of n, we have cos(n) ≥ −1 and hence 3n
2
2+cos(n) ≤ 3n
2
. So f(n) ≤ n
2+3n
2 =
4n
2
. So, it suffices to have n0 ≥ 1 and M ≥ 4.
b) 2n
2
(log n) ∈ Ω(n(log n)
2
).
We need to provide n0 and M s.t. for n > n0 we have 2n
2
log n ≥ Mn(log n)
2
, i.e.,
2n ≥ M log n. Since n > log n for all positive integers, it suffices to have n0 ≥ 1 and
M ≤ 2.
c) 10n
2/(n − 10) ∈ Θ(n).
Assume n0 ≥ 19. For n > n0, we have n/2 ≤ n − 10 < n, which implies 10n < 10n
2
n−10 ≤
20n. So is suffices to define M1 ≤ 10 and M2 ≥ 20.
d) 1396n ∈ o(n log n)
Given any value of M, we should provide n0 so that 1396n < Mn log n, i.e,. 1396/M <
log n. For this to hold, it suffices to have n > 2
1396/M. So it suffices to define n0 as
max{1, 2
1396/M}.
e) n
n ∈ ω(n
20)
Set n0 := 21 + M. Then, for n ≥ n0, we have n
n = n
n−20n
20 ≥ (21 + M)
1+Mn
20. Since
(21 + M)
1+M > M, this shows
[Show More]