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
2
n
= 10n, using the Lambert W function (explained at
en.wikipedia.org/wiki/Lambert_W
) we
can reduce as follows:
2
n
= 10n; 1 = 10n/
2
n
; 1 = 10ne
n(
ln
2)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '09
 Turner
 Data Structures, Lambert W function, Delay differential equation, George Corser, Euler's threebody problem, Lambert W

Click to edit the document details