An Introduction To The Analysis of Algorithms 3rd Edition Michael Soltys - Get Instant Access To The Full Ebook Content
An Introduction To The Analysis of Algorithms 3rd Edition Michael Soltys - Get Instant Access To The Full Ebook Content
com
https://ebookgate.com/product/an-introduction-to-the-
analysis-of-algorithms-3rd-edition-michael-soltys/
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookgate.com/product/an-introduction-to-the-analysis-of-
algorithms-2nd-edition-michael-soltys/
ebookgate.com
https://ebookgate.com/product/an-introduction-to-harmonic-
analysis-3rd-edition-yitzhak-katznelson/
ebookgate.com
https://ebookgate.com/product/introduction-to-the-design-and-analysis-
of-algorithms-3ed-edition-levitin-a/
ebookgate.com
https://ebookgate.com/product/an-introduction-to-discourse-analysis-
theory-and-method-3rd-edition-james-paul-gee/
ebookgate.com
Linear Programming An Introduction to Finite Improvement
Algorithms 2nd Edition Daniel Solow
https://ebookgate.com/product/linear-programming-an-introduction-to-
finite-improvement-algorithms-2nd-edition-daniel-solow/
ebookgate.com
https://ebookgate.com/product/introduction-to-energy-analysis-3rd-
edition-kornelis-blok/
ebookgate.com
https://ebookgate.com/product/an-introduction-to-
neuroendocrinology-2nd-edition-michael-wilkinson/
ebookgate.com
https://ebookgate.com/product/analysis-of-algorithms-an-active-
learning-approach-1st-edition-jeffrey-j-mcconnell/
ebookgate.com
https://ebookgate.com/product/an-introduction-to-biostatistic-3rd-
edition-thomas-glover/
ebookgate.com
An Introduction to the
Analysis of Algorithms
3rd Edition
Michael Soltys
California State University Channel Islands, USA
World Scientific
NEW JERSEY • LONDON • SINGAPORE • BEIJING • SHANGHAI • HONG KONG • TA I P E I • CHENNAI • TOKYO
For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance
Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to photocopy
is not required from the publisher.
ISBN 978-981-3235-90-8
Printed in Singapore
To my family
v
b2530 International Strategic Relations and China’s National Security: World at the Crossroads
Preface
vii
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page viii
should have been triggered never went off, leading to a chain of events that
climaxed in a cascading blackout. The Ariane 5, flight 501, the maiden
flight of the rocket in June 4, 1996, ended with an explosion 40 seconds
into the flight; this $500 million loss was caused by an overflow in the
conversion from a 64-bit floating point number to a 16-bit signed integer.
When Richard A. Clarke, the former National Coordinator for Security,
asked Ed Amoroso, head of AT&T Network Security, what is to be done
about the vulnerabilities in the USA cyber-infrastructure, Amoroso said:
Software is most of the problem. We have to write software
which has many fewer errors and which is more secure3 .
Similarly, Fred D. Taylor, Jr., a Lt. Colonel in the United States Air Force
and a National Security Fellow at the Harvard Kennedy School, wrote:
The extensive reliance on software has created new and ex-
panding opportunities. Along with these opportunities, there
are new vulnerabilities putting the global infrastructure and
our national security at risk. The ubiquitous nature of the In-
ternet and the fact that it is serviced by common protocols
and processes has allowed anyone with the knowledge to create
software to engage in world-wide activities. However, for most
software developers there is no incentive to produce software
that is more secure4 .
Preface ix
This book draws on many sources. First of all, [Cormen et al. (2009)] is a
fantastic reference for anyone who is learning algorithms. I have also used as
reference the elegantly written [Kleinberg and Tardos (2006)]. A classic in
the field is [Knuth (1997)], and I base my presentation of online algorithms
on the material in [Borodin and El-Yaniv (1998)]. I have learned greedy
algorithms, dynamic programming and logic from Stephen A. Cook at the
University of Toronto. Section 9.3, a digest of relations, is based on lectures
given by Ryszard Janicki in 2008 at McMaster University. Section 9.4 is
based on logic lectures by Stephen A. Cook taught at the University of
Toronto in the 1990s.
I am grateful to Ryan McIntyre who proof-read the 3rd edition
manuscript, and updated the Python solutions, during the summer of 2017.
As stated at the beginning of this Preface, we aim to present a concise,
mathematically rigorous, introduction to the beautiful field of Algorithms. I
agree strongly with [Su (2010)] that the purpose of education is to cultivate
the “yawp”:
I sound my barbaric yawp over the root(top)s of the world!
which are words of John Keating, quoting a Walk Whitman poem ([Whit-
man (1892)]), in the movie Dead Poets Society. This yawp is the deep
yearning inside each of us for an aesthetic experience ([Scruton (2011)]).
Hopefully, this book will supply a yawp or two.
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page xi
Contents
Preface vii
1. Preliminaries 1
1.1 What is correctness? . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Complexity . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2 Division . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3 Euclid . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.4 Palindromes . . . . . . . . . . . . . . . . . . . . . 7
1.1.5 Further examples . . . . . . . . . . . . . . . . . . 9
1.2 Ranking algorithms . . . . . . . . . . . . . . . . . . . . . . 11
1.2.1 PageRank . . . . . . . . . . . . . . . . . . . . . . 11
1.2.2 A stable marriage . . . . . . . . . . . . . . . . . . 14
1.2.3 Pairwise Comparisons . . . . . . . . . . . . . . . . 17
1.3 Answers to selected problems . . . . . . . . . . . . . . . . 19
1.4 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2. Greedy Algorithms 29
2.1 Minimum cost spanning trees . . . . . . . . . . . . . . . . 29
2.2 Jobs with deadlines and profits . . . . . . . . . . . . . . . 37
2.3 Further examples and problems . . . . . . . . . . . . . . . 40
2.3.1 Make-change . . . . . . . . . . . . . . . . . . . . . 40
2.3.2 Maximum weight matching . . . . . . . . . . . . . 41
2.3.3 Shortest path . . . . . . . . . . . . . . . . . . . . 41
2.3.4 Huffman codes . . . . . . . . . . . . . . . . . . . . 45
2.4 Answers to selected problems . . . . . . . . . . . . . . . . 47
2.5 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
xi
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page xii
4. Dynamic Programming 71
4.1 Longest monotone subsequence problem . . . . . . . . . . 71
4.2 All pairs shortest path problem . . . . . . . . . . . . . . . 73
4.2.1 Bellman-Ford algorithm . . . . . . . . . . . . . . . 74
4.3 Simple knapsack problem . . . . . . . . . . . . . . . . . . 75
4.3.1 Dispersed knapsack problem . . . . . . . . . . . . 78
4.3.2 General knapsack problem . . . . . . . . . . . . . 79
4.4 Activity selection problem . . . . . . . . . . . . . . . . . . 80
4.5 Jobs with deadlines, durations and profits . . . . . . . . . 82
4.6 Further examples and problems . . . . . . . . . . . . . . . 84
4.6.1 Consecutive subsequence sum problem . . . . . . 84
4.6.2 Shuffle . . . . . . . . . . . . . . . . . . . . . . . . 85
4.7 Answers to selected problems . . . . . . . . . . . . . . . . 87
4.8 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5. Online Algorithms 95
5.1 List accessing problem . . . . . . . . . . . . . . . . . . . . 96
5.2 Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.2.1 Demand paging . . . . . . . . . . . . . . . . . . . 101
5.2.2 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.2.3 LRU . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.2.4 Marking algorithms . . . . . . . . . . . . . . . . . 108
5.2.5 FWF . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.2.6 LFD . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.3 Answers to selected problems . . . . . . . . . . . . . . . . 114
5.4 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page xiii
Contents xiii
Contents xv
Bibliography 295
Index 303
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 1
Chapter 1
Preliminaries
1
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 2
Preliminaries 3
1.1.1 Complexity
Given an algorithm A, and an input x, the running time of A on x is the
number of steps it takes A to terminate on input x. The delicate issue here
is to define a “step,” but we are going to be informal about it: we assume
a Random Access Machine (a machine that can access memory cells in a
single step), and we assume that an assignment of the type x ← y is a
single step, and so are arithmetical operations, and the testing of Boolean
expressions (such as x ≥ y ∧ y ≥ 0). Of course this simplification does
not reflect the true state of affairs if for example we manipulate numbers
of 4,000 bits (as in the case of cryptographic algorithms). But then we
redefine steps appropriately to the context.
We are interested in worst-case complexity. That is, given an algorithm
A, we let T A (n) to be the maximal running time of A on any input x of size
n. Here “size” means the number of bits in a reasonable fixed encoding of x.
We tend to write T (n) instead of T A (n) as the algorithm under discussion
is given by the context. It turns out that even for simple algorithms T (n)
maybe very complicated, and so we settle for asymptotic bounds on T (n).
In order to provide asymptotic approximations to T (n) we introduce
the Big O notation, pronounced as “big-oh.” Consider functions f and
g from N to R, that is, functions whose domain is the natural numbers
but can range over the reals. We say that g(n) ∈ O(f (n)) if there exist
constants c, n0 ∈ N such that for all n ≥ n0 , g(n) ≤ cf (n), and the little o
notation, g(n) ∈ o(f (n)), which denotes that limn→∞ g(n)/f (n) = 0. We
also say that g(n) ∈ Ω(f (n)) if there exist constants c, n0 such that for
all n ≥ n0 , g(n) ≥ cf (n). Finally, we say that g(n) ∈ Θ(f (n)) if it is
the case that g(n) ∈ O(f (n)) ∩ Ω(f (n)). If g(n) ∈ Θ(f (n)), then f (n) is
called an asymptotically tight bound for g(n), and it means that f (n) is
a very good approximation to g(n). Note that in practice we will often
write g(n) = O(f (n)) instead of the formal g(n) ∈ O(f (n)); a slight but
convenient abuse of notation.
For example, an2 + bn + c = Θ(n2 ), where a > 0. To see this, note that
an + bn + c ≤ (a + |b| + |c|)n2 , for all n ∈ N, and so an2 + bn + c = O(n2 ),
2
1.1.2 Division
What could be simpler than integer division? We are given two integers,
x, y, and we want to find the quotient and remainder of dividing x by y.
For example, if x = 25 and y = 3, then q = 3 and r = 1. Note that the q
and r returned by the division algorithm are usually denoted as div(x, y)
(the quotient) and rem(x, y) (the remainder), respectively.
Preliminaries 5
Problem 1.3. What is the running time of algorithm 1.1? That is, how
many steps does it take to terminate? Assume that assignments (lines 1
and 2), and arithmetical operations (lines 4 and 5) as well as testing “≤”
(line 3) all take one step.
Problem 1.5. Write a program that takes as input x and y, and outputs
the intermediate values of q and r, and finally the quotient and remainder
of the division of x by y.
1.1.3 Euclid
Given two positive integers a, b, their greatest common divisor, denoted
as gcd(a, b), is the greatest integer that divides both. Euclid’s algorithm,
presented as algorithm 1.2, is a procedure for finding the greatest common
divisor of two numbers. It is one of the oldest know algorithms; it appeared
in Euclid’s Elements (Book 7, Propositions 1 and 2) around 300 BC.
Note that to compute rem(n, m) in lines 1 and 3 of Euclid’s algorithm
we need to use algorithm 1.1 (the division algorithm) as a subroutine; this
is a typical “composition” of algorithms. Also note that lines 1 and 3 are
executed from left to right, so in particular in line 3 we first do m ← n,
then n ← r, and finally r ← rem(m, n). This is important for the algorithm
to work correctly, because when we are executing r ← rem(m, n), we are
using the newly updated values of m, n.
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 6
Problem 1.6. Show that for all m, n > 0, gcd(m, n) = gcd(n, rem(m, n)).
Now the correctness of Euclid’s algorithm follows from (1.3), since the
algorithm stops when r = rem(m, n) = 0, so m = q·n, and so gcd(m, n) = n.
Problem 1.7. Show that Euclid’s algorithm terminates, and establish its
Big O complexity.
Problem 1.8. How would you make the algorithm more efficient? This
question is asking for simple improvements that lower the running time by
a constant factor.
Preliminaries 7
(a) Use the LNP to show that if g = gcd(m, n), then there exist a, b such
that am + bn = g.
(b) Design Euclid’s extended algorithm, and prove its correctness.
(c) The usual Euclid’s extended algorithm has a running time polynomial
in min{m, n}; show that this is the running time of your algorithm, or
modify your algorithm so that it runs in this time.
1.1.4 Palindromes
Algorithm 1.3 tests if a string is a palindrome, which is a word that read
the same backwards as forwards, e.g., madamimadam or racecar.
In order to present this algorithm we need to introduce a little bit of
notation. The floor and ceil functions are defined, respectively, as follows:
x = max{n ∈ Z|n ≤ x} and x = min{n ∈ Z|n ≥ x}, and x refers to
the “rounding” of x, and it is defined as x = x + 12 .
Let the loop invariant be: after the k-th iteration, i = k + 1 and for
all j such that 1 ≤ j ≤ k, A[j] = A[n − j + 1]. We prove that the loop
invariant holds by induction on k. Basis case: before any iterations take
place, i.e., after zero iterations, there are no j’s such that 1 ≤ j ≤ 0, so the
second part of the loop invariant is (vacuously) true. The first part of the
loop invariant holds since i is initially set to 1.
Induction step: we know that after k iterations, A[j] = A[n−j+1] for all
1 ≤ j ≤ k; after one more iteration we know that A[k+1] = A[n−(k+1)+1],
so the statement follows for all 1 ≤ j ≤ k+1. This proves the loop invariant.
Problem 1.11. Using the loop invariant argue the partial correctness of
the palindromes algorithm. Show that the algorithm terminates.
It is easy to manipulate strings in Python; a segment of a string is
called a slice. Consider the word palindrome; if we set the variables s to
this word,
s = ‘palindrome’
then we can access different slices as follows:
print s[0:5] palin
print s[5:10] drome
print s[5:] drome
print s[2:8:2] lnr
where the notation [i:j] means the segment of the string starting from the
i-th character (and we always start counting at zero!), to the j-th character,
including the first but excluding the last. The notation [i:] means from
the i-th character, all the way to the end, and [i:j:k] means starting from
the i-th character to the j-th (again, not including the j-th itself), taking
every k-th character.
One way to understand the string delimiters is to write the indices “in
between” the numbers, as well as at the beginning and at the end. For
example
0 p1 a2 l3 i4 n5 d6 r7 o8 m9 e10
and to notice that a slice [i:j] contains all the symbols between index i
and index j.
Problem 1.12. Using Python’s inbuilt facilities for manipulating slices of
strings, write a succinct program that checks whether a given string is a
palindrome.
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 9
Preliminaries 9
Problem 1.14. What does algorithm 1.4 compute? Prove your claim.
Problem 1.15. What does algorithm 1.5 compute? Assume that a, b are
positive integers (i.e., assume that the pre-condition is that a, b > 0). For
which starting a, b does this algorithm terminate? In how many steps does
it terminate, if it does terminate?
This algorithm is different from all the algorithms that we have seen thus
far in that there is no known proof of termination, and therefore no known
proof of correctness. Observe how simple it is: for any positive integer a, set
x = a, and repeat the following: if x is even, divide it by 2, and if it is odd,
multiply it by 3 and add 1. Repeat this until the last three values obtained
were 4, 2, 1. For example, if a = 22, then one can check that x takes on
the following values: 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, and
algorithm 1.6 terminates. It is conjectured that regardless of the initial
value of a, as long as a is a positive integer, algorithm 1.6 terminates. This
conjecture is known as “Ulam’s problem,”2 and despite decades of work no
one has been able to solve this problem.
In fact, recent work shows that variants of Ulam’s problem have been
shown undecidable. We will look at undecidability in Chapter 9, but [Lehto-
nen (2008)] showed that for a very simple variant of the problem where we
let x be 3x + t for x in a particular set At (for details see the paper), there
simply is no algorithm whatsoever that will decide for which initial a’s the
new algorithm terminates and for which it does not.
Problem 1.16. Write a program that takes a as input and displays all the
values of Ulam’s problem until it sees 4, 2, 1 at which point it stops. You
have just written an almost trivial program for which there is no proof of
termination. Now do an experiment: compute how many steps it takes to
reach 4, 2, 1 for all a < N , for some N . Any conjectures?
or “Hasse’s Algorithm.” While it is true that a rose by any other name would smell
just as sweet, the preponderance of names shows that the conjecture is a very alluring
mathematical problem.
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 11
Preliminaries 11
The algorithms we have seen so far in the book are classical but to some
extent they are “toy examples.” In this section we want to demonstrate the
power and usefulness of some very well known “grown up” algorithms. We
will focus on three different ranking algorithms. Ranking items is a primor-
dial human activity, and we will take a brief look at ranking procedures that
range from the ancient, such as Ramon Llull’s, a 13-th century mystic and
philosopher, to old, such as Marquis de Condorcet’s work discussed in Sec-
tion 1.2.3, to the state of the art in Google’s simple and elegant PageRank
discussed in the next section.
1.2.1 PageRank
In 1945, Vannevar Bush wrote an article in the Atlantic Monthly entitled
As we may think [Bush (1945)], where he demonstrated an eerie prescience
of the ideas that became the World Wide Web. In that gem of an article
Bush pointed out that information retrieval systems are organized in a lin-
ear fashion (whether books, databases, computer memory, etc.), but that
human conscious experience exhibits what he called “an associative mem-
ory.” That is, the human mind has a semantic network, where we think of
one thing, and that reminds us of another, etc. Bush proposed a blueprint
for a human-like machine, the “Memex,” which had ur-web characteristics:
digitized human knowledge interconnected by associative links.
When in the early 1990s Tim Berners-Lee finally implemented the ideas
of Bush in the form of HTML, and ushered in the World Wide Web, the web
pages were static and the links had a navigational function. Today links
often trigger complex programs such as Perl, PHP, MySQL, and while some
are still navigational, many are transactional, implementing actions such as
“add to shopping cart,” or “update my calendar.”
As there are now billions of active web pages, how does one search them
to find relevant high-quality information? We accomplish this by ranking
those pages that meet the search criteria; pages of a good rank will appear
at the top — this way the search results will make sense to a human reader
who only has to scan the first few results to (hopefully) find what he wants.
These top pages are called authoritative pages.
In order to rank authoritative pages at the top, we make use of the fact
that the web consists not only of pages, but also of hyperlinks that connect
these pages. This hyperlink structure (which can be naturally modeled by a
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 12
directed graph) contains a lot of latent human annotation that can be used
to automatically infer authority. This is a profound observation: after all,
items ranked highly by a user are ranked so in a subjective manner; exploit-
ing the hyperlink structure allows us to connect the subjective experience
of the users with the output of an algorithm!
More specifically, by creating a hyperlink, the author gives an implicit
endorsement to a page. By mining the collective judgment expressed by
these endorsements we get a picture of the quality (or subjective perception
of the quality) of a given web page. This is very similar to our perception
of the quality of scholarly citations, where an important publication is cited
by other important publications. The question now is how do we convert
these ideas into an algorithm. A seminal answer was given by the now
famous PageRank algorithm, authored by S. Brin and L. Page, the founders
of Google — see [Brin and Page (1998)]. PageRank mines the hyperlink
structure of the web in order to infer the relative importance of the pages.
Consider Figure 1.1 which depicts a web page X, and all the pages
T1 , T2 , T3 , . . . , Tn that point to it. Given a page X, let C(X) be the number
of distinct link that leave X, i.e., these are links anchored in X that point
to a page outside of X. Let PR(X) be the page rank of X. We also employ
a parameter d, which we call the damping factor, and which we will explain
later.
@ABC
GFED
T1 PP @ABC
GFED
T @ABC
GFED
T3 ... @ABC
GFED
Tn
PPP 2 AA
AA oooo
PPP
PPP AA ooo
PPP AA ooooo
PPPA ooo
' 89:;
?>=< wo
X
Preliminaries 13
Compute the PageRank of the different pages in this network using (1.4)
with damping factor d = 1, that is, assuming all navigation is done by
following links (no random jumps to other pages).
Problem 1.18. Write a program which computes the ranks of all the pages
in a given network of size N . Let the network be given as a 0-1 matrix,
where a 1 in position (i, j) means that there is a link from page i to page
j. Otherwise, there is a 0 in that position. Use (1.4) to compute the page
rank, starting with a value of 1/N . You should stop when all values have
converged — does this algorithm always terminate? Also, keep track of all
the values as fractions a/b, where gcd(a, b) = 1; Python has a convenient
fractions library: import fractions.
Preliminaries 15
b II g
II uu
II uuu
uI
uu III
zuu $
pM (g) pM (b)
Fig. 1.2 A blocking pair: b and g prefer each other to their partners pM (b) and pM (g).
algorithm due to Gale and Shapley ([Gale and Shapley (1962)]) that outputs
a stable marriage for any input B, G, regardless of the ranking3 .
The matching M is produced in stages Ms so that bt always has a
partner at the end of stage s, where t ≤ s. However, the partners of bt do not
get better, i.e., pMt (bt ) ≤t pMt+1 (bt ) ≤t · · · . On the other hand, for each
g ∈ G, if g has a partner at stage t, then g will have a partner at each stage
s ≥ t and the partners do not get worse, i.e., pMt (g) ≥t pMt+1 (g) ≥t . . ..
Thus, as s increases, the partners of bt become less preferable and the
partners of g become more preferable.
At the end of stage s, assume that we have produced a matching
Ms = {(b1 , g1,s ), . . . , (bs , gs,s )},
where the notation gi,s means that gi,s is the partner of boy bi after the
end of stage s.
We will say that partners in Ms are engaged. The idea is that at stage
s+1, bs+1 will try to get a partner by proposing to the girls in G in his order
of preference. When bs+1 proposes to a girl gj , gj accepts his proposal if
either gj is not currently engaged or is currently engaged to a less preferable
boy b, i.e., bs+1 <j b. In the case where gj prefers bs+1 over her current
partner b, then gj breaks off the engagement with b and b then has to search
for a new partner.
Problem 1.19. Show that each b need propose at most once to each g.
From problem 1.19 we see that we can make each boy keep a bookmark
on his list of preference, and this bookmark is only moving forward. When
a boy’s turn to choose comes, he starts proposing from the point where
his bookmark is, and by the time he is done, his bookmark moved only
forward. Note that at stage s + 1 each boy’s bookmark cannot have moved
beyond the girl number s on the list without choosing someone (after stage
3 In 2012, the Nobel Prize in Economics was awarded to Lloyd S. Shapley and Alvin E.
Roth “for the theory of stable allocations and the practice of market design,” i.e., for
the stable marriage algorithm.
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 16
s only s girls are engaged). As the boys take turns, each boy’s bookmark
is advancing, so some boy’s bookmark (among the boys in {b1 , . . . , bs+1 })
will advance eventually to a point where he must choose a girl.
The discussion in the above paragraph shows that stage s + 1 in algo-
rithm 1.7 must end. The concern here was that case (ii) of stage s+1 might
end up being circular. But the fact that the bookmarks are advancing shows
that this is not possible.
Furthermore, this gives an upper bound of (s + 1)2 steps at stage (s + 1)
in the procedure. This means that there are n stages, and each stage takes
O(n2 ) steps, and hence algorithm 1.7 takes O(n3 ) steps altogether. The
question, of course, is what do we mean by a step? Computers operate on
binary strings, yet here the implicit assumption is that we compare numbers
and access the lists of preferences in a single step. But the cost of these
operations is negligible when compared to our idealized running time, and
so we allow ourselves this poetic license to bound the overall running time.
Problem 1.20. Show that there is exactly one girl that was not engaged
at stage s but is engaged at stage (s + 1) and that, for each girl gj that is
engaged in Ms , gj will be engaged in Ms+1 and that pMs+1 (gj ) <j pMs (gj ).
(Thus, once gj becomes engaged, she will remain engaged and her partners
will only gain in preference as the stages proceed.)
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 17
Preliminaries 17
Problem 1.21. Suppose that |B| = |G| = n. Show that at the end of stage
n, Mn will be a stable marriage.
Problem 1.22. Show that our version of the algorithm produces a boy-
optimal and girl-pessimal stable matching. Does this mean that they order-
ing of the boys is irrelevant?
Problem 1.25. Note that the wi ’s that appear in Theorem 1.24 create a
ranking, in that xj is preferable to xi if and only if wi < wj . Suppose that
A is a consistent PC matrix. How can you extract the wi ’s from A?
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 19
Preliminaries 19
Problem 1.26. [Bozóki and Rapcsák (2008)] propose several methods for
measuring inconsistencies in a matrix (see especially Table 1 on page 161
of their article). Consider implementing some of these measures. Can you
propose a method for resolving inconsistencies in a PC matrix?
Problem 1.1. (∀I ∈ IA )[∃O(O = A(I)) ∧ (αA (I) → βA (A(I)))]. This says
that for any well formed input I, there is an output, i.e., the algorithm A
terminates. This is expressed with ∃O(O = A(I)). Also, it says that if the
well formed input I satisfies the pre-condition, stated as the antecendent
αA (I), then the output satisfies the post-condition, stated as the consequent
βA (A(I)).
Problem 1.2. Clearly,
an2 + bn + c ≥ an2 − |b|n − |c| = n2 (a − |b|/n − |c|/n2 ) (1.5)
|b| is finite, so ∃nb ∈ N such that |b|/nb ≤ a/4. Similarly, ∃nc ∈ N such
that |c|/n2c ≤ a/4. Let n0 = max{nb , nc }. For n ≥ n0 , a − |b|/n0 − |c|/n20 ≥
a − a/4 − a/4 = a/2. This, combined with (1.5), grants:
a 2
n ≤ an2 + bn + c
2
for all n ≥ n0 . We need only to assign c3 the value a/2 to complete the
proof that an2 + bn + c ∈ Ω(n2 ).
Next we deal with the general polynomial with a positive leading coef-
ficient. Let
k
k
i k
p(n) = ai n = n ai /nk−i ,
i=1 i=1
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 20
k
where ak > 0. Clearly p(n) ≤ nk i=1 |ai | for all n ∈ N, so p(n) = O(nk ).
Moreover, every ai is finite, so for each i ∈ N such that 0 ≤ i ≤ k − 1, ∃ni
such that ai /nk−i ≤ ak /2k for all n ≥ ni . Let n0 be the maximum of these
k−1
ni ’s. p(n) can be rewritten as nk (ak + i=0 ai /nk−i ), so
k−1
p(n) ≥ nk (ak − ai /nk−i ).
i=0
k−1
We have shown that for n ≥ n0 , i=0 ai /nk−i ≤ ak − k(ak /2k) = ak /2,
so let c = ak /2. For all n ≥ n0 , p(n) ≥ (ak − ak /2)nk = cnk . Thus,
p(n) = Ω(nk ).
We have shown that p(n) ∈ O(nk ) and p(n) ∈ Ω(nk ), so p(n) = Θ(nk ).
Problem 1.3. The while loop starts with r = x, and then y is subtracted
each time; this is bounded by x (the slowest case, when y = 1). Each time
the while loop executes, it tests y ≤ r, and recomputes r, q, and so it costs
3 steps. Adding the original two assignments (q ← 0,r ← x), we get a total
of 3x + 2 steps. Note that we assume that x, y are presented in binary
(the usual encoding), and that it takes log2 x bits to encode x, and so the
running time is 3 · 2log2 x + 2, i.e., the running time is exponential in the
length of the input! This is not a desirable running time; if x were big, say
1,000 bits, and y small, this algorithm would take longer than the lifetime
of the sun (10 billion years) to end. There are much faster algorithms for
division such as the Newton-Raphson method.
Problem 1.4. The original precondition (under which the algorithm is
correct) is:
x ≥ 0 ∧ y > 0 ∧ x, y ∈ N
where N = {0, 1, 2, . . . }. So in the first case our work has already been done
for us; any member of Z which is ≥ 0 is also in N (and any member of N is
in Z), so these preconditions are equivalent. Given that the algorithm was
correct under the original precondition, it is also correct under the new one.
In the second case it is not correct: consider x = −5 and y = 2, so initially
r = −5, and the loop would not execute, and r ≥ 0 in the post-condition
would not be true.
Problem 1.6. First observe that if u divides x and y, then for any a, b ∈ Z
u also divides ax + by. Thus, if i|m and i|n, then
i|(m − qn) = r = rem(m, n).
So i divides both n and rem(m, n), and so i has to be bounded by their
greatest common divisor, i.e., i ≤ gcd(n, rem(m, n)). As this is true
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 21
Preliminaries 21
am + bn = 0 · m + 1 · n = n = d
xm + yn = 1 · m + 0 · n = m = c
Preliminaries 23
result of one more full iteration of the loop on the “un-primed” variables:
Preliminaries 25
Problem 1.14. Algorithm 1.4 computes the product of m and n, that is,
the returned z = m · n. A good loop invariant is x · y + z = m · n.
Problem 1.17. We start by initializing all nodes to have rank 1/6, and
then repeatedly apply the following formulas, based on (1.4):
PR(A) = PR(F )
PR(B) = PR(A)
PR(C) = PR(B)/4 + PR(E)
PR(D) = PR(B)/4
PR(E) = PR(B)/4 + PR(D)
PR(F ) = PR(B)/4 + PR(C)
0 1 2 3 4 5 6 ... 17
A 0.17 0.17 0.21 0.25 0.29 0.18 0.20 0.22
B 0.17 0.17 0.17 0.21 0.25 0.29 0.18 0.22
C 0.17 0.21 0.25 0.13 0.14 0.16 0.19 ... 0.17
D 0.17 0.04 0.04 0.04 0.05 0.06 0.07 0.06
E 0.17 0.21 0.08 0.08 0.09 0.11 0.14 0.11
F 0.17 0.21 0.25 0.29 0.18 0.20 0.23 0.22
Total 1.00 1.00 1.00 1.00 1.00 1.00 1.00 ... 1.00
Fig. 1.3 Pagerank convergence in Problem 1.17. Note that the table is obtained with
a spreadsheet: all values are rounded to two decimal places, but column 1 is obtained
by placing 1/6 in each row, column 2 is obtained from column 1 with the formulas, and
all the remaining columns are obtained by “dragging” column 2 all the way to the end.
The values converged (more or less) in column 17.
Problem 1.19. After b proposed to g for the first time, whether this
proposal was successful or not, the partners of g could have only gotten
better. Thus, there is no need for b to try again.
Problem 1.20. bs+1 proposes to the girls according to his list of preference;
a g ends up accepting, and if the g who accepted bs+1 was free, she is the new
one with a partner. Otherwise, some b∗ ∈ {b1 , . . . , bs } became disengaged,
and we repeat the same argument. The g’s disengage only if a better b
proposes, so it is true that pMs+1 (gj ) <j pMs (gj ).
Problem 1.21. Suppose that we have a blocking pair {b, g} (meaning that
{(b, g ), (b , g)} ⊆ Mn , but b prefers g to g , and g prefers b to b ). Either b
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 26
came after b or before. If b came before b , then g would have been with
b or someone better when b came around, so g would not have become
engaged to b . On the other hand, since (b , g) is a pair, no better offer has
been made to g after the offer of b , so b could not have come after b . In
either case we get an impossibility, and so there is no blocking pair {b, g}.
Problem 1.22. To show that the matching is boy-optimal, we argue by
contradiction. Let “g is an optimal partner for b” mean that among all the
stable matchings g is the best partner that b can get.
We run the Gale-Shapley algorithm, and let b be the first boy who is
rejected by his optimal partner g. This means that g has already been
paired with some b , and g prefers b to b. Furthermore, g is at least as
desirable to b as his own optimal partner (since the proposal of b is the
first time during the run of the algorithm that a boy is rejected by his
optimal partner). Since g is optimal for b, we know (by definition) that
there exists some stable matching S where (b, g) is a pair. On the other
hand, the optimal partner of b is ranked (by b of course) at most as high
as g, and since g is taken by b, whoever b is paired with in S, say g , b
prefers g to g . This gives us an unstable pairing, because {b , g} prefer
each other to the partners they have in S.
Yes, this means that the ordering of the boys is immaterial, because
there is a unique boy-optimal matching, and it is independent of the order-
ing of the boys.
To show that the Gale-Shapley algorithm is girl-pessimal, we use the
fact that it is boy-optimal (which we just showed). Again, we argue by
contradiction. Suppose there is a stable matching S where g is paired
with b, and g prefers b to b, where (b , g) is the result of the Gale-Shapley
algorithm. By boy-optimality, we know that in S we have (b , g ), where g
is not higher on the preference list of b than g, and since g is already paired
with b, we know that g is actually lower. This says that S is unstable since
{b , g} would rather be together than with their partners.
1.4 Notes
This book is about proving things about algorithms; their correctness, their
termination, their running time, etc. The art of mathematical proofs is a
difficult art to master; a very good place to start is [Velleman (2006)].
On page vii we mentioned the North-East blackout of 2003. At the time
the author was living in Toronto, Canada, on the 14th floor of an apartment
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 27
Preliminaries 27
building (which really was the 13th floor, but as number 13 was outlawed
in Toronto elevators, after the 12th floor, the next button on the elevator
was 14). After the first 24 hours, the emergency generators gave out, and
we all had to climb the stairs to our floors; we would leave the building,
and scavenge the neighborhood for food and water, but as refrigeration was
out in most places, it was not easy to find fresh items. In short, we really
felt the consequences of that algorithmic error intimately.
In the footnote to Problem 1.10 we mention the Python library
matplotlib. Below we provide a simple example, plotting the functions
f (x) = x3 and h(x) = −x3 over the interval [0, 10] using this library:
import matplotlib.pyplot as plt
import numpy as np
def f(x):
return x**3
def h(x):
return -x**3
Input = np.arange(0,10.1,.5)
Outputf = [f(x) for x in Input]
Outputh = [h(x) for x in Input]
plt.plot(Input,Outputf,’r.’,label=’f - label’)
plt.plot(Input,Outputh,’b--’,label=’h - label’)
plt.xlabel(’This is the X axis label’)
plt.ylabel(’This is the Y axis label’)
plt.suptitle(’This is the title’)
plt.legend()
plt.show()
Of course, matplotlib has lots of features; see the documentation for more
complex examples.
The palindrome madamimadam comes from Joyce’s Ulysses. We discussed
the string manipulating facilities of Python in the section on palindromes,
Section 1.1.4, but perhaps the most powerful language for string manip-
ulations is Perl. For example, suppose that we have a text that contains
hashtags which are words of characters that start with ‘#’, and we wish to
collect all those hashtags into an array. One trembles at the prospect of
having to implement this in, say, the C programming language, but in Perl
October 27, 2017 10:59 BK032 - An Introduction to the Analysis of Algorithms (3rd Edition) soltys˙alg page 28
Chapter 2
Greedy Algorithms
29
Exploring the Variety of Random
Documents with Different Content
The Project Gutenberg eBook of Wars &
Treaties, 1815 to 1914
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
BY
ARTHUR PONSONBY
“It is the completest statement of the case for the democratic control of
foreign affairs which has been published, and contains a mass of facts whose
value cannot be exaggerated. We owe Mr. Ponsonby a great debt for this work.”—
Labour Leader.
“... Mr. Ponsonby’s main contention is one which may and should receive the
hearty assent of many who disagree with him in detail. He strongly urges the
necessity in dealing with foreign affairs of ensuring the co-operation and approval
of the great mass of the people. He is manifestly quite right.”—The late Lord
Cromer in The Spectator.
REBELS AND REFORMERS
(6s. net)
BY
ARTHUR & DOROTHEA PONSONBY
“Mr. and Mrs. Ponsonby’s book is intended for children or for those who are
too busy to read books in many volumes. But the interest of it lies not in the
necessarily short and simple narratives giving the story rather than the ideas,
although these are done clearly and with spirit, but in the reflections which lie
about those stories and lodge here and there in the reader’s mind. Like all books
worth reading this one is the outcome of a mass of judgments and beliefs which
may be very briefly expressed in the work itself, but lend it the gift which in the
case of human beings we call personality.”—The Times Literary Supplement.
“The story of these twelve lives is told in these pages—and told with a most
enticing simplicity and the happiest taste—in the hope of redressing the balance
between men of action and men of thought, and of showing that this type of
character and achievement can be made just as interesting to the young as the
more conventional hero of the history book.... This book is more especially for the
young, but it will be a delight also to grown-up readers.”—The Nation.
“The biographies are always well simplified and written in a clear and pointed
way. They are accompanied by portraits, which add not a little to the work’s
attractiveness as a book unusually well fitted to the needs of young readers who
are beginning to take an interest in history.”—The Scotsman.
WARS & TREATIES
1815 to 1914
BY
ARTHUR PONSONBY
1885 }
1885 Serbo-Bulgarian War 74
1894–1895 Chino-Japanese War 76
1895–1896 Italo-Abyssinian War 78
1896–1898 War in the Soudan 80
1897 Turko-Greek War 82
1897–1898 Spanish-American War 84
1881 } The Boer Wars 86
1899–1902
}
1899–1900 Boxer Rising in China 88
1904–1905 Russo-Japanese War 90
1911–1912 Turko-Italian War 92
1912–1913 First Balkan War 94
1913 Second Balkan War 96
Important Treaties 98
Index of Treaties 102
Bibliography 104
WARS AND TREATIES
1815–1914
INTRODUCTION
A growing number of people are devoting their attention to a closer
study of foreign affairs. Many of them may not have the opportunity
to read the larger volumes of histories; and, indeed, even if they
had, they would find their choice of books very much restricted
when they came to the more recent period of European and world
history, although in the last year or so the gap has to some extent
been filled up by several interesting studies of international politics
in the nineteenth century. Some knowledge of this period is essential
if we are to understand the full significance of the events of to-day,
and if we are to form any helpful opinion of the course to be
pursued in future.
Historians often take for granted that their readers already have
some general knowledge of the groundwork of events and they build
up their structure of criticism, their delineation of policy and
tendencies, and their survey of international problems on the
assumption that the scaffolding has been erected. But often it has
not, and then history, more especially the complex tangle of
international history, becomes difficult to grasp. It may therefore
serve some useful purpose if a few poles of scaffolding representing
the dates and outline of conflicts and agreements between nations
can be supplied in a very brief and easily intelligible form, a
presentment of the bare record of facts which may be useful for
reference.
During the last hundred years war has been a more common
occurrence in international intercourse than most people realize. The
forty-two records of wars tabled in these pages do not cover the
whole ground. They are the chief conflicts, or the conflicts fraught
with the most serious consequences, but they are by no means the
only occasions on which there was fighting in the world. Revolutions,
unless they led to international war, are not mentioned, neither are
expeditions such as the advance on Llassa, the Chitral expedition,
the Indian frontier wars, the Kaffir wars, the Somaliland expeditions,
the revolt of the Herreroes in German West Africa or the French
expeditions in Morocco: the wars between the states of South
America, with two exceptions, have also been omitted. But the list as
it stands, is striking enough and may suffice to make the student
inquire further into the circumstances which produced this almost
unceasing strife.
The causes are epitomized in the fewest possible words and the
occasion is separated from the cause. Causes of wars are very
seldom remembered and are not very easily discovered in the
perusal of histories. The occasion is sometimes mistaken for the
cause, whereas it may often be merely a pretext. The occasion of a
war has not infrequently been a comparatively trivial incident,
whereas the cause can be traced to the gradual development of
friction for which divergence of policies or conflict of ambitions may
have been responsible. The trivial incident, or even an incident of a
more serious nature, may pass off without fatal consequences if no
friction exists between the nations and there is a general
atmosphere of amicable understanding. Where, on the contrary,
relations are strained it requires but a very small spark to light up a
conflagration. It is important therefore to detach the occasion from
the cause.
Causes of war in the nineteenth century differ to some extent
from those of previous centuries. The elemental combative passion
of man expressing itself in fierce racial animosities is far less
noticeable. Religious differences do not figure so positively as a
reason for conflict. Dynastic ambitions linger on and still play a
formidable part, even after 1815, but not with the same unashamed
and aggressive arrogance as in bygone centuries. Nationalist
aspirations begin to assert themselves, and the waves of
revolutionary exasperation with outworn systems of despotic
government have made those very governments combat that spirit
by force of arms. As the century proceeds, and the wonderful
inventions for rapid transit and communication develop, the most
noticeable element in war-making is the commercial or colonial
ambition of governments fostered largely by the pressure of financial
interests and declaring itself under the name of Empire. This policy
of competitive imperial expansion in the newly accessible regions of
the globe will be found to constitute the most frequent cause of
dispute, of jealousy, and of suspicion between nations. The pretext
will vary, the excuse will be presented under plausible guises for
popular consumption, but the ultimate cause, the fundamental origin
will be the same. Imperialism economic in its origin is fostered
largely by an exaggerated spirit of nationalism.
The remarkable extent of Empire expansion in the latter part of
the nineteenth century is best illustrated by the following figures:—
Acquisitions of Territory
But perhaps the chief and most frequent cause of war is war
itself. In the Balkan Peninsula—where, whenever the fighting has
ceased, nothing approaching a satisfactory settlement has ever been
concluded—this is specially true. Eight or nine of the wars recorded
concern the Balkans. Or take the Crimean War. Sir Spencer Walpole
says:
“From 1856 to 1878 the Continent of Europe was afflicted with
five great wars—the Franco-Austrian War of 1859; the Danish of
1864; the Austro-Prussian of 1860; the Franco-German of 1870 and
the Russo-Turkish of 1878: all of which can be lineally traced to the
war of 1854,” and one at least of those wars, as we know, sowed the
seeds of future war. The war that is concluded by a dictated peace,
the war that leaves a sense of grievance and unsatisfied though
legitimate claims, the war that inspires a lasting desire for revenge
inevitably leads to future war. Wars are never aggressive but always
defensive on the part of those who are responsible for waging them.
Wars are never defensive but always aggressive on the part of those
against whom they are waged. The Ministers and monarchs do the
quarrelling, the people believe the version they are told and obey.
The people do the fighting and make the sacrifice, the Ministers and
monarchs do the treaty-making without consulting them. The
people’s part is one of valiance, endurance, and suffering; the part
of the Ministers and monarchs is one too often marred by failure and
frequently disfigured by intrigue and deception.
Cast your eye through these forty-two very brief records of wars.
Think of the valour, the determination, and the heroism of the
people, be they soldiers or civilians. Consider the noble part played
by those who without question obeyed what they were led to believe
was their country’s call. And then look on the other side at the
results—the ineptitude of the statesmen, the patched-up treaties,
the worthless agreements, the wars that led to further wars, the
failure to secure a settlement after the soldier had done his part, and
the unnecessary prolongation of conflicts when agreement might
have been reached by the exercise of a little wisdom and foresight.
The contrast is remarkable between the actions on the battlefield
and the intrigue in the council chamber. Blood has been spilt, lives
lost, and victories won often without any positive advantage being
gained in the final result.
The wars are arranged according to date. Some were long-
drawn-out struggles, others sharp conflicts of a few months. The
number of men engaged in any battle and the casualties if they
could be tabulated would no doubt seem comparatively small to our
modern eyes. The total loss of life in the Crimean War amounted to
1
about 600,000 men. An estimate of the loss in killed and wounded
in some of the other great battles may be given as follows: Solferino
(1859), 31,500; Chickamauga (1863), 35,100; Gettysburg (1863),
37,000; Königrätz (1866), 26,894; Vionville (1870), 32,800;
2
Gravelotte (1870), 30,000; Plevna (1877), 19,000; The Boer War
(1899–1902): British losses, 28,603; Boers killed, 4,000, prisoners
3
40,000; Mukden (1905), 131,000.
1
The Cambridge Modern History, vol. xii
2
An article in Current History, by General
Duryee, of the U.S.A. Army.
3
Encyclopædia Britannica.
Belligerents:
Greece and later Russia, France and Great Britain.
Turkey.
Cause:
Nationalist aspirations had been growing in Greece ever since the
French Revolution. These were encouraged by an intellectual revival
and commercial development. The tyranny and cruel oppression of
Turkish misgovernment under Sultan Mahmud gradually inflamed
public opinion.
Occasion:
The Hetæria Philike, a secret society, inaugurated the rebellion.
The first move was made in Moldavia, where it completely failed.
This was followed by a revolt in the Morea and the islands of the
Ægean and subsequently in Central Greece.
Political Result:
By the Treaty of Adrianople, September 1829 (see also p. 17)
Greece became autonomous under the supreme sovereignty of the
Sultan. Shortly afterwards the Powers agreed that Greece should be
established as an absolutely independent kingdom, but without
Crete or Samos, and with a frontier line drawn from the mouth of
the River Achelous to a spot near Thermopylæ. Prince Leopold of
Saxe-Coburg accepted the crown, but renounced it after a few
months. Prince Otho of Bavaria accepted it in February 1833. After a
revolution in 1862 he was succeeded by Prince George of Denmark
in 1863, the father of King Constantine who was deposed in 1917.
Remarks:
Greece was confined within far too narrow limits, with which she
could not rest contented. The enmity between Russia and Turkey
was in no way mitigated, and Russian ambitions remained
unsatisfied.
RUSSO-TURKISH WAR
1828–1829
Belligerents:
Russia.
Turkey.
Cause:
By the Treaty of London, July 1827, Great Britain, Russia, and
France undertook to put an end to the conflict in the East, which had
arisen out of the Greek struggle for independence. After the victory
of Navarino, Canning died and Great Britain was inactive. By the
Treaty of Akerman, October 1826, the points of contention between
Russia and Turkey had been settled in Russia’s favour. But the
Russian Government ardently desired a contest with Turkey.
Occasion:
The Sultan Mahmud issued a proclamation which was a direct
challenge to Russia, and followed it by a levy of troops and the
expulsion of Christians from Constantinople. On April 26, 1828,
Russia replied by declaring war.
Course of the War:
The Russians occupied the Roumanian principalities and crossed
the Danube. At first the Turks had considerable successes in the
Dobrudja, and the Russians, who suffered enormous losses, were
only able to capture Varna. Reserves were brought up during the
winter. After fierce resistance the Turks were routed near Shumla. In
July 1829 the Russians crossed the Balkans, the fleet co-operated in
the Black Sea, and the army began to march on Constantinople. In
Asia, Kars and Erzeroum having fallen into the Russian hands, the
Sultan yielded.
Political Result:
By the Treaty of Adrianople, September 14, 1829, Russian
ascendancy in the principalities of the Danube was permanently
assured, and the whole of the Caucasus was converted into Russian
territory. The Straits were declared free and open to merchant ships
of all Powers. The Turkish Government gave its adhesion to the
Treaty of London regulating the Greek frontier.
Remarks:
Russia’s hold over Turkey was greatly strengthened, but the
establishment of an absolutely independent kingdom in Greece was
finally secured.
WAR BETWEEN HOLLAND AND
BELGIUM
1830–1839
Belligerents:
Holland.
Belgium, France, Great Britain.
Cause:
The Kingdom of the Netherlands was set up by the Congress of
Vienna in 1815, but from the first there was discord between the
two states of the kingdom. King William was a Dutchman and a
Protestant. Holland, although the smaller of the two states, had a
permanent majority in the Chamber. Public offices and appointments
were filled by Dutchmen. The hatred of Dutch rule grew, and with it
a desire for separation.
Occasion:
The success of the French Revolution of 1830 led to an outbreak
in Brussels, and Belgian insurgents fought against the Dutch
soldiers. The Powers met in London, and Belgium was declared a
separate kingdom. Leopold of Saxe-Coburg was offered the crown
and entered Brussels as King of the Belgians on June 21, 1831; at
the same time the Dutch prepared for an invasion.
Political Result:
The Conference throughout had endeavoured to come to an
agreement; Austria, Prussia, and Russia sympathized with Holland;
but eventually the final Treaty of London was signed on April 19,
1839. Luxemburg was divided, and also the district of Maestricht.
The Scheldt was declared open to the commerce of both countries.
The national debt was divided, and the five Powers guaranteed the
independence and neutrality of Belgium.
Remarks:
As independent states the two countries lived side by side
amicably. The neutrality of Belgium was reaffirmed in 1870 on the
outbreak of the Franco-German War.
Leopold was succeeded in 1865 by his son Leopold II, under
whose sovereignty the Congo Free State was placed in 1885. King
Albert succeeded his uncle in 1909.
WAR IN PORTUGAL AND SPAIN
1830–1839
Belligerents:
Followers of Don Miguel.
Portuguese Constitutionalists.
Spaniards.
Carlists.
and for a period France and Great Britain.
Cause:
Don Miguel, the head of the reactionary party, was betrothed to
Donna Maria, daughter of Pedro of Brazil. In 1828, disregarding his
professions of loyalty to the Constitution, he declared himself King of
Portugal. The Constitutionalists, who were adherents of Donna
Maria, were crushed. She received no assistance from outside to
deal with the usurper.
In Spain Don Carlos, the King’s brother, was the representative of
the reactionary party. King Ferdinand, before his death, issued the
Pragmatic Sanction, which enabled his daughter to succeed to the
throne. The King was weak and unpopular, and Don Carlos had a
great following in Spain.
Occasion:
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com