comp 251 2016, assignment 1 c o m m e n t scrypto.cs.mcgill.ca/~crepeau/comp251/hw1-comments.pdf ·...
TRANSCRIPT
COMP 251 2016, Assignment 1 C O M M E N T S
1. Read Chapter 1. Solve Exercise 4.
No comment so far…
2. Either prove the following statement or exhibit a counter-example.
The solutions produced by both algorithms are equal
if and only if this is the only solution to the input instance.
Two things have to be proved here:
A) (this is the easier part) If there is only one solution to the input instance
then the solutions produced by both algorithms are equal.
B) (this is the harder part) If the solutions produced by both algorithms are equal
then this is the only solution to the input instance.
And remember that by the contrapositive formulation the latter one is equivalent to
If there are more than one solution to the input instance then
the solutions produced by both algorithms must be distinct.
3. Read Chapter 2. Prove formally that if
lni➝m∞ f(n)/g(n) = 0,
then f ∈ O(g), f ∉ Ω(g), O(f) ⊊ O(g), Ω(g) ⊊ Ω(f).
4.Solve the following Exercises [10%]
Note that in questions 3 and 4 the following notations are used: "⊊" and "⊂" both mean "strict subset of ". By the transitivity rule "f∈O(g)" implies that
"O(f)⊆O(g)" but not the strict inclusion "O(f)≠O(g)". You must also show "g∉O(f)" for the strict inclusion. Similar remarks apply to the 𝛺 part.
Note that in questions 3 and 4 the following notations are used: "⊊" and "⊂" both mean "strict subset of ". I expect an answer of the form below
O(n) ⊂ O(n2) = O(n2+2n+1) ⊂ O(n3). You will not be able to apply L’Hôpital’s rule when n! is involved. You need some small reasoning to solve these.
Explain what is wrong with the following reasoning : No comment so far…
Which of the following statements are true? (Prove formally each of your answers.) No comment soi far…
No comment so far…
[10%][15%]
[15%]