CSC375 Homework3 George Corser 2009-01-26

CSC375 Homework3 George Corser 2009-01-26 - CSC 375...

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

View Full Document Right Arrow Icon
CSC 375 Homework3 George Corser 2009 January 26 3.1 All five expressions in Figure 3.1 return zero at n=0. We don’t allow negative efficiency, i.e. negative values of n. So 2n 2 is most efficient between 0 and 1; 5n log n is most efficient between 1 and about 1.3; 2 n is most efficient between about 1.3 and 5.9; and 10n is most efficient above that. These expressions intersect twice, once where 5n log n = 2 n , and again where 2 n =10n. We can solve for more precise values at the intersections of the expressions as explained below. For 5n log n = 2 n we can write log 2 n 5n = 2 n which is the same as n 5n = 2 2 n , or n 5n = 4 n . Reducing the equation by taking the logarithm of both sides, we write log n 5n = 5n log n = n log 4, which means that 5 log n = log 4, log n 5 = log 4, or n 5 = 4. That means n= 5 4 ≈ 1.3195, or more accurately that the most efficient algorithm is 5n log n in the range 0 < n ≤ 5 4 . From
Background image of page 1

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

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

This note was uploaded on 01/19/2010 for the course CSC 375 taught by Professor Turner during the Winter '09 term at University of Michigan-Dearborn.

Page1 / 5

CSC375 Homework3 George Corser 2009-01-26 - CSC 375...

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

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