首页 > > 详细

601.433/63辅导、编程辅导、辅导601.433/633 Introduction to Algorithms Fall 解析Haskell程序|辅导

601.433/633 Introduction to Algorithms Fall 2018
Homework #1 Due: September 13, 2018, 1:30pm
Remember: you may work in groups of up to three people, but must write up your solution
entirely on your own. Collaboration is limited to discussing the problems – you may not look at,
compare, reuse, etc. any text from anyone else in the class. Please include your list of collaborators
on the first page of your submission. You may use the internet to look up formulas, definitions,
etc., but may not simply look up the answers online.
Please include proofs with all of your answers, unless stated otherwise.
1 Asymptotic Notation (40 points)
For each of the following statements explain if it true or false and prove your answer. The base of
log is 2 unless otherwise specified, and ln is loge
(a) log(n70) = O(log(n1/2))
(b) 2n = Θ(en)
(c) 1000(n log2 n +12n2) = Θ(n2)
(d) 3n = Θ(3(n?4))
(e) n cos n = Θ(n)
(f) Let f, g be positive functions. Then f(n) + g(n) = ?(min(f(n), g(n)))
(g) Let f, g be positive functions, and let g(n) = o(f(n)). Then f(n) + g(n) = Θ(f(n))
(h) 25 log n = O(n2)
2 Recurrences (35 pts)
Solve the following recurrences, giving your answer in Θ notation. For each of them you may
assume T(x) = 1 for x ≤ 5 (or if it makes the base case easier you may assume T(x) is any other
constant for x ≤ 5). Justify your answer (formal proof not necessary, but recommended).
(a) T(n) = 3T(n ? 5)
(b) T(n) = n2/3T(n1/3) + n
(c) T(n) = 4T(n/3) + n
(d) T(n) = 4T(n/4) + n log4 n
(e) T(n) = T(n ? 3) + 5
3 Basic Proofs (25 pts)
(a) Let A, B, C, D be sets. Prove that
(A ∪ B) ∩ (C ∪ D) = (A ∩ C) ∪ (B ∩ C) ∪ (A ∩ D) ∪ (B ∩ D)
(b) There are 130 students registered for this class. Prove that there are at least 11 students who
were all born in the same month.
(c) Prove by induction that Pn
i=1(2i ? 1) = n
for all positive integers n.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!