chapter1 - Chapter 1Solutions February 2, 2007 2 1.1. A...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1Solutions February 2, 2007 2 1.1. A single digit number is at most b 1, therefore the sum of any three such numbers is at most 3 b 3. On the other hand, a two-digit number can be as large as b 2 1. It is enough to show that b 2 1 3 b 3. Indeed, b 2 1 3 b 3 = ( b 1) ( b 2), which is 0 for b 2. 1.2. For a number N we need log 2 ( N + 1) binary digits and log 10 ( N + 1) decimal digits. By the logarithm conversion formula: log 10 ( N + 1) = log 2 ( N + 1) log 2 (10) log 2 ( N + 1) log 2 (10) = 4 log 2 ( N + 1) . For very large numbers, log 2 ( N + 1) log 2 (10) log 2 ( N + 1) log 2 (10) so the required ratio is approximately equal to log 2 (10) 3 . 8. 1.3. The minimum depth of a d-ary tree is achieved when all nodes have precisely d children. In that case, the depth is log d ( n ). For any d-ary tree, we have depth D log d ( n ) = log( n ) log( d ) = ( log( n ) log( d ) ) 1.4. We can lower bound n ! as parenleftBig n 2 parenrightBig parenleftBig n 2 parenrightBig bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright n 2 terms 1 2 3 parenleftBig n 2 parenrightBig parenleftBig n 2 + 1 parenrightBig n bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright n 2 terms and upper bound it as 1 2 3 n bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright n terms n n bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright n terms Hence, parenleftBig n 2 parenrightBig n 2 n ! n n , n 2 log( n 2 ) log( n !) n log n, 1 2 ( n log n n ) log( n !) n log n. 1.5. Upper bound: n summationdisplay i =1 1 i =1 + 1 2 + 1 3 + 1 4 + 1 + 1 2 + 1 2 + 1 4 + 1 4 + 1 4 + 1 4 + + 1 2 k + + 1 2 k bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright 2 k terms = = 1 + 1 + + 1 + 1 bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright O (log n ) terms = = O (log n ) 3 Lower bound: n summationdisplay i =1 1 i =1 + 1 2 + 1 3 + 1 4 + 1 + 1 2 + 1 4 + 1 4 + 1 8 + 1 8 + 1 8 + 1 8 + 1 2 k + + 1 2 k bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright 2 k 1 terms = =1 + 1 2 + 1 2 + + 1 2 + 1 2 bracehtipupleft bracehtipdownrightbracehtipdownleft bracehtipupright (log n ) terms = =(log n ) 1.6. First observe that multiplication of a number N by a one-digit binary number b results in the number 0 if b = 0 and N if b = 1. Also, multiplication of a binary number by 2 k for any power of 2 results in shifting N to the left k times and adding k digits equal to 0 at the end....
View Full Document

Page1 / 9

chapter1 - Chapter 1Solutions February 2, 2007 2 1.1. A...

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

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