

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This is the handout for homework 2 in the algorithm design and analysis course at pennsylvania state university for the fall 2008 semester. It includes reminders for the homework policy, collaborations, and grading. It also provides exercises and problems related to the course material, including asymptotic notation, greedy algorithms, and d-ary heaps.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Please refer to the general information handout for the full homework policy and options.
Reminders
Reading Review chapter 4.1-4.5 in Kleinberg Tardos.
Exercises These should not be handed in, but the material they cover may appear on exams:
Claim 1 In any set of h horses, all horses are the same color.
Proof: We proceed by induction on the number h of horses. (Base case) If h = 1, then there is only one horse in the set, and so all the horses in the set are clearly the same color.
(Induction Step) For k ≥ 1, we assume that the claim holds for h = k and prove that it is true for h = k + 1. Take any set H of k + 1 horses. We show that all horses in this set are of the same color. Remove one horse from this set to obtain the set H 1 with just k horses. By the induction hypothesis, all the horses in H 1 are the same color. Now replace the removed horse and remove a different one to obtain a the set H 2. By the same argument, all the horses in H 2 are the same color. Therefore all the horses in H must be the same color, and the proof is complete.
Problems to be handed in
Page limits: The answer to each problem should fit in 2 pages (or one double-sided sheet) of paper. Longer answers will be penalized.
∑n i=1 fi(n) =^ O(n
(c) For what positive number a does the following hold (prove the correcntess of your answer): The probability that a fair coin flipped n times (independently) comes up heads exactly n/2 times is Θ(n−a). (Hint: use Stirling’s approximation to approximate the number of strings in { 0 , 1 }n^ that have exactly n/2 ones. Stirling’s approximation is n! = (
2 πn)( ne )n(1 + wn) , where wn ≥ 0 for all n, and wn = O( (^1) n ).) (d) Prove that
∑n i=1 log (^2) (i) = Θ(n log (^2) (n)). (Hint: this sum is bounded below by n 2 log
(^2) ( n 2 ).)