Name COP 4531 Assignment 1 September 11, 2011 p. 61 3-1 Asymptotic behavior of polynomials Let π(π) = ∑ππ=0 ππ ππ , where ππ > 0, be a degree-π polynomial in π, and let π be a constant. Use the definitions of the asymptotic notations to prove the following properties. a. If π ≥ π, then π(π) = π(ππ ). b. If π ≤ π, then π(π) = Ω(ππ ). c. If π = π, then π(π) = Θ(ππ ). d. If π > π, then π(π) = π(ππ ). e. If π < π, then π(π) = π(ππ ). 3-2 Relative asymptotic growths Indicate, for each pair of expressions (π΄, π΅) in the table below, whether π΄ is π, π, Ω, π, or Θ of π΅. Assume that π ≥ 1, π > 0, and π > 1 are constants. Your answer should be in the form of the table with "yes" or "no" written in each box. a. b. c. d. e. f. π΄ lg π π ππ √π 2π πlg π lg(π!) π΅ ππ ππ π π Ω π Θ πsin π 2π/2 π lg π lg(ππ ) p. 108 4-4 Fibonacci Numbers This problem develops properties of the Fibonacci numbers, which are defined by recurrence (3.22). We shall use the technique of generating functions to solve the Fibonacci recurrence. Define the generating function (or formal power series) β± as ∞ β±(π§) = ∑ πΉπ π§ π π=0 = 0 + π§ + π§ 2 + 2π§ 3 + 3π§ 4 + 5π§ 5 + 8π§ 6 + 13π§ 7 + 21π§ 8 + β―, where πΉπ is the πth Fibonacci number. a. Show that β±(π§) = π§ + π§β±(π§) + π§ 2 β±(π§) . b. Show that π§ β±(π§) = 1−π§−π§ 2 π§ = (1−ππ§)(1−πΜπ§) = 1 √5 1 1 (1−ππ§ − 1−πΜπ§), where π= 1+√5 2 = 1.61803 … and 1−√5 πΜ = = −0.61803 … . 2 c. Show that β±(π§) = ∑∞ π=0 d. 1 √5 (π π − πΜ π )π§ π . Use part (c) to prove that πΉπ = ππ √5 for π > 0, rounded to the nearest integer. (Hint: Observe that |πΜ| < 1.) p. 166 6-1 Building a heap using insertion We can build a heap by repeatedly calling MAX-HEAP-INSERT to insert the elements intot he heap. Consider the following variation on the BUILD-MAX-HEAP procedure: BUILD-MAX-HEAP' (A) 1 A.heap-size = 1 2 for i = 2 to A.length 3 MAX-HEAP-INSERT(A, A[i]) a. Do the procedures BUILD-MAX-HEAP and BUILD-MAX-HEAP' always create the same heap when run on the same input array? Prove that they do, or provide the counterexample. b. Show that in the worst case, BUILD-MAX-HEAP' requires Θ(π lg π) time to build an π-element heap.