Huazhong University of Science and Technology
The Department of Electronics and Information Engineering
Electronic Circuit Analysis and Design
Dr. Tianping Deng
Email: [email protected]
Contents
PART
can be an aesthetic experience, much like
writing poetry or composing music.
Knuth pays $2.56 for the first person to
find each error in his books and $0.32 for
significant suggestions. If you send hi
12 cents, the greedy algorithm using
quarters, 12-cent coins, dimes, nickels,
and pennies would not always produce
change using the fewest coins possible.
57. Use Algorithm 7 to schedule the
largest n
we could add talks in order of shortest
time, we could add talks in order of
earliest finish time, or we could use some
other criterion. We now consider these
possible criteria. Suppose we add the tal
profound influence on the development of
computer science, which he began writing
as a graduate student in 1962, focusing on
compilers. In common jargon, Knuth,
referring to The Art of Computer
Progra
the functions f and g for sufficiently large
numbers in the domains of these
functions. However, it is acceptable to
write f (x) O(g(x) because O(g(x)
represents the set of functions that are
O(g(x).
It follows that C = 3 and k = 2 are also
witnesses to the relation f (x) is O(x2). 4x
2 x 2 x 2 + 2x + 1 1 2 4 3 2 1 The part of
the graph of f(x) = x 2 + 2x + 1 that
satisfies f(x) < 4x 2 is shown in
of the Growth of Functions Commonly
Used in Big-O Estimates. P1: 1 CH03-7T
Rosen-2311T MHIA017-Rosen-v5.cls May
13, 2011 10:24 212 3 / Algorithms
USEFUL BIG-O ESTIMATES INVOLVING
LOGARITHMS, POWERS, A
attended lectures presented by the
famous number theorist Dirichlet. He
received his doctorate under the German
number theorist Kummer in 1862; his
thesis was on group theory. Bachmann
was a professor
the suitors who have proposed to this
suitee in this round or previous rounds.
The proposal of this highest ranking
suitor remains pending and is rejected in
a later round if a more appealing suitor
p
three-volume exposition on number
theory as well as other books on number
theory and mathematical analysis. P1: 1
CH03-7T Rosen-2311T MHIA017-Rosenv5.cls May 13, 2011 10:24 208 3 /
Algorithms f (x) k
integers is nondecreasing if each term of
the list is at least as large as the preceding
term.) 31. Devise an algorithm that finds
the first term of a sequence of integers
that equals some previous te
estimate and the fact that 3n is O(n),
Theorem 3 gives the estimate that 3n
log(n!) is O(n2 log n). Next, the product
(n2 + 3) log n will be estimated. Because
(n2 + 3) < 2n2 when n > 2, it follows th
C2|g(x)| whenever x>k. The existence of
the constants C1, C2, and k tells us that f
(x) is (g(x) and that f (x) is O(g(x),
respectively. Usually, when big-Theta
notation is used, the function g(x)in
(
term of the sequence remains. When this
is done, a comparison is made to see
whether this term equals x. Sorting
Ordering the elements of a list is a
problem that occurs in many contexts. For
example,
product of two functions, suppose that
f1(x) is O(g1(x) and f2(x) is O(g2(x).
From the definition of big-O notation,
there are constants C1, C2, k1, and k2
such that |f1(x)| C1|g1(x)| when x>k1,
and |
to add to the pile of change without
exceeding n cents. For example, to make
change for 67 cents, we first select a
quarter (leaving 42 cents). We next select
a second quarter (leaving 17 cents),
foll
words that could be formed from the
letters in Zieglers Giant Bar. This won a
television set for his school and a candy
bar for everyone in his class. Knuth had a
difficult time choosing physics over
linear and binary search algorithms to
find an element in a sequence of n
elements. We will also estimate the
number of comparisons used by the P1: 1
CH03-7T Rosen-2311T MHIA017-Rosenv5.cls May 13, 20
polynomial. Theorem 1 does this. It shows
that the leading term of a polynomial
dominates its growth by asserting that a
polynomial of degree n or less is O(xn).
THEOREM 1 Let f (x) = anxn + an1xn1
+
inequality n < 2n, we quickly can conclude
that n is O(2n) by taking k = C = 1 as
witnesses. Note that because the
logarithm function is increasing, taking
logarithms (base 2) of both sides of this
in
7), which can be established directly by
turning the inequality around. P1: 1
CH03-7T Rosen-2311T MHIA017-Rosenv5.cls May 13, 2011 10:24 3.2 The Growth
of Functions 215 Often, it is important to
know
theory. The big-O symbol is sometimes
called a Landau symbol after the German
mathematician Edmund Landau, who
used this notation throughout his work.
The use of big-O notation in computer
science was
both an upper and are the Greek
uppercase letters omega and theta,
respectively. and a lower bound on the
size of a function f (x), relative to a
reference function g(x), we use bigTheta
(big-) notati
element among the remaining elements is
found and put into the second position.
This procedure is repeated until the
entire list has been sorted. 41. Sort these
lists using the selection sort. a) 3, 5
amount of fiber. Surprisingly, one of the
simplest approaches often leads to a
solution of an optimization problem. This
approach selects the best choice at each
step, instead of considering all seque
That is, we will show there are unsolvable
problems. The problem we will study is
the halting problem. It asks whether there
is a procedure that does this: It takes as
input a computer program and inp
sorting algorithms. A surprisingly large
number of sorting algorithms have been
devised using distinct strategies, with
new ones introduced regularly. In his
fundamental work, The Art of Computer
Prog
Example 6 big-O estimates will be
developed for the factorial function and
its logarithm. These estimates will be
important in the analysis of the number of
steps used in sorting procedures.
EXAMPLE 6