Algorithms For Big Data Lecture Notes Harvard Cs229r Itebooks download
Algorithms For Big Data Lecture Notes Harvard Cs229r Itebooks download
https://ebookbell.com/product/algorithms-for-big-data-lecture-
notes-harvard-cs229r-itebooks-23836006
https://ebookbell.com/product/algorithms-for-big-data-lecture-notes-
uiuc-cs598csc-itebooks-23836010
Algorithms For Big Data Dfg Priority Program 1736 Hannah Bast
https://ebookbell.com/product/algorithms-for-big-data-dfg-priority-
program-1736-hannah-bast-47546596
https://ebookbell.com/product/algorithms-for-big-data-feldman-
moran-34388846
Sublinear Algorithms For Big Data Applications 2015th Edition Dan Wang
https://ebookbell.com/product/sublinear-algorithms-for-big-data-
applications-2015th-edition-dan-wang-5146996
Natureinspired Algorithms For Big Data Frameworks Hema Banati
https://ebookbell.com/product/natureinspired-algorithms-for-big-data-
frameworks-hema-banati-33794902
https://ebookbell.com/product/medical-computer-vision-algorithms-for-
big-data-international-workshop-mcv-2014-held-in-conjunction-with-
miccai-2014-cambridge-ma-usa-september-18-2014-revised-selected-
papers-1st-edition-bjoern-menze-4973824
https://ebookbell.com/product/machine-learning-models-and-algorithms-
for-big-data-classification-thinking-with-examples-for-effective-
learning-1st-edition-shan-suthaharan-auth-5233984
https://ebookbell.com/product/medical-computer-vision-algorithms-for-
big-data-international-workshop-mcv-2015-held-in-conjunction-with-
miccai-2015-munich-germany-october-9-2015-revised-selected-papers-1st-
edition-bjoern-menze-5607052
https://ebookbell.com/product/diskbased-algorithms-for-big-data-
healey-christopher-graham-5699328
CS 229r: Algorithms for Big Data Fall 2015
1 Course Information
2 Topic Overview
1. Sketching/Streaming
2. Dimensionality Reduction
1
3. Large-scale Machine Learning
• For example, regression problems: we collect data points {(zi , bi )|i = 1, . . . , n} such that
bi = f (zi ) + noise. We want to recover f˜ “close” to f .
• Linear regression: f (z) = hx, zi, where x is the parameter that we want to recover. If
the noise is Gaussian, the popular (and optimal to some sense) estimator we use is Least
Squares
4. Compressed Sensing
• Motivation: compress / cheaply acquire high dimensional signal (using linear measure-
ment)
• For example, images are very high dimensional vectors. If the dimension of an image is
thousands by thousands, it means that the image has millions of pixels. If we write the
image in standard basis as pixels, it is likely that the pixels are not sparse (by sparse
we mean almost zero), because just image that if we take a photo in a dark room, most
of the pixels have some intensity. But there are some basis called wavelet basis, pictures
are usually very sparse on that basis. Once something is sparse, you can compress it.
• JPEG (image compression).
• MRI (faster acquisition of the signal means less time in machine).
• Motivation: measure disk I/O’s instead of number of instructions (because random seeks
are very expensive).
• Model: we have infinite disk divided into blocks of size b bits, and memory of size M
divided into pages of size b bits. If the data we want to read or the location we want
to write is in the memory, we can just simply do it for free; if the location we want to
access is not in the memory, we cost 1 unit time to load the block from the disk into the
memory, and vise versa. We want to minimize the time we go to the disk.
• B trees are designed for this model.
2
3 Approximate Counting Problem
In the following, we discuss the problem appearing in the first streaming paper [1].
Problem. There are a batch of events happen. We want to count the number of events while
minimizing the space we use.
Note that we have a trivial solution - maintaining a counter - which takes log n bits where n is
the number of events. On the other hand, by Pigeonhole Principle, we cannot beat log n bits if we
want to count exactly.
For approximate counting problem, we want to output ñ such that
1. Initialize X ← 0.
1
2. For each event, increment X with probability 2X
.
3. Output ñ = 2X − 1.
Intuitively, we have X ≈ lg n where lg x = log2 (2+x). Before giving rigorous analysis (in Section 5)
for the algorithm, we first give a probability review.
4 Probability Review
3
Proof. P(|X − E X| > λ) = P((X − E X)2 > λ2 ). It follows by Markov.
E(X − E X)p
∀p > 0, ∀λ > 0, P(|X − E X| > λ) < . (6)
λp
Lemma 4 (Chernoff). X1 , . . . , Xn are independent random variables, where Xi ∈ [0, 1]. Let X =
P
i Xi , λ > 0,
2 ·E X/3
P(|X − E X| > λ · E X) ≤ 2 · e−λ . (7)
Proof. Since it’s quite standard, and the proof detail can be found in both previous scribe1 (Lec-
ture 1 in Fall 2013) and wiki2 , we only include a proof sketch here. We can prove that both
2
P(X − E X > λ · E X) and P(X − E X < −λ · E X) are smaller than e−λ ·E X/3 , and then apply
union bound to prove the lemma.
2 2
The proof for P(X −E X < −λ·E X) < e−λ ·E X/3 is symmetric to P(X −E X > λ·E X) < e−λ ·E X/3 .
2
So we can focus on how to prove P(X − E X > λ · E X) < e−λ ·E X/3 . Since P(X − E X > λ E X) =
t(X−E t)
P(et(X−E X) > et E X ) < E eet E X for any t > 0, we can optimize t to get the desired bound.
2 /σ 2
P(|X − E X| > t) . e−ct + e−ct/K , (8)
Proof. First, we define p (p ≥ 1) norm for random variable Z to be kZkp = (E |Z|p )1/p . In the
proof, we will also use Jensen Inequality: f is convex ⇒ f (E Z) ≤ E f (Z).
To prove Bernstein, it’s equivalent to show (equivalence left to pset)
X X √
∀p ≥ 1, k Xi − E Xi kp . p · σ + p · K. (9)
i i
4
X X X X
k Xi − E Xi kp = k E( Xi − Yi )kp (10)
Y
i i i i
X
≤k (Xi − Yi )kp (Jensen Inequality) (11)
i
X
=k αi (Xi − Yi )kp (Add uniform random signs αi = ±1) (12)
i
X X
≤k αi Xi kp + k αi Yi kp (Triangle Inequality) (13)
i i
X
= 2k αi Xi kp (14)
i
r
π X
=2· · kE αi |gi |Xi kp (Let g be vector of iid Gaussians) (15)
2 g
i
X
.k αi |gi |Xi kp (Jensen Inequality) (16)
i
X
=k gi Xi kp (17)
i
2
P P
Note that i αi |gi |Xi is Gaussian with variance i Xi . The pth moment of Gaussian Z ∼ N (0, 1):
(
p
0, p is odd.
EZ = p! √ p (18)
(p/2)!2p/2
≤ p , p is even.
Therefore,
X √ X
k gi Xi kp ≤ p · k( Xi2 )1/2 kp (19)
i i
√ X 1/2
= p·k Xi2 kp/2 (20)
i
√ X
≤ p·k Xi2 k1/2
p (kZkp ≤ kZkq for p < q) (21)
i
√ X X X 1
= p[k Xi 2 − E Xi2 + E Xi2 kp2 ] (22)
i i i
√ X X X
≤ p[k E Xi2 kp1/2 + k Xi2 − E Xi2 k1/2
p ] (23)
i i i
√ √ X X
=σ p+ p·k Xi2 −E Xi2 k1/2
p (24)
i i
√ √ X
.σ p+ p·k gi Xi2 kp1/2 (Apply the same trick (10)-(17)) (25)
i
Note thatP i gi Xi2 is Gaussian with variance i Xi4 ≤ K 2 · Xi2 , and i gi Xi is Gaussian with
P P P P
variance i Xi2 ,
5
X X
k gi Xi2 kp ≤ K · k gi Xi kp . (26)
i i
P 1/2
Let Q = k i gi Xi kp , we have
√ √ √
Q2 − Cσ p − C p KQ ≤ 0, (27)
where C is a constant.
Because it’s a quadratic form, Q is upper bounded by the larger root of
√ √ √
Q2 − Cσ p − C p KQ = 0. (28)
√ √ √ √
By calculation, Q2 ≤ C p KQ + Cσ p . p · σ + p · K.
5 Analysis
Claim 6.
E 2Xn = n + 1. (29)
2. Induction step.
∞
X
Xn+1
E2 = P(Xn = j) · E(2Xn+1 |Xn = j)
j=0
∞
X 1 1
= P(Xn = j) · (2j (1 − j
) + j · 2j+1 )
2 2
j=0
(30)
∞
X X
= P(Xn = j)2j + P(Xn = j)
j=0 j
= E 2Xn + 1
= (n + 1) + 1
6
By Chebyshev,
1 1
P(|ñ − n| > εn) < · E(ñ − n)2 = E(2X − 1 − n)2 . (31)
ε2 n 2 ε2 n 2
Therefore,
1 n2 1
P(|ñ − n| > εn) < · = 2. (33)
ε2 n 2 2 2ε
5.1 Morris+
We instantiate s independent copies of Morris and average their outputs. Then the right hand side
1 1 3 1 1
of (33) becomes 2sε 2 < 3 for s > 2ε2 = Θ( ε2 ). (or < δ for s > 2ε2 δ )
5.2 Morris++
Run t instantiations of Morris+ with failure probability 31 . So s = Θ( ε12 ). Output median estimate
from the s Morris+’s. It works for t = Θ(lg 1δ ), because if the median fails, then more than 1/2 of
Morris+ fails.
Let
(
1, if ith Morris+ fails.
Yi = (34)
0, otherwise.
By Chernoff bound,
X t X X t
P( Yi > ) ≤ P(| Yi − E Yi | > ) ≤ e−ct < δ (35)
2 6
i i i
References
[1] Robert Morris. Counting Large Numbers of Events in Small Registers. Commun. ACM, 21(10):
840-842, 1978.
7
CS 229r: Algorithms for Big Data Fall 2015
1 Probability Recap
V ar[X]
Chebyshev: P (|X − EX| > λ) < λ2
P
Chernoff: For X1 , . . . , Xn independent in [0, 1], ∀0 < < 1, and µ = E i Xi ,
2
X
P (| Xi − µ| > µ) < 2e− µ/3
i
2 Today
• Distinct elements
Problem: Given a stream of integers i1 , . . . , im ∈ [n] where [n] := {1, 2, . . . , n}, we want to output
the number of distinct elements seen.
t s.t. P (|t − e
We can settle for outputting e t| > t) < δ. The original solution was by Flajolet and
Martin [2].
1
3.3 Idealized algorithm
1. Pick random function h : [n] → [0, 1] (idealized, since we can’t actually nicely store this)
3. Output 1/X − 1
Intuition. X is a random variable that’s the minimum of t i.i.d U nif (0, 1) r.v.s.
1
Claim 1. EX = t+1 .
Proof.
Z ∞
EX = P (X > λ)dλ
0
Z ∞
= P (∀i ∈ str, h(i) > λ)dλ
0
Z ∞ t
Y
= P (h(ir ) > λ)dλ
0 r=1
Z 1
= (1 − λ)t dλ
0
1
=
t+1
2
Claim 2. EX 2 = (t+1)(t+2)
Proof.
Z 1
EX 2 = P (X 2 > λ)dλ
0
Z 1 √
= P (X > λ)dλ
0
Z 1 √ √
= (1 − λ)t dλ u=1− λ
0
Z 1
=2 ut (1 − u)du
0
2
=
(t + 1)(t + 2)
t 1
This gives V ar[X] = EX 2 − (EX)2 = (t+1)2 (t+2)
, and furthermore V ar[X] < (t+1)2
= (EX)2 .
2
4 FM+
1 1 t 1
We have that E(Z) = t+1 , and V ar(Z) = q (t+1)2 (t+2) < q(t+1)2
.
1
Claim 3. P (|Z − t+1 | > t+1 ) <η
Proof. Chebyshev.
1 (t + 1)2 1
P (|Z − |> )< =η
t+1 t+1 2 q(t + 1)2
5 FM++
Proof. Let (
1 if |(1/Zj − 1) − t| > t
Yj =
0 else
We have EYj = P (Yj = 1) < 1/3 from the choice of η. The probability we seek to bound is
equivalent to the probability that the median fails, i.e. at least half of the FM+ estimates have
Yj = 1. In other words,
Xs
Yj > s/2
j=1
3
We then get that X X
P( Yj > s/2) = P ( Yj − s/3 > s/6) (1)
Make the simplifying assumption that EYj = 1/3 (this turns out to be stronger than EYj < 1/3.
Then equation 1 becomes
X X 1 X
P( Yj − E Yj > E Yj )
2
using Chernoff,
(1 2
− 2 ) s/3
<e 3 <δ
as desired.
The final space required, ignoring h, is O( lg(1/δ)
2
) for O(lg(1/δ)) copies of FM+ that require O(1/2 )
space each.
Definition 6. A family H of functions mapping [a] to [b] is k-wise independent if ∀j1 , . . . , jk ∈ [b]
and ∀ distinct i1 , . . . , ik ∈ [a],
Example. The set H of all functions [a] → [b] is k-wise independent for every k. |H| = ba so h
is representable in a lg b bits.
Example. Let a = b = q for q = pr a prime power, then Hpoly , the set of degree ≤ k − 1
polynomials with coefficients in Fq , the finite field of order q. |Hpoly | = q k so h is representable in
k lg p bits.
Claim 7. Hpoly is k-wise independent.
Proof. Interpolation.
7 Non-idealized FM
t satisfies t/C ≤ e
First, we get an O(1)-approximation in O(lg n) bits, i.e. our estimate e t ≤ Ct for
some constant C.
1. Pick h from 2-wise family [n] → [n], for n a power of 2 (round up if necessary)
2. Maintain X = maxi∈str lsb(h(i)) where lsb is the least significant bit of a number
3. Output 2X
4
For fixed j, let Zj be the number of i in stream with lsb(h(i)) = j. Let Z>j be the number of i
with lsb(h(i)) > j.
Let (
1 lsb(h(i)) = j
Yi =
0 else
Yi . We can compute EZj = t/2j+1 and similarly
P
Then Zj = i∈str
1 1
EZ>j = t( + + . . .) < t/2j+1
2j+2 2j+3
and also X X X X
V ar[Zj ] = V ar[ Yi ] = E( Yi )2 − (E Yi )2 = E(Yi1 Yi2 )
i1 ,i2
Since h is from a 2-wise family, Yi are pairwise independent, so E(Yi1 Yi2 ) = E(Yi1 )E(Yi2 ). We can
then show
V ar[Zj ] < t/2j+1
8 Refine to 1 +
Trivial solution. Algorithm TS stores first C/2 distinct elements. This is correct if t ≤ C/2 .
Algorithm.
3. Feed i to TSlsb(g(i))
5
distinct elements hashed by g to TSj . Then EBj = t/2j+1 = Qj . By
Let Bj be the number ofp
Chebyshev Bj = Qj ± O( Qj ) with good probability. This equals (1 ± O())Qj if Qj ≥ 1/2 .
Final space: C
2
(lg n)2 = O( 12 lg2 n) bits.
It is known that space O(1/2 + log n) is achievable [4], and furthermore this is optimal [1, 5] (also
see [3]).
References
[1] Noga Alon, Yossi Matias, Mario Szegedy The Space Complexity of Approximating the Fre-
quency Moments. J. Comput. Syst. Sci. 58(1): 137–147, 1999.
[2] Philippe Flajolet, G. Nigel Martin Probabilistic counting algorithms for data base applications.
J. Comput. Syst. Sci., 31(2):182–209, 1985.
[4] Daniel M. Kane, Jelani Nelson, David P. Woodruff An optimal algorithm for the distinct
elements problem. In Proceedings of the Twenty-Ninth ACM SIGMOD-SIGACT-SIGART
Symposium on Principles of Database Systems (PODS), pages 41–52, 2010.
[5] David P. Woodruff. Optimal space lower bounds for all frequency moments. In SODA, pages
167–175, 2004.
6
CS 229r: Algorithms for Big Data Fall 2015
1 Overview
In the last lecture we looked at distinct elements, k-wise independence, geometric subsampling of
streams.
In this lecture we will see lower bounds on exact and approximate deterministic algorithms on data
streams, as well as the AMS sketch and Indyk’s algorithm for the Fp moments, when 0 ≤ p ≤ 2.
2 Main Section
We begin by an impossibility result. We consider the distinct elements problems, where you want
to find the number of distinct elements in a stream, where queries and additions are permitted.
We will denote by s the space of the algorithm, n the size of the universe from which the elements
come from, and m the length of the stream. We have the following result [1].
Theorem 1. There is no deterministic exact algorithm for computing number of distinct elements
in O(minn, m) space.
We move on by showing that even approximate algorithms are hopeless for this problem.
Theorem 2. Any deterministic F0 algorithm that provides 1.1 approximation requires Ω(n) space
1
• |C| ≥ 2cn , for some constant c < 1.
n
• ∀S ∈ C, |S| = 100
n 1
• ∀S 6= T ∈ C, |S ∩ T | ≤ 2000 ≤ 20 |S|
We leave the proof of existence of such a set later and we are moving to our lower bound. We are
going to use the algorithm to encode vectors xS ∀S ∈ C, where xS is the indicator vector of set S.
The lower bound follows as before since we must have s ≥ cn The encoding procedure is going to
be the same as before.
For the decoding procedure, we are going to iterate over all sets and test for each set S if it corre-
sponds to our initial encoded set( remember we are just doing an information-theoretic argument
and we do not care about the running running- we only care that this map is an injection). For
that, we keep at each time the memory contents of M of the streaming algorithm after having
inserted our initial string. Then for each S, we initialize our algorithm with memory contents M
and then feed element i if i ∈ S. It is easy to see that if S equals the initial encoded set, the number
of distinct elements does not increase by much, whereas if it is not it almost doubles. Taking also
into account the approximation guarantee of the algorithm we see for example that if S is not our
initial set then the number of distinct elements grows by 23 ( we can tune the parametersif needed).
We now only need to prove the existence of such a family of sets C. We are going to argue via
n
probabilistic method. We partition n into 100 intervals of length 100 each in the obvious way.
To form a set S we pick one number from each interval uniformly at random. Obviously, such
n
a set has size exactly 100 . For two sets S, T chosen uniformly at random as before let Ui be the
random variable that equals 1 if they have the same number chosen from interval i. Obviously
n
1 P 100 n 1
P [Ui = 1] = 100 . So the expected size of the intersection is just E i=1 = 100 · 100 . The probability
−c0
that this interesction is bigger than five times its mean is smaller than e n for some constant c0 ,
by a standard Chernoff bound. We can then apply a union bound over all possible intersections
and get the desired result.
We introduce the turnstile model in streaming algorithms. In this model we have a vector x ∈ Rn
that starts as the all zero vector and then a sequence of updates comes. Each update is of the form
(i, ∆), where ∆ ∈ R and i ∈ {1, .., n}. This corresponds to the operation xi ← xi + ∆.
Given a function f , we want to compute or approximate f (x).For example in the problem of distinct
elements ∆ is always 1 and f (x) = |i : xi 6= 0.
The common/only technique for designing turnstile algorithms is linear sketching. The idea is
to maintain in memory y = Πx, where Π ∈ Rm×n , a matrix that is short and fat. We care that
m < n, usually much smaller. We can see that y is m-dimensional so we can store it efficiently but
what about Π? If we need to store the whole Π in memory this will not lead to a better algorithm
in terms of space. So, there are two common ways in constructing and storing Π. The one is that
Π is deterministic and so we can easily compute Πij without keeping the whole matrix in memory.
2
Other documents randomly have
different content
cut our cables, and our ships had gone ashore; but in the end he
concluded to our request, bringing the twelve hostages to ten, which
with all speed on either part were received, with a writing from the
viceroy, signed with his hand and sealed with his seal, of all the
conditions concluded, and forthwith a trumpet blown, with
commandment that none of either part should inviolate the peace
upon pain of death; and, further, it was concluded that the two
generals of the fleet should meet, and give faith each to other for
the performance of the promises, which was so done.
"Thus, at the end of three days, all was concluded, and the fleet
entered the port, saluting one another as the manner of the sea
doth require. Thus, as I said before, Thursday we entered the port,
Friday we saw the fleet, and on Monday, at night, they entered the
port; then we laboured two days, placing the English ships by
themselves and the Spanish ships by themselves, the captains of
each part, and inferior men of their parts, promising great amity of
all sides; which, even as with all fidelity was meant of our part,
though the Spanish meant nothing less of their parts, but from the
mainland had furnished themselves with a supply of men to the
number of one thousand, and meant the next Thursday, being
September 23rd, at dinner-time, to set upon us of all sides. The
same Thursday, the treason being at hand, some appearance
showed, as shifting of weapons from ship to ship, planting and
bending of ordnance from the ship to the island where our men
were, passing to and fro of companies of men more than required
for their necessary business, and many other ill likelihoods, which
caused us to have a vehement suspicion, and therewithal sent to the
viceroy to inquire what was meant by it, which sent immediately
straight commandment to unplant all things suspicious, and also
sent word that he, in the faith of a viceroy, would be our defence
from all villainies. Yet we, not being satisfied with this answer,
because we suspected a great number of men to be hid in a great
ship of nine hundred tons, which was moored next unto the Minion,
sent again unto the viceroy the master of the Jesus, which had the
Spanish tongue, and required to be satisfied if any such thing were
or not; on which the viceroy, seeing that the treason must be
discovered, forthwith stayed our master, blew the trumpet, and of all
sides set upon us. Our men which were on guard ashore, being
stricken with sudden fear, gave place, fled, and sought to recover
succour of the ships; the Spaniards, being before provided for the
purpose, landed in all places in multitudes from their ships, which
they could easily do without boats, and slew all our men ashore
without mercy, a few of them escaping aboard the Jesus. The great
ship which had, by the estimation, three hundred men placed in her
secretly, immediately fell aboard the Minion, which, by God's
appointment, in the time of the suspicion we had, which was only
one half-hour, the Minion was made ready to avoid, and so, loosing
her headfasts, and hailing away by the sternfasts, she was gotten
out; thus, with God's help, she defended the violence of the first
brunt of these three hundred men. The Minion being passed out,
they came aboard the Jesus, which also, with very much ado and
the loss of many of our men, were defended and kept out. Then
were there also two other ships that assaulted the Jesus at the same
instant, so that she had hard work getting loose; but yet, with some
time, we had cut our headfasts, and gotten out by the sternfasts.
Now, when the Jesus and the Minion were gotten two ship-lengths
from the Spanish fleet, the fight began hot on all sides, so that
within one hour the admiral of the Spaniards was supposed to be
sunk, their vice-admiral burned, and one other of their principal
ships supposed to be sunk, so that the ships were little to annoy us.
"The most part of the men that were left alive in the Jesus made
shift and followed the Minion in a small boat, the rest, which the
little boat was not able to receive, were enforced to abide the mercy
of the Spaniards (which I doubt was very little); so with the Minion
only, and the Judith (a small barque of fifty tons) we escaped, which
barque the same night forsook us in our great misery. We were now
removed with the Minion from the Spanish ships two bow-shots, and
there rode all that night. The next morning we recovered an island a
mile from the Spaniards, where there took us a north wind, and
being left only with two anchors and two cables (for in this conflict
we lost three cables and two anchors), we thought always upon
death, which ever was present; but God preserved us to a longer
time.
"And such as were willing to land I put apart, and such as were
desirous to go homewards I put apart, so that they were
indifferently parted, a hundred of one side and a hundred of the
other side. These hundred men were set on land with all diligence,
in this little place aforesaid, which being landed, we determined
there to refresh our water, and so with our little remain of victuals to
take the sea.
"The next day, having on land with me fifty of our hundred men
that remained, for the speedier preparing of our water aboard, there
arose an extreme storm, so that in three days we could by no means
repair our ships. The ship also was in such peril that every hour we
looked for shipwreck.
"But yet God again had mercy on us, and sent fair weather. We
got aboard our water, and departed October 16th, after which day
we had fair and prosperous weather till November 16th, which day,
God be praised, we were clear from the coast of the Indians and out
of the channel and gulf of Bahama, which is between the Cape of
Florida and the Islands of Cuba. After this, growing near to the cold
country, our men, being oppressed with famine, died continually, and
they that were left grew into such weakness that we were scarcely
able to manœuvre our ship; and the wind being always ill for us to
recover England, determined to go to Galicia, in Spain, with intent
there to relieve our company and other extreme wants. And being
arrived the last day of December, in a place near unto Vigo, called
Pontevedra, our men, with excess of fresh meat, grew into miserable
diseases, and died a great part of them. This matter was borne out
as long as it might be, but in the end, although there was none of
our men suffered to go on land, yet by access of the Spaniards our
feebleness was known to them. Whereupon they ceased not to seek
by all means to betray us; but with all speed possible we departed to
Vigo, where we had some help of certain English ships, and twelve
fresh men, wherewith we repaired our wants as we might, and
departing January 20th, 1568, arrived in Mounts Bay in Cornwall the
25th of the same month, praised be God therefore."
"Sir John Hawkins," says Dr. Campbell, "was the author of more
useful inventions, and introduced into the navy better regulations
than any officer who had borne command therein before his time.
One instance of this was the institution of that noble fund the Chest
of Chatham, which was the humane and wise contrivance of this
gentleman and Sir Francis Drake, and their scheme that seamen,
safe and successful, should, by a voluntary deduction from their pay,
give relief to the wants, and reward to those who are maimed in the
service of their country, was approved by the queen, and has been
adopted by posterity."
THE WORTHY ENTERPRISE OF
JOHN FOX,
AN ENGLISHMAN, IN DELIVERING TWO HUNDRED AND SIXTY-
SIX CHRISTIANS OUT OF THE CAPTIVITY OF THE TURKS
AT ALEXANDRIA, THE 3RD OF JANUARY, 1577. BY RICHARD
HAKLUYT.
"Then taketh him to his charge John Fox, the gunner, in the
disposing of his pieces, in order to the best effect, and, sending his
bullets towards the Turks, who likewise bestowed their pieces thrice
as fast towards the Christians. But shortly they drew near, so that
the bowman fell to their charge in sending forth their arrows so thick
amongst the galleys, and also in doubling their shot so sore upon
the galleys, that there were twice as many of the Turks slain as the
number of the Christians were in all. But the Turks discharged twice
as fast against the Christians, and so long, that the ship was very
sore stricken and bruised under water; which the Turks, perceiving,
made the more haste to come aboard the ship: which, ere they
could do, many a Turk bought it dearly with the loss of their lives.
Yet was all in vain, boarded they were, where they found so hot a
skirmish, that it had been better they had not meddled with the
feast; for the Englishmen showed themselves men indeed in working
manfully with their brown bills and halberds, where the owner,
master, boatswain and their company stood to it so lustily, that the
Turks were half dismayed. But chiefly the boatswain showed himself
valiant above the rest, for he fared amongst the Turks like a wood
lion; for there was none of them that either could or durst stand in
his face, till at last there came a shot from the Turks which brake his
whistle asunder, and smote him on the breast, so that he fell down,
bidding them farewell, and to be of good comfort, encouraging
them, likewise, to win praise by death, rather than to live captives in
misery and shame, which they, hearing, indeed, intended to have
done, as it appeared by their skirmish; but the press and store of the
Turks were so great, that they were not long able to endure, but
were so overpressed that they could not wield their weapons, by
reason whereof they must needs be taken, which none of them
intended to have been, but rather to have died, except only the
master's mate, who shrunk from the skirmish, like a notable coward,
esteeming neither the value of his name, nor accounting of the
present example of his fellows, nor having respect to the miseries
whereunto he should be put. But in fine, so it was, that the Turks
were victors, whereof they had no great cause to rejoice or triumph.
Then would it have grieved any hard heart to see these infidels so
violently entreating the Christians, not having any respect of their
manhood, which they had tasted of, nor yet respecting their own
state, how they might have met with such a booty as might have
given them the overthrow; but no remorse hereof, or anything else
doth bridle their fierce and tyrannous dealing, but the Christians
must needs to the galleys, to serve in new officer; and they were no
sooner in them, but their garments were pulled over their ears and
torn from their backs, and they set to the oars.
"I will make no mention of their miseries, being now under their
enemies' raging stripes. I think there is no man will judge their fare
good, or their bodies unloaden of stripes, and not pestered with too
much heat, and also with too much cold; but I will go to my
purpose, which is to show the end of those being in mere misery,
which continually do call on God with a steadfast hope that He will
deliver them, and with a sure faith that He can do it.
"Nigh to the city of Alexandria, being a haven town, and under
the dominion of the Turks, there is a road, being made very fencible
with strong walls, whereinto the Turks do customably bring their
galleys on shore every year, in the winter season, and there do trim
them, and lay them up against the spring-time; in which road there
is a prison, wherein the captives and such prisoners as serve in the
galleys are put for all that time, until the seas be calm and passable
for the galleys; every prisoner being most grievously laden with irons
on their legs, to their great pain and sore disabling of them to any
labour; into which prison were these Christians put and fast warded
all the winter season. But ere it was long, the master and the owner,
by means of friends, were redeemed, the rest abiding still in the
misery, while that they were all, through reason of their ill-usage and
worse fare, miserably starved, saving one John Fox, who (as some
men can abide harder and more misery than other some can, so can
some likewise make more shift, and work more duties to help their
state and living, than other some can do) being somewhat skilful in
the craft of a barber, by reason thereof made great shift in helping
his fare now and then with a good meal. Insomuch, till at the last
God sent him favour in the sight of the keeper of the prison, so that
he had leave to go in and out to the road at his pleasure, paying a
certain stipend unto the keeper, and wearing a lock about his leg,
which liberty likewise five more had upon like sufferance, who, by
reason of their long imprisonment, not being feared or suspected to
start aside, or that they would work the Turks any mischief, had
liberty to go in and out at the said road, in such manner as this John
Fox did, with irons on their legs, and to return again at night.
"In the year of our Lord 1577, in the winter season, the galleys
happily coming to their accustomed harbourage, and being
discharged of all their masts, sails, and other such furnitures as unto
galleys do appertain, and all the masters and mariners of them
being then nested in their own homes, there remained in the prison
of the said road two hundred three score and eight Christian
prisoners who had been taken by the Turks' force, and were of
fifteen sundry nations. Among which there were three Englishmen,
whereof one was named John Fox, of Woodbridge, in Suffolk, the
other William Wickney, of Portsmouth, in the county of
Southampton, and the third Robert Moore, of Harwich, in the county
of Essex; which John Fox, having been thirteen or fourteen years
under their gentle entreatance, and being too weary thereof,
minding his escape, weighed with himself by what means it might be
brought to pass, and continually pondering with himself thereof, took
a good heart unto him, in the hope that God would not be always
scourging His children, and never ceasing to pray Him to further His
intended enterprise, if that it should redound to His glory.
"Not far from the road, and somewhat from thence, at one side
of the city, there was a certain victualling house, which one Peter
Vuticaro had hired, paying also a certain fee unto the keeper of the
road. This Peter Vuticaro was a Spaniard born, and a Christian, and
had been prisoner above thirty years, and never practised any
means to escape, but kept himself quiet without touch or suspect of
any conspiracy, until that now this John Fox using much thither, they
brake one to another their minds, concerning the restraint of their
liberty and imprisonment. So that this John Fox, at length opening
unto this Vuticaro the device which he would fain put in practice,
made privy one more to this their intent; which three debated of this
matter at such times as they could compass to meet together;
insomuch that, at seven weeks' end they had sufficiently concluded
how the matter should be, if it pleased God to further them thereto;
who, making five more privy to this their device, whom they thought
that they might safely trust, determined in three nights after to
accomplish their deliberate purpose. Whereupon the same John Fox
and Peter Vuticaro, and the other five appointed to meet all together
in the prison the next day, being the last day of December, where
this John Fox certified the rest of the prisoners what their intent and
device was, and how and when they minded to bring that purpose to
pass, who thereunto persuaded them without much ado to further
their device; which, the same John Fox seeing, delivered unto them
a sort of files, which he had gathered together for this purpose by
the means of Peter Vuticaro, charging them that every man should
be ready, discharged of his irons, by eight of the clock on the next
day at night.
"On the next day at night, the said John Fox, and his five other
companions, being all come to the house of Peter Vuticaro, passing
the time away in mirth for fear of suspect till the night came on, so
that it was time for them to put in practice their device, sent Peter
Vuticaro to the master of the road, in the name of one of the
masters of the city, with whom this keeper was acquainted, and at
whose request he also would come at the first; who desired him to
take the pains to meet him there, promising him that he would bring
him back again. The keeper agreed to go with him, asking the
warders not to bar the gate, saying that he would not stay long, but
would come again with all speed.
"The keeper being now come unto the house, and perceiving no
light nor hearing any noise, straightway suspected the matter; and
returning backward, John Fox, standing behind the corner of the
house, stepped forth unto him; who, perceiving it to be John Fox,
said, 'O Fox, what have I deserved of thee that thou shouldest seek
my death?' 'Thou, villain,' quoth Fox, 'hast been a bloodsucker of
many a Christian's blood, and now thou shalt know what thou hast
deserved at my hands,' wherewith he lift up his bright shining sword
of ten years' rust, and stroke him so main a blow, as therewithal his
head clave asunder so that he fell stark dead to the ground.
Whereupon Peter Vuticaro went in and certified the rest how the
case stood with the keeper, and they came presently forth, and
some with their spits ran him through, and the other with their
glaves hewed him in sunder, cut off his head, and mangled him so
that no man should discern what he was.
"Then entered they into the gaoler's lodge, where they found
the keys of the fortress and prison by his bedside, and there got
they all better weapons. In this chamber was a chest wherein was a
rich treasure, and all in ducats, which this Peter Vuticaro and two
more opening, stuffed themselves so full as they could between their
shirts and their skin; which John Fox would not once touch, and
said, 'that it was his and their liberty which he fought for, to the
honour of his God, and not to make a mart of the wicked treasure of
the infidels.' Yet did these words sink nothing unto their stomachs;
they did it for a good intent. So did Saul save the fattest oxen to
offer unto the Lord, and they to serve their own turn. But neither did
Saul escape the wrath of God therefore, neither had these that thing
which they desired so, and did thirst after. Such is God's justice. He
that they put their trust in to deliver them from the tyrannous hands
of their enemies, he, I say, could supply their want of necessaries.
"At the prison were certain warders whom John Fox and his
company slew, in the killing of whom there were eight more of the
Turks which perceived them, and got them to the top of the prison,
unto whom John Fox and his company were fain to come by ladders,
where they found a hot skirmish, for some of them were there slain,
some wounded, and some but scarred and not hurt. As John Fox
was thrice shot through his apparel, and not hurt, Peter Vuticaro and
the other two, that had armed them with the ducats, were slain, as
not able to wield themselves, being so pestered with the weight and
uneasy carrying of the wicked and profane treasure; and also divers
Christians were as well hurt about that skirmish as Turks slain.
"Amongst the Turks was one thrust through, who (let us not say
that it was ill-fortune) fell off from the top of the prison wall, and
made such a groaning that the inhabitants thereabout (as here and
there stood a house or two) came and questioned him, so that they
understood the case, how that the prisoners were paying their
ransoms; wherewith they raised both Alexandria, which lay on the
west side of the road, and a castle which was at the city's end next
to the road, and also another fortress which lay on the north side of
the road, so that now they had no way to escape but one, which by
man's reason (the two holds lying so upon the mouth of the road)
might seem impossible to be a way for them. So was the Red Sea
impossible for the Israelites to pass through, the hills and rocks lay
so on the one side, and their enemies compassed them on the other.
So was it impossible that the walls of Jericho should fall down, being
neither undermined nor yet rammed at with engines, nor yet any
man's wisdom, policy, or help, set or put thereunto. Such
impossibilities can our God make possible. He that held the lion's
jaws from rending Daniel asunder, yea, or yet from once touching
him to his hurt, cannot He hold the roaring cannons of this hellish
force? He that kept the fire's rage in the hot burning oven from the
three children that praised His name, cannot He keep the fire's
flaming blasts from among His elect?
"Now is this galley afloat, and out of the shelter of the road; now
have the two castles full power upon the galley; now is there no
remedy but to sink. How can it be avoided? The cannons let fly from
both sides, and the galley is even in the middest and between them
both. What man can devise to save it? There is no man but would
think it must needs be sunk.
"There was not one of them that feared the shot which went
thundering round about their ears, nor yet were once scarred or
touched with five and forty shot which came from the castles. Here
did God hold forth His buckler, He shieldeth now this galley, and hath
tried their faith to the uttermost. Now cometh His special help; yea,
even when man thinks them past all help, then cometh He Himself
down from Heaven with His mighty power, then is His present
remedy most ready. For they sail away, being not once touched by
the glance of a shot, and are quickly out of the Turkish cannons'
reach. Then might they see them coming down by heaps to the
water's side, in companies like unto swarms of bees, making show to
come after them with galleys, bustling themselves to dress up the
galleys, which would be a swift piece of work for them to do, for that
they had neither oars, masts, sails, nor anything else ready in any
galley. But yet they are carrying into them, some into one galley, and
some into another, so that, being such a confusion amongst them,
without any certain guide, it were a thing impossible to overtake the
Christians; beside that, there was no man that would take charge of
a galley, the weather was so rough, and there was such an
amazedness amongst them. And verily, I think their god was amazed
thereat; it could not be but that he must blush for shame, he can
speak never a word for dulness, much less can he help them in such
an extremity. Well, howsoever it is, he is very much to blame to
suffer them to receive such a gibe. But howsoever their god behaved
himself, our God showed Himself a God indeed, and that He was the
only living God; for the seas were swift under His faithful, which
made the enemies aghast to behold them; a skilfuller pilot leads
them, and their mariners bestir them lustily; but the Turks had
neither mariners, pilot, nor any skilful master, that was in readiness
at this pinch.
"When the Christians were safe out of the enemy's coast, John
Fox called to them all, telling them to be thankful unto Almighty God
for their delivery, and most humbly to fall down upon their knees,
beseeching Him to aid them to their friends' land, and not to bring
them into another danger, since He had most mightily delivered
them from so great a thraldom and bondage.
"Thus when every man had made his petition, they fell
straightway to their labour with the oars, in helping one another
when they were wearied, and with great labour striving to come to
some Christian land, as near as they could guess by the stars. But
the winds were so contrary, one while driving them this way, another
while that way, so that they were now in a new maze, thinking that
God had forsaken them and left them to a greater danger. And
forasmuch as there were no victuals now left in the galley, it might
have been a cause to them (if they had been the Israelites) to have
murmured against their God; but they knew how that their God, who
had delivered Egypt, was such a loving and merciful God, as that He
would not suffer them to be confounded in whom He had wrought
so great a wonder, but what calamity soever they sustained, they
knew it was but for their further trial, and also (in putting them in
mind of their further misery) to cause them not to triumph and glory
in themselves therefor. Having, I say, no victuals in the galley, it
might seem one misery continually to fall upon another's neck; but
to be brief the famine grew to be so great that in twenty-eight days,
wherein they were on the sea, there died eight persons, to the
astonishment of all the rest.
"So it fell out that upon the twenty-ninth day after they set from
Alexandria, they fell on the Isle of Candia, and landed at Gallipoli,
where they were made much of by the abbot and monks there, who
caused them to stay there while they were well refreshed and eased.
They kept there the sword wherewith John Fox had killed the keeper,
esteeming it as a most precious relic, and hung it up for a
monument.
ebookbell.com