Data Structures & Alogs HW_Part_4

Data Structures & Alogs HW_Part_4 - 13 iii. Induction...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
13 iii. Induction Step. Consider the case where n +1 pigeons are in n holes. Eliminate one hole at random. If it contains one pigeon, eliminate it as well, and by the induction hypothesis some other hole must contain at least two pigeons. If it contains no pigeons, then again by the induction hypothesis some other hole must con- tain at least two pigeons (with an extra pigeon yet to be placed). If it contains more than one pigeon, then it f ts the requirements of the theorem directly. 2.26 (a) When we add the n th line, we create n new regions. But, we start with one region even when there are no lines. Thus, the recurrence is F ( n )= F ( n 1) + n +1 . (b) This is equivalent to the summation F ( n )=1+ i =1 ni . (c) This is close to a summation we already know (equation 2.1). 2.27 Base case : T ( n 1)=1=1(1+1) / 2 . Induction hypothesis : T ( n 1)=( n 1)( n ) / 2 . Induction step : T ( n )= T ( n 1) + n =( n 1)( n ) / 2+ n = n ( n +1) / 2 . Thus, the theorem is proved by mathematical induction. 2.28 If we expand the recurrence, we get T ( n )=2 T ( n 1) + 1 = 2(2 T ( n 2)+1)+1)=4 T ( n 2+2+1 . Expanding again yields T ( n )=8 T ( n 3)+4+2+1 . From this, we can deduce a pattern and hypothesize that the recurrence is equivalent to T ( n )= n X i =0 12 i =2 n 1 . To prove this formula is in fact the proper closed form solution, we use math- ematical induction. Base case : T (1) = 2 1 1=1 .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
14 Chap. 2 Mathematical Preliminaries Induction hypothesis : T ( n 1)=2 n 1 1 .
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/31/2011 for the course BCN 3431 at University of Florida.

Page1 / 4

Data Structures & Alogs HW_Part_4 - 13 iii. Induction...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online