HW2 (2).pdf - 1 a True max ≤ 1 max ≥ 2 Therefore 0 ≤ 1 ∗ max ≤ ≤ 2 ∗ max� 1 Where 1 = � 2 2 = 1 so by definition max = � b i False 1

HW2 (2).pdf - 1 a True max ≤ 1 max ≥ 2 Therefore 0 ≤...

This preview shows page 1 - 2 out of 2 pages.

1. a. True. max(?(𝑛), ?(𝑛)) ≤ ?(𝑛) + ?(𝑛) max(?(𝑛), ?(𝑛)) ≥ 1 2 (?(𝑛) + ?(𝑛)) Therefore, 0 ≤ ? 1 ∗ max(?(𝑛), ?(𝑛)) ≤ ?(𝑛) + ?(𝑛) ≤ ? 2 ∗ max (?(𝑛), ?(𝑛) Where ? 1 = 1 2 , ? 2 = 1 , so by definition max(?(𝑛), ?(𝑛)) = 𝜃(?(𝑛) + ?(𝑛)) b. i. False Counterexample: ?(𝑛) = 1 ? , 𝑖? ? > 1, ?(𝑛) < ?(𝑛) + ? , so ?(𝑛) + ? ≠ 𝑂(?(𝑛) ii. True. By definition, if ?(𝑛) 𝜖 𝑂(𝑛), ?(𝑛) ≤ ? ∗ 𝑛 Therefore, ?(𝑛) + ? 𝜖 ? ∗ 𝑛 + ? ≤ (? + ? ? ) ∗ 𝑛 ≤ ? ∗ 𝑛 So ?(𝑛) + ? 𝜖 𝑂(𝑛) c. i. False Counterexample: ?(𝑛) = 2 1/? , ?(𝑛) = 2 1/? 2 , ?(𝑛) = 𝑂(?(𝑛)) , But log(?(𝑛)) > log(?(𝑛)) , so log(?(𝑛)) ≠ 𝑂(log(?(𝑛))) ii. True If ?(𝑛) = 𝑂(?(𝑛)), then ?(𝑛) ≤ ? ∗ ?(𝑛) for some constant c Therefore, log (?(𝑛)) ≤ log (? ∗ ?(𝑛)) ≤ ? ∗ log (?(𝑛)) , where ? = log (?) By definition then, log (?(𝑛)) = 𝑂(log (?(𝑛)) d. i. False Counterexample: ?(𝑛) = 2 ? , ?(2𝑛) = 2
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Fall '19
  • 

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture