Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Poems That Solve Puzzles: The History

And Science Of Algorithms Chris


Bleakley
Visit to download the full and correct content document:
https://textbookfull.com/product/poems-that-solve-puzzles-the-history-and-science-of-
algorithms-chris-bleakley/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Poems That Solve Puzzles: The History and Science of


Algorithms 1st Edition Chris Bleakley

https://textbookfull.com/product/poems-that-solve-puzzles-the-
history-and-science-of-algorithms-1st-edition-chris-bleakley/

Information and the History of Philosophy Rewriting the


History of Philosophy 1st Edition Chris Meyns Editor

https://textbookfull.com/product/information-and-the-history-of-
philosophy-rewriting-the-history-of-philosophy-1st-edition-chris-
meyns-editor/

A People s History of the World Chris Harman

https://textbookfull.com/product/a-people-s-history-of-the-world-
chris-harman/

Science of Running 1st Edition Chris Napier

https://textbookfull.com/product/science-of-running-1st-edition-
chris-napier/
Countdown 1945 The Extraordinary Story of the Atomic
Bomb and the 116 Days That Changed the World Wallace
Chris

https://textbookfull.com/product/countdown-1945-the-
extraordinary-story-of-the-atomic-bomb-and-the-116-days-that-
changed-the-world-wallace-chris/

Eyewitness Forensic Science Discover the Fascinating


Methods Scientists Use to Solve Crimes DK Eyewitness
Cooper

https://textbookfull.com/product/eyewitness-forensic-science-
discover-the-fascinating-methods-scientists-use-to-solve-crimes-
dk-eyewitness-cooper/

Shakespeare and the Politics of Commoners: Digesting


the New Social History First Edition Chris Fitter
(Editor)

https://textbookfull.com/product/shakespeare-and-the-politics-of-
commoners-digesting-the-new-social-history-first-edition-chris-
fitter-editor/

A History of Video Art 2nd Edition Chris Meigh-Andrews

https://textbookfull.com/product/a-history-of-video-art-2nd-
edition-chris-meigh-andrews/

A History of Video Art 2nd Edition Chris Meigh-Andrews

https://textbookfull.com/product/a-history-of-video-art-2nd-
edition-chris-meigh-andrews-2/
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

POEMS THAT SOLVE PUZZLES


OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

POEMS THAT
SOLVE PUZZLES
The History and Science of Algorithms

Chris Bleakley

1
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

3
Great Clarendon Street, Oxford, OX2 6DP,
United Kingdom
Oxford University Press is a department of the University of Oxford.
It furthers the University’s objective of excellence in research, scholarship,
and education by publishing worldwide. Oxford is a registered trade mark of
Oxford University Press in the UK and in certain other countries
© Chris Bleakley 2020
The moral rights of the author have been asserted
First Edition published in 2020
Impression: 1
All rights reserved. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form or by any means, without the
prior permission in writing of Oxford University Press, or as expressly permitted
by law, by licence or under terms agreed with the appropriate reprographics
rights organization. Enquiries concerning reproduction outside the scope of the
above should be sent to the Rights Department, Oxford University Press, at the
address above
You must not circulate this work in any other form
and you must impose this same condition on any acquirer
Published in the United States of America by Oxford University Press
198 Madison Avenue, New York, NY 10016, United States of America
British Library Cataloguing in Publication Data
Data available
Library of Congress Control Number: 2020933199
ISBN 978–0–19–885373–2
Printed and bound by
CPI Group (UK) Ltd, Croydon, CR0 4YY
Links to third party websites are provided by Oxford in good faith and
for information only. Oxford disclaims any responsibility for the materials
contained in any third party website referenced in this work.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

For Eileen - thank you


OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

algorithm, noun:
A process or set of rules to be followed in calculations or other
problem-solving operations, especially by a computer.
The Arabic source, al-Kwārizmī ‘the man of Kwārizm’ (now
Khiva), was a name given to the ninth-century mathemati-
cian Abū Ja’far Muhammad ibn Mūsa, author of widely trans-
lated works on algebra and arithmetic.
Oxford Dictionary of English, 2010
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

Foreword

This book is for people that know algorithms are important, but have
no idea what they are.
The inspiration for the book came to me while working as Director
of Outreach for UCD’s School of Computer Science. Over the course
of hundreds of discussions with parents and secondary school students,
I realized that most people are aware of algorithms, thanks to extensive
media coverage of Google, Facebook, and Cambridge Analytica. How-
ever, few know what algorithms are, how they work, or where they
came from. This book answers those questions.
The book is written for the general reader. No previous knowledge
of algorithms or computers is needed. However, even those with a
degree in computing will, I think, find the stories herein surprising,
entertaining, and enlightening. Readers with a firm grasp of what an
algorithm is might like to skip the introduction. My aim is that readers
enjoy the book and learn something new along the way.
My apologies to the great many people who were involved in the
events described herein, but who are not mentioned by name. Almost
every innovation is the product of a team working together, building
on the discoveries of their predecessors. To make the book readable
as a story, I tend to focus on a small number of key individuals. For
more detail, I refer the interested reader to the papers cited in the
bibliography.
In places, I favour a good story over mind-numbing completeness.
If your favourite algorithm is missing, let me know and I might slip it
into a future edition. When describing what an algorithm does, I use the
present tense, even for old algorithms. I use plural pronouns in place of
gender-specific singular pronouns. All dollar amounts are US dollars.
Many thanks to those that generously gave permission to use of their
photographs and quotations. Many thanks also to my assistants in this
endeavour: my first editor, Eoin Bleakley; my mentor, Michael Sheri-
dan (author); my wonderful agent, Isabel Atherton; my bibliography
wrangler, Conor Bleakley; my ever-patient assistant editor, Katherine
Ward; everyone at Oxford University Press; my reviewers, Guénolé
Silvestre and Pádraig Cunningham; and, last, but certainly not least, my
parents and my wife. Without their help, this book would not have been
possible.
Read on and enjoy!
Chris
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

About the Author

Chris Bleakley has thirty-five years of experience in algorithm design.


He has taught and written on the subject for the last sixteen of those
years.
As a school kid, Chris taught himself how to program on a home
computer. Within two years, he was selling his own computer pro-
grams by mail order to customers throughout the UK.
Chris graduated with a BSc (Hons) degree in Computer Science from
Queen’s University, Belfast, and a PhD degree in Electronic Engineer-
ing from Dublin City University. After college, he was employed as
a software consultant by Accenture and, later, as a senior researcher
by Broadcom Éireann Research. Thereafter, he was appointed Vice
President of Engineering at Massana, a leading-edge start-up company
developing integrated circuits and software for data communications.
Today, Chris is an Associate Professor and Head of the School of Com-
puter Science at University College Dublin (UCD), Ireland. He leads
a research group focused on inventing novel algorithms for analysing
real-world sensor data. His work has been published in leading peer-
reviewed journals and presented at major international conferences.
Chris lives in Dublin with his wife and two children.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

Contents

Introduction 1
1 Ancient Algorithms 9
2 Ever-Expanding Circles 25
3 Computer Dreams 39
4 Weather Forecasts 55
5 Artificial Intelligence Emerges 75
6 Needles in Haystacks 93
7 The Internet 117
8 Googling the Web 143
9 Facebook and Friends 159
10 America’s Favourite Quiz Show 171
11 Mimicking the Brain 179
12 Superhuman Intelligence 203
13 Next Steps 215

Appendix 229
Notes 233
Permissions 241
Bibliography 243
Index 259
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

Introduction
‘One for you. One for me. One for you. One for me.’ You are in the
school yard. The sun is shining. You are sharing a packet of sweets with
your best friend. ‘One for you. One for me.’ What you didn’t realize back
then was that sharing your sweets in this way was an enactment of an
algorithm.
An algorithm is a series of steps that can be performed to solve an
information problem. On that sunny day, you used an algorithm to
share your sweets fairly. The input to the algorithm was the number of
sweets in the packet. The output was the number of sweets that you and
your friend each received. If the total number of sweets in the packet
happened to be even, then both of you received the same number of
sweets. If the total was odd, your friend ended up with one sweet more
than you.
An algorithm is like a recipe. It is a list of simple steps that, if followed,
transforms a set of inputs into a desired output. The difference is that
an algorithm processes information, whereas a recipe prepares food.
Typically, an algorithm operates on physical quantities that represent
information.
Often, there are alternative algorithms for solving a given problem.
You could have shared your sweets by counting them, dividing the
total by two in your head, and handing over the correct number of
sweets. The outcome would have been the same, but the algorithm—
the means of obtaining the output—would have been different.
An algorithm is written down as a list of instructions. Mostly, these
instructions are carried out in sequence, one after another. Occasion-
ally, the next instruction to be performed is not the next sequential
step but an instruction elsewhere in the list. For example, a step may
require the person performing the algorithm to go back to an earlier
step and carry on from there. Skipping backwards like this allows
repetition of groups of steps—a powerful feature in many algorithms.
The steps, ‘One for you. One for me.’ were repeated in the sweet sharing
algorithm. The act of repeating steps is known as iteration.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

2 Introduction

If the number of sweets in the packet was even, the following iterative
algorithm would have sufficed:

Repeat the following steps:


Give one sweet to your friend.
Give one sweet to yourself.
Stop repeating when the packet is empty.

In the exposition of an algorithm such as this, steps are usually written


down line-by-line for clarity. Indentation normally groups inter-related
steps.
If the number of sweets in the packet could be even or odd, the
algorithm becomes a little more complicated. A decision-making step
must be included. Most algorithms contain decision-making steps.
A decision-making step requires the operator performing the algorithm
to choose between two possible courses of action. Which action is
carried out depends on a condition. A condition is a statement that is
either true or false. The most common decision-making construct—
‘if-then-else’—combines a condition and two possible actions. ‘If’ the
condition is true, ‘then’ the immediately following action (or actions)
is performed. ‘If’ the condition is false, the step (or steps) after the ‘else’
are performed.
To allow for an odd number of sweets, the following decision-making
steps must be incorporated in the algorithm:

If this is the first sweet or you just received a sweet,


then give this sweet to your friend,
else give this sweet to yourself.

The condition here is compound, meaning that it consists of two (or


more) simple conditions. The simple conditions are ‘this is the first
sweet’ together with ‘you just received a sweet’. The two simple con-
ditions are conjoined by an ‘or’ operation. The compound condition
is true if either one of the simple conditions is true. In the case that
the compound condition is true, the step ‘give this sweet to your
friend’ is carried out. Otherwise, the step ‘give this sweet to yourself’
is performed.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

The Trainee Librarian 3

The complete algorithm is then:

Take a packet of sweets as input.


Repeat the following steps:
Take a sweet out of the packet.
If this is the first sweet or you just received a sweet,
then give this sweet to your friend,
else give this sweet to yourself.
Stop repeating when the packet is empty.
Put the empty packet in the bin.
The sweets are now shared fairly.

Like all good algorithms, this one is neat and achieves its objective in an
efficient manner.

The Trainee Librarian


Information problems crop up every day. Imagine a trainee librarian on
their first day at work. One thousand brand new books have just been
delivered and are lying in boxes on the floor. The boss wants the books
to be put on the shelves in alphabetical order by author name, as soon
as possible. This is an information problem and there are algorithms for
solving it.
Most people would intuitively use an algorithm called Insertion Sort
(Figure I.1). Insertion Sort operates in the following way:

Figure I.1 Insertion Sort in action.


OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

4 Introduction

Take a pile of unsorted books as input.


Repeat the following steps:
Pick up a book.
Read the author’s name.
Scan across the shelf until you find where the book should
be inserted.
Shift all the books after that point over by one.
Insert the new book.
Stop repeating when there are no books left on the floor.
The books are now sorted.
At any moment in time, the books on the floor are unsorted. One by
one, the books are transferred to the shelf. Every book is placed on the
shelf in alphabetical order. As a result, the books on the shelf are always
in order.
Insertion Sort is easy to understand and works but is slow. It is slow
because, for every book taken from the floor, the librarian has to scan
past or shift every book already on the shelf. At the start, there are
very few books on the shelf, so scanning and shifting is fast. At the end,
our librarian has almost 1,000 books on the shelf. On average, putting a
book in the right place requires 500 operations, where an operation is an
author name comparison or a book shift. Thus, sorting all of the books
takes 500,000 (1,000 × 500) operations, on average. Let’s say that a single
operation takes one second. That being the case, sorting the books using
Insertion Sort will take around seventeen working days. The boss isn’t
going to be happy.
A faster alternative algorithm—Quicksort—was invented by com-
puter scientist Tony Hoare in 1962. Hoare was born in Sri Lanka, to
British parents in 1938. He was educated in England and attended
Oxford University before entering academia as a lecturer. His method
for sorting is a divide-and-conquer algorithm. It is more complicated
than Insertion Sort but, as the name suggests, much faster.
Quicksort (Figure I.2) splits the pile of books into two. The split is
governed by a pivot letter. Books with author names before the pivot letter
are put on a new pile to the left of the current pile. Books with author
names after the pivot are placed on a pile to the right. The resulting
piles are then split using new pivot letters. In doing so, the piles are
kept in sequence. The leftmost pile contains the books that come first
in the alphabet. The next pile holds the books that come second, and
so on. This pile-splitting process is repeated for the largest pile until
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

The Trainee Librarian 5

Figure I.2 Quicksort in action.

the biggest stack contains just five books. The piles are then sorted
separately using Insertion Sort. Finally, the sorted piles are transferred,
in order, to the shelf.
For maximum speed, the pivot letters should split the piles into two
halves.
Let’s say that the original pile contains books from A to Z. A good
choice for the first pivot would likely be M. This would give two new
piles: A–L and M–Z (Figure I.2). If the A–L pile is larger, it will be split
next. A good pivot for A–L might be F. After this split, there will be
three piles: A–E, F–L, and M–Z. Next, M–Z will be split and so on. For
twenty books, the final piles might be: A–C, D–E, F–L, M–R, and S–Z.
These piles are ordered separately using Insertion Sort and the books
transferred pile-after-pile onto the shelf.
The complete Quicksort algorithm can be written down as follows:

Take a pile of unsorted books as input.


Repeat the following steps:
Select the largest pile.
Clear space for piles on either side.
Choose a pivot letter.
Repeat the following steps:
Take a book from the selected pile.
If the author name is before the pivot letter,
then put the book on the pile to the left,
else put the book on the pile to the right.
Stop repeating when the selected pile is empty.
Stop repeating when the largest pile has five books or less.
Sort the piles separately using Insertion Sort.
Transfer the piles, in order, to the shelf.
The books are now sorted.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

6 Introduction

Quicksort uses two repeating sequences of steps, or loops, one inside


the other. The outer repeating group deals with all of the piles. The
inner group processes a single pile.
Quicksort is much faster than Insertion Sort for large numbers of
books. The trick is that splitting a pile is fast. Each book need only
be compared with the pivot letter. Nothing needs to be done to the
other books—no author name comparisons, no book shifts. Applying
Insertion Sort at the end of Quicksort is efficient since the piles are small.
Quicksort only requires about 10,000 operations to sort 1,000 books. The
exact number of operations depends on how accurately the pivots halve
the piles. At one second per operation, the job takes less than three
hours—a big improvement on seventeen working days. The boss will
be pleased.
Clearly, an algorithm’s speed is important. Algorithms are rated
according to their computational complexity. Computational complexity
relates the number of steps required for execution of an algorithm to
the number of inputs. The computational complexity of Quicksort is
significantly lower than that of Insertion Sort.
Quicksort is called a divide-and-conquer algorithm because it splits
the original large problem into smaller problems, solves these smaller
problems separately, and then assembles the partial solutions to form
the complete solution. As we will see, divide-and-conquer is a powerful
strategy in algorithm design.
Many algorithms have been invented for sorting, including Merge
Sort, Heapsort, Introsort, Timsort, Cubesort, Shell Sort, Bubble Sort,
Binary Tree Sort, Cycle Sort, Library Sort, Patience Sorting, Smooth-
sort, Strand Sort, Tournament Sort, Cocktail Sort, Comb Sort, Gnome
Sort, UnShuffle Sort, Block Sort, and Odd-Even Sort. All of these
algorithms sort data, but each is unique. Some are faster than others.
Some need more storage space than others. A few require that the
inputs are prepared in a special way. A handful have simply been
superseded.
Nowadays, algorithms are inextricably linked with computers. By
definition, a computer is a machine that performs algorithms.

The Algorithm Machine


As discussed, an algorithm is an abstract method for solving a problem.
An algorithm can be performed by a human or a computer. Prior to
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

The Algorithm Machine 7

execution on a computer, an algorithm must be encoded as a list of


instructions that the computer can carry out. A list of computer
instructions is called a program. The great advantage of a computer
is that it can automatically execute large numbers of instructions
one-after-another at high speed. Surprisingly, a computer need not
support a great variety of instructions. A few basic instruction types will
suffice. All that is needed are instructions for data storage and retrieval,
arithmetic, logic, repetition, and decision-making. Algorithms can be
broken down into simple instructions such as these and executed by a
computer.
The list of instructions to be performed and the data to be operated
on are referred to as the computer software. In a modern computer,
software is encoded as electronic voltage levels on microscopic wires.
The computer hardware—the physical machine—executes the program
one instruction at a time. Program execution causes the input data to
be processed and leads to creation of the output data.
There are two reasons for the phenomenal success of the computer.
First, computers can perform algorithms much more quickly than
humans. A computer can perform billions of operations per second,
whereas a human might do ten. Second, computer hardware is general-
purpose, meaning that it can execute any algorithm. Just change the
software and a computer will perform a completely different task. This
gives the machine great flexibility. A computer can perform a wide
range of duties—everything from word processing to video games. The
key to this flexibility is that the program dictates what the general-
purpose hardware does. Without the software, the hardware is idle. It
is the program that animates the hardware.
The algorithm is the abstract description of what the computer
must do. Thus, in solving a problem, the algorithm is paramount. The
algorithm is the blueprint for what must be done. The program is the
precise, machine-executable formulation of the algorithm. To solve an
information problem, a suitable algorithm must first be found. Only
then can the program be typed into a computer.
The invention of the computer in the mid-twentieth century gave
rise to an explosion in the number, variety, and complexity of al-
gorithms. Problems that were once thought impossible to solve are
now routinely dispatched by cheap computers. New programs are re-
leased on a daily basis, extending the range of tasks that computers can
undertake.
OUP CORRECTED PROOF – FINAL, 15/7/2020, SPi

8 Introduction

Algorithms are embedded in the computers on our desktops, in our


cars, in our television sets, in our washing machines, in our smart-
phones, on our wrists, and, soon, in our bodies. We engage a plethora
of algorithms to communicate with our friends, to accelerate our work,
to play games, and to find our soulmates. Algorithms have undoubtedly
made our lives easier. They have also provided humankind with un-
precedented access to information. From astronomy to particle physics,
algorithms have enhanced our comprehension of the universe. Re-
cently, a handful of cutting-edge algorithms have displayed superhu-
man intelligence.
All of these algorithms are ingenious and elegant creations of the
human mind. This book tells the story of how algorithms emerged from
the obscure writings of ancient scholars to become one of the driving
forces of the modern computerized world.
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

1
Ancient Algorithms

Go up on to the wall of Uruk, Ur-shanabi, and walk around,


Inspect the foundation platform and scrutinise the brickwork!
Testify that its bricks are baked bricks,
And that the Seven Counsellors must have laid its foundations!
One square mile is city, one square mile is orchards,
one square mile is clay pits,
as well as the open ground of Ishtar’s temple.
Three square miles and the open ground comprise Uruk.
Unknown author, translated by Stephanie Dalley
The Epic of Gilgamesh, circa 2,000 bce 2

The desert has all but reclaimed Uruk. Its great buildings are almost
entirely buried beneath accretions of sand, their timbers disintegrated.
Here and there, clay brickwork is exposed, stripped bare by the wind or
archaeologists. The abandoned ruins seem irrelevant, forgotten, futile.
There is no indication that seven thousand years ago, this land was the
most important place on Earth. Uruk, in the land of Sumer, was one of
the first cities. It was here, in Sumer, that civilization was born.
Sumer lies in southern Mesopotamia (Figure 1.1). The region is
bounded by the Tigris and Euphrates rivers, which flow from the
mountains of Turkey in the north to the Persian Gulf in the south.
Today, the region straddles the Iran–Iraq border. The climate is hot and
dry, and the land inhospitable, save for the regular flooding of the river
plains. Aided by irrigation, early agriculture blossomed in the ‘land
between the rivers’. The resulting surplus of food allowed civilization
to take hold and flourish.
The kings of Sumer built great cities—Eridu, Uruk, Kish, and Ur.
At its apex, Uruk was home to sixty thousand people. All of life was
there—family and friends, trade and religion, politics and war. We know
this because writing was invented in Sumer around 5,000 years ago.
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

10 Ancient Algorithms

Tigris
River

Euphrates
River

Alexandria Babylon
BABYLONIA
Uruk
SUMER Ur
Eridu

Figure 1.1 Map of ancient Mesopotamia and the later port of Alexandria.

Etched in Clay
It seems that writing developed from simple marks impressed on wet
clay tokens. Originally, these tokens were used for record keeping and
exchange. A token might equate to a quantity of gain or a headcount
of livestock. In time, the Sumerians began to inscribe more complex
patterns on larger pieces of clay. Over the course of centuries, simple
pictograms evolved into a fully formed writing system. That system is
now referred to as cuneiform script. The name derives from the script’s
distinctive ‘wedge shaped’ markings, formed by impressing a reed stylus
into wet clay. Symbols consisted of geometric arrangements of wedges.
These inscriptions were preserved by drying the wet tablets in the sun.
Viewed today, the tablets are aesthetically pleasing—the wedges thin
and elegant, the symbols regular, the text neatly organized into rows
and columns.
The invention of writing must have transformed these communities.
The tablets allowed communication over space and time. Letters could
be sent. Deals could be recorded for future reference. Writing facilitated
the smooth operation and expansion of civil society.
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

Uncovered at Last 11

For a millennium, cuneiform script recorded the Sumerian lan-


guage. In the twenty-fourth century bce, Sumer was invaded by the
armies of the Akkadian Empire. The conquerors adapted the Sumerian
writing methods to the needs of their own language. For a period, both
languages were used on tablets. Gradually, as political power shifted,
Akkadian became the exclusive language of the tablets.
The Akkadian Empire survived for three centuries. Thereafter, the
occupied city states splintered, later coalescing into Assyria in the north
and Babylonia in south. In the eighteenth century bce, Hammurabi,
King of Babylon, reunited the cities of Mesopotamia. The city of Babylon
became the undisputed centre of Mesopotamian culture. Under the
King’s direction, the city expanded to include impressive monuments
and fine temples. Babylonia became a regional superpower. The Akka-
dian language, and its cuneiform script, became the lingua franca of
international diplomacy throughout the Middle East.
After more than one millennium of dominance, Babylon fell, almost
without resistance, to Cyrus the Great, King of Persia. With its capital
in modern Iran, the Persian Empire engulfed the Middle East. Cyrus’s
Empire stretched from the Bosporus strait to central Pakistan and from
the Black Sea to the Persian Gulf. Persian cuneiform script came to
dominate administration. Similar at first glance to the Akkadian tablets,
these new tablets used the Persian language and an entirely different set
of symbols. Use of the older Akkadian script dwindled. Four centuries
after the fall of Babylon, Akkadian fell into disuse. Soon, all understand-
ing of the archaic Sumerian and Akkadian cuneiform symbols was lost.
The ancient cities of Mesopotamia were gradually abandoned. Be-
neath the ruins, thousands of tablets—records of a dead civilization lay
buried. Two millennia passed.

Uncovered at Last
European archaeologists began to investigate the ruins of Mesopotamia
in the nineteenth century. Their excavations probed the ancient sites.
The artefacts they unearthed were shipped back to Europe for inspec-
tion. Amongst their haul lay collections of the inscribed clay tablets.
The tablets bore writing of some sort, but the symbols were now
incomprehensible.
Assyriologists took to the daunting task of deciphering the un-
known inscriptions. Certain oft repeated symbols could be identified
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

12 Ancient Algorithms

and decoded. The names of kings and provinces became clear.


Otherwise, the texts remained impenetrable.
The turning point for translators was the discovery of the Behistun
(Bīsitūn) Inscription. The Inscription consists of text accompanied by a
relief depicting King Darius meting out punishment to handcuffed pris-
oners. Judging by their garb, these captives were from across the Persian
Empire. The relief is carved high on a limestone cliff face overlooking
an ancient roadway in the foothills of the Zagros mountains in western
Iran. The Inscription is an impressive fifteen metres tall and twenty five
metres wide.
The significance of the Inscription only became apparent after Sir
Henry Rawlinson—a British East India Company officer—visited the
site. Rawlinson scaled the cliff and made a copy of the cuneiform text. In
doing so, he spotted two other inscriptions on the cliff. Unfortunately,
these were inaccessible. Undaunted, Rawlinson returned in 1844 and,
with the aid of a local lad, secured impressions of the other texts.
It transpired that the three texts were in different languages—Old
Persian, Elamite, and Babylonian. Crucially, all three recounted the
same propaganda—a history of the King’s claims to power and his mer-
ciless treatment of rebels. Some understanding of Old Persian had per-
sisted down through the centuries. Rawlinson compiled and published
the first complete translation of the Old Persian text two years later.
Taking the Old Persian translation as a reference, Rawlinson and
a loose cadre of enthusiasts succeeded in decoding the Babylonian
text. The breakthrough was the key to unlocking the meaning of the
Akkadian and Sumerian tablets.
The tablets in the museums of Baghdad, London, and Berlin were re-
visited. Symbol by symbol, tablet by tablet, the messages of the Sumeri-
ans, Akkadians, and Babylonians were decoded. A long-lost civilization
was revealed.
The messages on the earliest tablets were simplistic. They recorded
major events, such as the reign of a king or the date of an important
battle. Over time, the topics became more complex. Legends were
discovered, including the earliest written story: The Epic of Gilgamesh.
The day-to-day administration of civil society was revealed—laws, legal
contracts, accounts, and tax ledgers. Letters exchanged by kings and
queens were found, detailing trade deals, proposals of royal marriage,
and threats of war. Personal epistles were uncovered, including love
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

Uncovered at Last 13

poems and magical curses. Amid the flotsam and jetsam of daily life,
scholars stumbled upon the algorithms of ancient Mesopotamia.
Many of the extant Mesopotamian algorithms were jotted down by
students learning mathematics. The following example dates from the
Hammurabi dynasty (1,800 to 1,600 bce), a time now known as the Old
Babylonian period. Dates are approximate; they are inferred from the
linguistic style of the text and the symbols employed. This algorithm
was pieced together from fragments held in the British and Berlin State
Museums. Parts of the original are still missing.
The tablet presents an algorithm for calculating the length and
width of an underground water cistern. The presentation is formal and
consistent with other Old Babylonian algorithms. The first three lines
are a concise description of the problem to be solved. The remainder
of the text is an exposition of the algorithm. A worked example is
interwoven with the algorithmic steps to aid comprehension. 5
A cistern.
The height is 3.33, and a volume of 27.78 has been excavated.
The length exceeds the width by 0.83.
You should take the reciprocal of the height, 3.33, obtaining 0.3.
Multiply this by the volume, 27.78, obtaining 8.33.
Take half of 0.83 and square it, obtaining 0.17.
Add 8.33 and you get 8.51.
The square root is 2.92.
Make two copies of this, adding to the one 0.42 and subtracting
from the other.
You find that 3.33 is the length and 2.5 is the width.
This is the procedure.

The question posed is to calculate the length and width of a cistern,


presumably of water. The volume of the cistern is stated, as is its
height. The required difference between the cistern’s length and width
is specified. The actual length and width are to be determined.
The phrase, ‘You should’, indicates that what follows is the method
for solving the problem. The result is followed by the declaration, ‘This
is the procedure’, which signifies the end of the algorithm.
The Old Babylonian algorithm is far from simple. It divides the
volume by the height to obtain the area of the base of the cistern.
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

14 Ancient Algorithms

Simply taking the square root of this area would give the length and
width of a square base. An adjustment must be made to create the
desired rectangular base. Since a square has minimum area for a given
perimeter, the desired rectangle must have a slightly larger area than
the square base. The additional area is calculated as the area of a square
with sides equal to half the difference between the desired length and
width. The algorithm adds this additional area to the area of the square
base. The width of a square with this combined area is calculated. The
desired rectangle is formed by stretching this larger square. The lengths
of two opposite sides are increased by half of the desired length–width
difference. The length of the other two sides is decreased by the same
amount. This produces a rectangle with the correct dimensions.
Decimal numbers are used the description above. In the original, the
Babylonians utilized sexagesimal numbers. A sexagesimal number system
possesses sixty unique digits (0–59). In contrast, decimal uses just ten
digits (0–9). In both systems, the weight of a digit is determined by
its position relative to the fractional (or decimal) point. In decimal,
moving right-to-left, each digit is worth ten times the preceding digit.
Thus, we have the units, the tens, the hundreds, the thousands, and
so on. For example, the decimal number 421 is equal to four hundreds
plus two tens plus one unit. In sexagesimal, moving right-to-left from
the fractional point, each digit is worth sixty times the preceding one.
Conversely, moving left-to-right, each column is worth a sixtieth of the
previous one. Thus, sexagesimal 1,3.20, means one sixty plus three units
plus twenty sixtieths, equal to 63 20
60 or 63.333 decimal. Seemingly, the
sole advantage of the Old Babylonian system is that thirds are much
easier to represent than in decimal.
To the modern reader, the Babylonian number system seems bizarre.
However, we use it every day for measuring time. There are sixty
seconds in a minute and sixty minutes in an hour. The time 3:04 am
is 184 (3 × 60 + 4 × 1) minutes after midnight.
Babylonian mathematics contains three other oddities. First, the frac-
tional point wasn’t written down. Babylonian scholars had to infer its
position based on context. This must have been problematic—consider
a price tag with no distinction between dollars and cents! Second, the
Babylonians did not have a symbol for zero. Today, we highlight the
gap left for zero by drawing a ring around it (0). Third, division was
performed by multiplying by the reciprocal of the divisor. In other
words, the Babylonians didn’t divide by two, they multiplied by a half.
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

Uncovered at Last 15

In practice, students referred to precalculated tables of reciprocals and


multiplications to speed up calculations.
A small round tablet shows the breathtaking extent of Babylonian
mathematics. The tablet—YBC 7289—resides in Yale University’s Old
Babylonian Collection (Figure 1.2). Dating to around 1,800 to 1,600 bce,
it depicts a square with two diagonal lines connecting opposing cor-
ners. The length of the sides of the square are marked as thirty units.
The length of the diagonal is recorded as thirty times the square root
of two.
The values indicate knowledge of the Pythagorean Theorem, which
you may recall from school. It states that, in triangles with a right angle,
the square (a value multiplied by itself) of the length of the hypotenuse
(the longest side) is equal to the sum of the squares of the lengths of the
other two sides.
What is truly remarkable about the tablet is that it was inscribed 1,000
years before the ancient Greek mathematician Pythagoras was born.
For mathematicians, the discovery is akin finding an electric light bulb
in a Viking camp! It raises fundamental questions about the history of
mathematics. Did Pythagoras invent the algorithm, or did he learn of it
during his travels? Was the Theorem forgotten and independently rein-
vented by Pythagoras? What other algorithms did the Mesopotamians
invent?
YBC 7289 states that the square root of two is 1.41421296 (in deci-
mal). This is intriguing. We now know that the square root of two is
1.414213562, to nine decimal places. Remarkably, the value on the tablet

Figure 1.2 Yale Babylonian Collection tablet 7289. (YBC 7289, Courtesy of the Yale
Babylonian Collection.)
OUP CORRECTED PROOF – FINAL, 13/7/2020, SPi

16 Ancient Algorithms

is accurate to almost seven digits, or 0.0000006. How did the Babylonians


calculate the square root of two so precisely?
Computing the square root of two is not trivial. The simplest method
is Heron of Alexandria’s approximation algorithm. There is, of course,
the slight difficulty that Heron lived 1,500 years (c. 10–70 ce) after
YBE 7289 was inscribed! We must assume that the Babylonians devised
the same method.
Heron’s algorithm reverses the question. Instead of asking ‘What is
the square root of two?’, Heron enquires ‘What number multiplied by
itself gives two?’ Heron’s algorithm starts with a guess and successively
improves it over a number of iterations:

Make a guess for the square root of two.


Repeatedly generate new guesses as follows:
Divide two by the current guess.
Add the current guess.
Divide by two to obtain a new guess.
Stop repeating when the two most recent guesses are almost
equal.
The latest guess is an approximation for the square root of two.

Let’s say that the algorithm begins with the extremely poor guess of:
2.
Dividing 2 by 2 gives 1. Adding 2 to this, and dividing by 2 gives:
1.5.
Dividing 2 by 1.5 gives 1.333. Adding 1.5 to this and dividing by 2 again
gives:
1.416666666.
Repeating once more gives:
1.41421568.
which is close to the true value.
How does the algorithm work? Imagine that you know the true value
for the square root of two. If you divide two by this number, the result
is exactly the same value—the square root of two.
Another random document with
no related content on Scribd:
spake beseechingly and passionately as if to that other youth, and
implored him to break not the heart of a poor simple shepherdess
who was willing to kiss his feet.
Neither the father of poor Amy nor Walter Harden had known
before that she had ever seen young George Elliot—but they soon
understood, from the innocent distraction of her speech, that the
noble boy had left pure the Lily he loved, and Walter said that it
belonged not to that line ever to enjure the helpless. Many a pang it
gave him, no doubt, to think that his Amy’s heart, which all his life-
long tenderness could not win, had yielded itself up in tumultuous
joy to one—two—three meetings of an hour, or perhaps only a few
minutes, with one removed so high and so far from her humble life
and all its concerns. These were cold, sickening pangs of humiliation
and jealousy, that might, in a less generous nature, have crushed all
love. But it was not so with him; and cheerfully would Walter Harden
have taken the burning fever into his own veins, so that it could have
been removed from hers—cheerfully would he have laid down his
own manly head on that pillow, so that Amy could have lifted up her
long raven tresses, now often miserably dishevelled in her raving,
and, braiding them once more, walk out well and happy into the
sunshine of the beautiful day, rendered more beautiful still by her
presence. Hard would it have been to have resigned her bosom to any
human touch; but hideous seemed it beyond all thought to resign it
to the touch of death. Let heaven but avert that doom, and his
affectionate soul felt that it could be satisfied.
Out of a long deep trance-like sleep Amy at last awoke, and her
eyes fell upon the face of Walter Harden. She regarded long and
earnestly its pitying and solemn expression, then pressed her hand to
her forehead and wept. “Is my father dead and buried—and did he
die of grief and shame for his Amy? Oh! that needed not have been,
for I am innocent. Neither, Walter, have I broken, nor will I ever
break, my promise unto thee. I remember it well—by the Bible—and
yon setting sun. But I am weak and faint. Oh! tell me, Walter! all that
has happened! Have I been ill—for hours—or for days—or weeks—or
months? For that I know not,—so wild and so strange, so sad and so
sorrowful, so miserable and so wretched, have been my many
thousand dreams!”
There was no concealment and no disguise. Amy was kindly and
tenderly told by her father and her brother all that she had uttered,
as far as they understood it, during her illness. Nor had the innocent
creature anything more to tell. Her soul was after the fever calm,
quiet, and happy. The form, voice, and shape of that beautiful youth
were to her little more now than the words and the sights of a dream.
Sickness and decay had brought her spirit back to all the humble and
tranquil thoughts and feelings of her lowly life. In the woods, and
among the hills, that bright and noble being had for a time touched
her senses, her heart, her soul, and her imagination. All was new,
strange, stirring, overwhelming, irresistible, and paradise to her
spirit. But it was gone; and might it stay away for ever: so she prayed,
as her kind brother lifted up her head with his gentle hand, and laid
it down as gently on the pillow he had smoothed. “Walter! I will be
your wife! for thee my affection is calm and deep,—but that other—
oh! that was only a passing dream!” Walter leaned over her, and
kissed her pale lips. “Yes! Walter,” she continued, “I once promised
to marry none other, but now I promise to marry thee; if indeed God
will forgive me for such words, lying as I am, perhaps, on my
deathbed. I utter them to make you happy. If I live, life will be dear
to me only for thy sake; if I die, walk thou along with my father at the
coffin’s head, and lay thine Amy in the mould. I am the Lily of
Liddisdale,—you know that was once the vain creature’s name!—and
white, pale, and withered enough indeed is, I trow, the poor Lily
now!”
Walter Harden heard her affectionate words with a deep delight,
but he determined in his soul not to bind Amy down to these
promises, sacred and fervent as they were, if, on her complete
recovery, he discovered that they originated in gratitude, and not in
love. From pure and disinterested devotion of spirit did he watch the
progress of her recovery, nor did he ever allude to young Elliot but in
terms of respect and admiration. Amy had expressed her surprise
that he had never come to inquire how she was during her illness,
and added with a sigh, “Love at first sight cannot be thought to last
long. Yet surely he would have wept to hear that I was dead.” Walter
then told her that he had been hurried away to France the very day
after she had seen him, to attend the deathbed of his father, and had
not yet returned to Scotland; but that the ladies of the Priory had
sent a messenger to know how she was every day, and that to their
kindness were owing many of the conveniences she had enjoyed.
Poor Amy was glad to hear that she had no reason to think the noble
boy would have neglected her in her illness; and she could not but
look with pride upon her lover, who was not afraid to vindicate the
character of one who, she had confessed, had been but too dear to
her only a few weeks ago. This generosity and manly confidence on
the part of her cousin quite won and subdued her heart, and Walter
Harden never approached her now without awakening in her bosom
something of that delightful agitation and troubled joy which her
simple heart had first suffered in the presence of her young, noble
lover. Amy was in love with Walter almost as much as he was with
her, and the names of brother and sister, pleasant as they had ever
been, were now laid aside.
Amy Gordon rose from her sickbed, and even as the flower whose
name she bore, did she again lift up her drooping head beneath the
dews and the sunshine. Again did she go to the hillside, and sit and
sing beside her flock. But Walter Harden was oftener with her than
before, and ere the harvest moon should hang her mild, clear,
unhaloed orb over the late reapers on the upland grain-fields, had
Amy promised that she would become his wife. She saw him now in
his own natural light—the best, the most intelligent, the most
industrious, and the handsomest shepherd over all the hills; and
when it was known that there was to be a marriage between Walter
Harden and Amy Gordon, none felt surprised, although some,
sighing, said it was seldom, indeed, that fortune so allowed those to
wed whom nature had united.
The Lily of Liddisdale was now bright and beautiful as ever, and
was returning homewards by herself from the far-off hills during one
rich golden sunset, when, in a dark hollow, she heard the sound of
horses’ feet, and in an instant young George Elliot was at her side.
Amy’s dream was over—and she looked on the beautiful youth with
an unquaking heart. “I have been far away, Amy,—across the seas.
My father—you may have heard of it—was ill, and I attended his bed.
I loved him, Amy—I loved my father—but he is dead!” and here the
noble youth’s tears fell fast. “Nothing now but the world’s laugh
prevents me making you my wife—yes, my wife, sweetest Lily; and
what care I for the world? for thou art both earth and heaven to me.
The impetuous, ardent, and impassioned boy scarcely looked in
Amy’s face; he remembered her confusion, her fears, her sighs, her
tears, his half-permitted kisses, his faintly repelled embraces, and all
his suffered endearments of brow, lip, and cheek, in that solitary dell;
so with a powerful arm he lifted her upon another steed, which, till
now, she had scarcely observed; other horsemen seemed to the
frightened, and speechless, and motionless maiden to be near; and
away they went over the smooth turf like the wind, till her eyes were
blind with the rapid flight, and her head dizzy. She heard kind words
whispering in her ear; but Amy, since that fever, had never been so
strong as before, and her high-blooded palfrey was now carrying her
fleetly away over hill and hollow in a swoon.
At last she seemed to be falling down from a height, but softly, as if
borne on the wings of the air; and as her feet touched the ground, she
knew that young Elliot had taken her from that fleet courser, and,
looking up, she saw that she was in a wood of old shadowy trees of
gigantic size, perfectly still, and far away from all known dwellings
both on hill and plain. But a cottage was before her, and she and
young Elliot were on the green in its front. It was thickly covered
with honeysuckle and moss-roses that hung their beautiful full-
blown shining lamps high as the thatched roof; and Amy’s soul
sickened at the still, secluded, lovely, and lonely sight. “This shall be
our bridal abode,” whispered her lover into her ear, with panting
breath. “Fear me not—distrust me not; I am not base, but my love to
thee is tender and true. Soon shall we be married—ay, this very
evening must thou be mine; and may the hand that now clasps thy
sweet waist wither, and the tongue that woos thee be palsied, if ever I
cease to love thee as my Amy—my Lily—my wedded wife!”
The wearied and half-fainting maiden could as yet make no reply.
The dream that she had believed was gone for ever now brightened
upon her in the intense light of reality, and it was in her power to
become the wife of him for whom she had, in the innocence and
simplicity of her nature, once felt a consuming passion that had
brought her to the brink of the grave. His warm breath was on her
bosom; words charged with bewitching persuasion went thrilling
through her heartstrings; and if she had any pride (and what human
heart has it not?) it might well mingle now with love, and impel her
into the embrace that was now open to clasp her close to a burning
heart.
A stately and beautiful lady came smiling from the cottage door,
and Amy knew that it was the sister of Elliot, and kneeled down
before her. Last time the shepherdess had seen that lady, it was
when, with a fearful step, she took her baskets into the hall, and
blushing, scarcely lifted up her eyes, when she and her high-born
sisters deigned to commend her workmanship, and whisper to each
other that the Lily of Liddisdale deserved her name. “Amy,” said she,
with a gentle voice, as she took her hand, “Amy Gordon! my brother
loves you; and he has won me to acknowledge you as my sister. I can
deny my brother nothing; and his grief has brought low the pride—
perhaps the foolish pride—of my heart. Will you marry him, Amy?
Will you, the daughter of a poor shepherd, marry the young heir of
the Priory, and the descendant, Amy, of a noble race? Amy, I see that
thou art beautiful; I know that thou art good; may God and my
mother forgive me this, but my sister must thou be; behold my
brother is at his shepherdess’s feet!”
Amy Gordon had now nothing to fear. That sweet, young, pure,
noble lady was her friend; and she felt persuaded now that in good
truth young Elliot wished to make her his wife. Might she indeed live
the Lady of the Priory—be a sister to these beautiful creatures—dwell
among those ancient woods, and all those spacious lawns and richest
gardens; and might she be, not in a dream, but in living reality, the
wife of him on whose bosom her heart had died with joy in that
lonely dell, and love him and yield him her love even unto the very
hour till she was dead? Such changes of estate had been long ago,
and sung of in many a ballad; and was she to be the one maiden of
millions, the one born in hundreds of years, to whom this blessed lot
was to befall? But these thoughts passed on and away like sun-rays
upon a stream; the cloud, not a dark one, of reality returned over her.
She thought of Walter Harden, and in an instant her soul was fixed;
nor from that instant could it be shaken by terror or by love, by the
countenance of death, or the countenance, far more powerful than of
death—that of the youth before her, pale and flushed alternately with
the fluctuations of many passions.
Amy felt in her soul the collected voice, as it were, of many happy
and humble years among her hills, and that told her not to forsake
her own natural life. The flower that lived happily and beautifully in
its own secluded nook, by the side of the lonely tarn or torrent, might
lose much both of its fragrance and its lustre, when transplanted into
a richer soil and more sheltered bed. Could she forget for ever her
father’s ingle—the earthen floor—its simple furniture of day and
night? Could she forget all the familiar places round about the hut
where she was born? And if she left them all, and was taken up even
in the arms of love into another sphere of life, would not that be the
same, or worse than to forget them, and would it not be sacrilege to
the holiness of the many Sabbath nights on which she had sat at her
widowed father’s knees? Yet might such thoughts have been
destroyed in her beating heart by the whispered music of young
Elliot’s eloquent and impassioned voice. But Walter Harden, though
ignorant of her present jeopardy, seemed to stand before her, and
she remembered his face when he sat beside her dying bed, his
prayers over her when he thought she slept, and their oaths of
fidelity mutually sworn before the great God.
“Will you, my noble and honoured master, suffer me, all unworthy
as I am to be yours, to leave your bosom? Sir, I am too miserable
about you, to pretend to feel any offence, because you will not let me
go. I might well be proud of your love, since, indeed, it happens so
that you do love me; but let me kneel down at your beautiful sister’s
feet, for to her I may be able to speak—to you I feel that it may not
be, for humble am I, although unfortunately I have found favour in
your eyes.”
The agitated youth released Amy from his arms, and she flung
herself down upon her knees before that lovely lady.
“Lady! hear me speak—a simple uneducated girl of the hills, and
tell me if you would wish to hear me break an oath sworn upon the
Bible, and so to lose my immortal soul? So have I sworn to be the
wife of Walter Harden—the wife of a poor shepherd; and, lady, may I
be on the left hand of God at the great judgment-day, if ever I be
forsworn. I love Walter Harden. Do you counsel me to break his
kind, faithful heart? Oh, sir—my noble young master! how dare a
creature such as I speak so freely to your beautiful sister? how dare I
keep my eyes open when you are at your servant’s feet? Oh, sir, had I
been born a lady, I would have lived—died for you—gone with you all
over the world—all over the sea, and all the islands of the sea. I
would have sighed, wept, and pined away, till I had won your love,
for your love would have been a blessed thing—that do I well know,
from the few moments you stooped to let your heart beat against the
bosom of a low-born shepherdess. Even now, dearly as I love Walter
Harden, fain would I lay me down and die upon this daisied green,
and be buried beneath it, rather than that poor Amy Gordon should
affect the soul of her young master thus; for never saw I, and never
can I again see, a youth so beautiful, so winning, so overwhelming to
a maiden’s heart, as he before whom I now implore permission to
grovel in the dust. Send me away—spurn me from you—let me crawl
away out of your presence—I can find my way back to my father’s
house.”
It might have been a trying thing to the pride of this high-minded
and high-born youth, to be refused in marriage by the daughter of
one of his poorest shepherds; so would it have been had he loved
less; but all pride was extinguished, and so seemed for ever and ever
the light of this world’s happiness. To plead further he felt was in
vain. Her soul had been given to another, and the seal of an oath set
upon it, never to be broken but by the hand of death. So he lifted her
up in his arms, kissed her madly a hundred times, cheek, brow, neck,
and bosom, and then rushed into the woods. Amy followed him with
her streaming eyes, and then turned again towards the beautiful
lady, who was sobbing audibly for her brother’s sake.
“Oh! weep not, lady! that I, poor Amy Gordon, have refused to
become the wife of your noble brother. The time will come, and soon
too, when he and you, and your fair sisters and your stately mother,
will all be thankful that I yielded not to entreaties that would then
have brought disgrace upon your house! Never—never would your
mother have forgiven you; and as for me, would not she have wished
me dead and buried rather than the bride of her only and darling
son? You know that, simple and innocent as I am, I now speak but
the truth; and how, then, could your noble brother have continued to
love me, who had brought dishonour, and disagreement, and
distraction, among those who are now all so dear to one another? O
yes—yes, he would soon have hated poor Amy Gordon, and, without
any blame, perhaps broken my heart, or sent me away from the
Priory back to my father’s hut. Blessed be God, that all this evil has
not been wrought by me! All—all will soon be as before.”
She to whom Amy thus fervently spoke felt that her words were
not wholly without truth. Nor could she help admiring the noble,
heroic, and virtuous conduct of this poor shepherdess, whom all this
world’s temptations would have failed to lure from the right path.
Before this meeting she had thought of Amy as far her inferior
indeed, and it was long before her proper pride had yielded to the
love of her brother, whose passion she feared might otherwise have
led to some horrible catastrophe. Now that he had fled from them in
distraction, this terror again possessed her, and she whispered it to
the pale, trembling shepherdess.
“Follow him—follow him, gentle lady, into the wood; lose not a
moment; call upon him by name, and that sweet voice must bring
him back. But fear not, he is too good to do evil; fear not, receive my
blessing, and let me return to my father’s hut; it is but a few miles,
and that distance is nothing to one who has lived all her life among
the hills. My poor father will think I have died in some solitary
place.”
The lady wept to think that she, whom she had been willing to
receive as her sister, should return all by herself so many miles at
night to a lonely hut. But her soul was sick with fear for her brother;
so she took from her shoulders a long rich Indian silk scarf of
gorgeous colours, and throwing it over Amy’s figure, said, “Fair
creature and good, keep this for my sake; and now, farewell!” She
gazed on the Lily for a moment in delighted wonder at her graceful
beauty, as she bent on one knee, enrobed in that unwonted garb, and
then, rising up, gathered the flowing drapery around her, and
disappeared.
“God, in His infinite mercy, be praised!” cried Walter Harden, as
he and the old man, who had been seeking Amy for hours all over the
hills, saw the Lily gliding towards them up a little narrow dell,
covered from head to foot with the splendid raiment that shone in a
soft shower of moonlight. Joy and astonishment for a while held
them speechless, but they soon knew all that had happened; and
Walter Harden lifted her up in his arms and carried her home,
exhausted now and faint with fatigue and trepidation, as if she were
but a lamb rescued from a snow-wreath.
Next moon was that which the reapers love, and before it had
waned Amy slept in the bosom of her husband, Walter Harden. Years
passed on, and other flowers beside the Lily of Liddisdale were
blooming in his house. One summer evening, when the shepherd, his
fair wife, and their children were sitting together on the green before
the door, enjoying probably the sight and the noise of the imps much
more then the murmurs of the sylvan Liddal, which perhaps they did
not hear, a gay cavalcade rode up to the cottage, and a noble-looking
young man, dismounting from his horse, and gently assisting a
beautiful lady to do the same, walked up to her whom he had known
only by a name now almost forgotten, and with a beaming smile said,
“Fair Lily of Liddisdale, this is my wife, the lady of the Priory; come—
it is hard to say which of you should bear off the bell.” Amy rose from
her seat with an air graceful as ever, but something more matronly
than that of Elliot’s younger bride; and while these two fair creatures
beheld each other with mutual admiration, their husbands stood
there equally happy, and equally proud—George Elliot of the Priory,
and Walter Harden of the Glenfoot.
THE UNLUCKY PRESENT.

By Robert Chambers, LL.D.

A Lanarkshire minister (who died within the present century) was


one of those unhappy persons who, to use the words of a well-known
Scottish adage, “can never see any green cheese but their een reels.”
He was extremely covetous, and that not only of nice articles of food,
but of many other things which do not generally excite the cupidity
of the human heart. The following story is in corroboration of this
assertion. Being on a visit one day at the house of one of his
parishioners, a poor, lonely widow, living in a moorland part of the
parish, Mr L—— became fascinated by the charms of a little cast-iron
pot, which happened at the time to be lying on the hearth, full of
potatoes for the poor woman’s dinner, and that of her children. He
had never in his life seen such a nice little pot. It was a perfect
conceit of a thing. It was a gem. No pot on earth could match it in
symmetry. It was an object altogether perfectly lovely.
“Dear sake! minister,” said the widow, quite overpowered by the
reverend man’s commendations of her pot; “if ye like the pot sae
weel as a’ that, I beg ye’ll let me send it to the manse. It’s a kind o’
orra pot wi’ us; for we’ve a bigger ane, that we use oftener, and that’s
mair convenient every way for us. Sae ye’ll just tak a present o’t. I’ll
send it ower the morn wi’ Jamie, when he gangs to the schule.”
“Oh,” said the minister, “I can by no means permit you to be at so
much trouble. Since you are so good as to give me the pot, I’ll just
carry it home with me in my hand. I’m so much taken with it, indeed,
that I would really prefer carrying it myself.”
After much altercation between the minister and the widow, on
this delicate point of politeness, it was agreed that he should carry
home the pot himself.
Off, then, he trudged, bearing this curious little culinary article
alternately in his hand and under his arm, as seemed most
convenient to him. Unfortunately, the day was warm, the way long,
and the minister fat; so that he became heartily tired of his burden
before he had got half-way home. Under these distressing
circumstances, it struck him that if, instead of carrying the pot
awkwardly at one side of his person, he were to carry it on his head,
the burden would be greatly lightened; the principles of natural
philosophy, which he had learned at college, informing him, that
when a load presses directly and immediately upon any object, it is
far less onerous than when it hangs at the remote end of a lever.
Accordingly, doffing his hat, which he resolved to carry home in his
hand, and having applied his handkerchief to his brow, he clapped
the pot in inverted fashion upon his head, where, as the reader may
suppose, it figured much like Mambrino’s helmet upon the crazed
capital of Don Quixote, only a great deal more magnificent in shape
and dimensions. There was at first much relief and much comfort in
this new mode of carrying the pot; but mark the result. The
unfortunate minister having taken a by-path to escape observation,
found himself, when still a good way from home, under the necessity
of leaping over a ditch, which intercepted him in passing from one
field to another. He jumped; but surely no jump was ever taken so
completely in, or, at least, into, the dark as this. The concussion
given to his person in descending, caused the helmet to become a
hood: the pot slipped down over his face, and resting with its rim
upon his neck, stuck fast there; enclosing his whole head as
completely as ever that of a new-born child was enclosed by the filmy
bag with which nature, as an indication of future good fortune,
sometimes invests the noddles of her favourite offspring. What was
worst of all, the nose, which had permitted the pot to slip down over
it, withstood every desperate attempt on the part of its proprietor to
make it slip back again; the contracted part or neck of the patera
being of such a peculiar formation as to cling fast to the base of the
nose, although it found no difficulty in gliding along its hypothenuse.
Was ever minister in a worse plight? Was there ever contretemps so
unlucky? Did ever any man—did ever any minister—so effectually
hoodwink himself, or so thoroughly shut his eyes to the plain light of
nature? What was to be done? The place was lonely; the way difficult
and dangerous; human relief was remote, almost beyond reach. It
was impossible even to cry for help. Or, if a cry could be uttered, it
might reach in deafening reverberation the ear of the utterer; but it
would not travel twelve inches farther in any direction. To add to the
distresses of the case, the unhappy sufferer soon found great
difficulty in breathing. What with the heat occasioned by the beating
of the sun on the metal, and what with the frequent return of the
same heated air to his lungs, he was in the utmost danger of
suffocation. Everything considered, it seemed likely that, if he did
not chance to be relieved by some accidental wayfarer, there would
soon be Death in the Pot.
The instinctive love of life, however, is omni-prevalent: and even
very stupid people have been found when put to the push by strong
and imminent peril, to exhibit a degree of presence of mind, and
exert a degree of energy, far above what might have been expected
from them, or what they have ever been known to exhibit or exert
under ordinary circumstances. So it was with the pot-ensconced
minister of C——. Pressed by the urgency of his distresses, he
fortunately recollected that there was a smith’s shop at the distance
of about a mile across the fields, where, if he could reach it before the
period of suffocation, he might possibly find relief. Deprived of his
eyesight, he could act only as a man of feeling, and went on as
cautiously as he could, with his hat in his hand. Half crawling, half
sliding, over ridge and furrow, ditch and hedge, somewhat like Satan
floundering over chaos, the unhappy minister travelled, with all
possible speed, as nearly as he could guess in the direction of the
place of refuge. I leave it to the reader to conceive the surprise, the
mirth, the infinite amusement of the smith and all the hangers-on of
the “smiddy,” when, at length, torn and worn, faint and exhausted,
blind and breathless, the unfortunate man arrived at the place, and
let them know (rather by signs than by words) the circumstances of
his case. In the words of an old Scottish song,
Out cam the gudeman, and high he shouted;
Out cam the gudewife, and low she louted;
And a’ the town-neighbours were gathered about it;
And there was he, I trow!

The merriment of the company, however, soon gave way to


considerations of humanity. Ludicrous as was the minister, with such
an object where his head should have been, and with the feet of the
pot pointing upwards like the horns of the great Enemy, it was,
nevertheless, necessary that he should be speedily restored to his
ordinary condition, if it were for no other reason than that he might
continue to live. He was accordingly, at his own request, led into the
smithy, multitudes flocking around to tender him their kindest
offices, or to witness the process of his release; and having laid down
his head upon the anvil, the smith lost no time in seizing and poising
his goodly forehammer.
“Will I come sair on, minister?” exclaimed the considerate man of
iron in at the brink of the pot.
“As sair as ye like,” was the minister’s answer; “better a chap i’ the
chafts than dying for want of breath.”
Thus permitted, the man let fall a hard blow, which fortunately
broke the pot in pieces without hurting the head which it enclosed, as
the cook-maid breaks the shell of the lobster without bruising the
delicate food within. A few minutes of the clear air, and a glass from
the gudewife’s bottle, restored the unfortunate man of prayer; but
assuredly the incident is one which will long live in the memory of
the parishioners.—Edinburgh Literary Journal.
THE SUTOR OF SELKIRK:
A REMARKABLY TRUE STORY.

By one of the Authors of “The Odd Volume.”

Once upon a time, there lived in Selkirk a shoemaker, by name


Rabbie Heckspeckle, who was celebrated both for dexterity in his
trade, and for some other qualifications of a less profitable nature.
Rabbie was a thin, meagre-looking personage, with lank black hair, a
cadaverous countenance, and a long, flexible, secret-smelling nose.
In short, he was the Paul Pry of the town. Not an old wife in the
parish could buy a new scarlet rokelay without Rabbie knowing
within a groat of the cost; the doctor could not dine with the minister
but Rabbie could tell whether sheep’s-head or haggis formed the
staple commodity of the repast; and it was even said that he was
acquainted with the grunt of every sow, and the cackle of every
individual hen, in his neighbourhood; but this wants confirmation.
His wife, Bridget, endeavoured to confine his excursive fancy, and to
chain him down to his awl, reminding him it was all they had to
depend on; but her interference met with exactly that degree of
attention which husbands usually bestow on the advice tendered by
their better halves—that is to say, Rabbie informed her that she knew
nothing of the matter, that her understanding required stretching,
and finally, that if she presumed to meddle in his affairs, he would be
under the disagreeable necessity of giving her a topdressing.
To secure the necessary leisure for his researches, Rabbie was in
the habit of rising to his work long before the dawn; and he was one
morning busily engaged putting the finishing stitches to a pair of
shoes for the exciseman, when the door of his dwelling, which he
thought was carefully fastened, was suddenly opened, and a tall
figure, enveloped in a large black cloak, and with a broad-brimmed
hat drawn over his brows, stalked into the shop. Rabbie stared at his
visitor, wondering what could have occasioned this early call, and
wondering still more that a stranger should have arrived in the town
without his knowledge.
“You’re early afoot, sir,” quoth Rabbie. “Lucky Wakerife’s cock will
no craw for a good half hour yet.”
The stranger vouchsafed no reply; but taking up one of the shoes
Rabbie had just finished, deliberately put it on, and took a turn
through the room to ascertain that it did not pinch his extremities.
During these operations, Rabbie kept a watchful eye on his customer.
“He smells awfully o’ yird,” muttered Rabbie to himself; “ane
would be ready to swear he had just cam frae the plough-tail.”
The stranger, who appeared to be satisfied with the effect of the
experiment, motioned to Rabbie for the other shoe, and pulled out a
purse for the purpose of paying for his purchase; but Rabbie’s
surprise may be conceived, when, on looking at the purse, he
perceived it to be spotted with a kind of earthy mould.
“Gudesake,” thought Rabbie, “this queer man maun hae howkit
that purse out o’ the ground. I wonder where he got it. Some folk say
there are dags o’ siller buried near this town.”
By this time the stranger had opened the purse, and as he did so, a
toad and a beetle fell on the ground, and a large worm crawling out
wound itself round his finger. Rabbie’s eyes widened; but the
stranger, with an air of nonchalance, tendered him a piece of gold,
and made signs for the other shoe.
“It’s a thing morally impossible,” responded Rabbie to this mute
proposal. “Mair by token, that I hae as good as sworn to the
exciseman to hae them ready by daylight, which will no be long o’
coming” (the stranger here looked anxiously towards the window);
“and better, I tell you, to affront the king himsel, than the
exciseman.”
The stranger gave a loud stamp with his shod foot, but Rabbie
stuck to his point, offering, however, to have a pair ready for his new
customer in twenty-four hours; and, as the stranger, justly enough
perhaps, reasoned that half a pair of shoes was of as little use as half
a pair of scissors, he found himself obliged to come to terms, and
seating himself on Rabbie’s three-legged stool, held out his leg to the
Sutor, who, kneeling down, took the foot of his taciturn customer on
his knee, and proceeded to measure it.
“Something o’ the splay, I think, sir,” said Rabbie, with a knowing
air.
No answer.
“Where will I bring the shoon to when they’re done?” asked
Rabbie, anxious to find out the domicile of his visitor.
“I will call for them myself before cock crowing,” responded the
stranger in a very uncommon and indescribable tone of voice.
“Hout, sir,” quoth Rabbie, “I canna let you hae the trouble o’
coming for them yoursel; it will just be a pleasure for me to call with
them at your house.”
“I have my doubts of that,” replied the stranger, in the same
peculiar manner; “and at all events, my house would not hold us
both.”
“It maun be a dooms sma’ biggin,” answered Rabbie; “but noo that
I hae ta’en your honour’s measure——”
“Take your own!” retorted the stranger, and giving Rabbie a touch
with his foot that laid him prostrate, walked coolly out of the house.
This sudden overturn of himself and his plans for a few moments
discomfited the Sutor; but quickly gathering up his legs, he rushed to
the door, which he reached just as Lucky Wakerife’s cock proclaimed
the dawn. Rabbie flew down the street, but all was still; then ran up
the street, which was terminated by the churchyard, but saw only the
moveless tombs looking cold and chill under the grey light of a
winter morn. Rabbie hitched his red nightcap off his brow, and
scratched his head with an air of perplexity.
“Weel,” he muttered, as he retraced his steps homewards, “he has
warred me this time, but sorrow take me if I’m no up wi’ him the
morn.”
All day Rabbie, to the inexpressible surprise of his wife, remained
as constantly on his three-legged stool as if he had been “yirked”
there by some brother of the craft. For the space of twenty-four
hours, his long nose was never seen to throw its shadow across the
threshold of the door; and so extraordinary did this event appear,
that the neighbours, one and all, agreed that it predicted some
prodigy; but whether it was to take the shape of a comet, which
would deluge them all with its fiery tail, or whether they were to be
swallowed up by an earthquake, could by no means be settled to the
satisfaction of the parties concerned.
Meanwhile, Rabbie diligently pursued his employment, unheeding
the concerns of his neighbours. What mattered it to him, that Jenny
Thrifty’s cow had calved, that the minister’s servant, with something
in her apron, had been seen to go in twice to Lucky Wakerife’s, that
the laird’s dairy-maid had been observed stealing up the red loan in
the gloaming, that the drum had gone through the town announcing
that a sheep was to be killed on Friday?—The stranger alone swam
before his eyes; and cow, dairymaid, and drum kicked the beam. It
was late in the night when Rabbie had accomplished his task, and
then placing the shoes at his bedside, he lay down in his clothes, and
fell asleep; but the fear of not being sufficiently alert for his new
customer, induced him to rise a considerable time before daybreak.
He opened the door and looked into the street, but it was still so dark
he could scarcely see a yard before his nose; he therefore returned
into the house, muttering to himself—“What the sorrow can keep
him?” when a voice at his elbow suddenly said—
“Where are my shoes?”
“Here, sir,” said Rabbie, quite transported with joy; “here they are,
right and tight, and mickle joy may ye hae in wearing them, for it’s
better to wear shoon than sheets, as the auld saying gangs.”
“Perhaps I may wear both,” answered the stranger.
“Gude save us,” quoth Rabbie, “do ye sleep in your shoon?”
The stranger made no answer; but, laying a piece of gold on the
table and taking up the shoes, walked out of the house.
“Now’s my time,” thought Rabbie to himself, as he slipped after
him.
The stranger paced slowly on, and Rabbie carefully followed him;
the stranger turned up the street, and the Sutor kept close to his
heels. “’Odsake, where can he be gaun?” thought Rabbie, as he saw
the stranger turn into the churchyard; “he’s making to that grave in
the corner; now he’s standing still; now he’s sitting down. Gudesake!
what’s come o’ him?” Rabbie rubbed his eyes, looked round in all
directions, but, lo and behold! the stranger had vanished. “There’s
something no canny about this,” thought the Sutor; “but I’ll mark the
place at ony rate;” and Rabbie, after thrusting his awl into the grave,
hastily returned home.
The news soon spread from house to house, and by the time the
red-faced sun stared down on the town, the whole inhabitants were
in commotion; and, after having held sundry consultations, it was
resolved, nem. con., to proceed in a body to the churchyard, and
open the grave which was suspected of being suspicious. The whole
population of the Kirk Wynd turned out on this service. Sutors,
wives, children, all hurried pell-mell after Rabbie, who led his
myrmidons straight to the grave at which his mysterious customer
had disappeared, and where he found his awl still sticking in the
place where he had left it. Immediately all hands went to work; the
grave was opened; the lid was forced off the coffin; and a corpse was
discovered dressed in the vestments of the tomb, but with a pair of
perfectly new shoes upon its long bony feet. At this dreadful sight the
multitude fled in every direction, Lucky Wakerife leading the van,
leaving Rabbie and a few bold brothers of the craft to arrange
matters as they pleased with the peripatetic skeleton. A council was
held, and it was agreed that the coffin should be firmly nailed up and
committed to the earth. Before doing so, however, Rabbie proposed
denuding his customer of his shoes, remarking that he had no more
need for them than a cart had for three wheels. No objections were
made to this proposal, and Rabbie, therefore, quickly coming to
extremities, whipped them off in a trice. They then drove half a
hundred tenpenny nails into the lid of the coffin, and having taken
care to cover the grave with pretty thick divots, the party returned to
their separate places of abode.
Certain qualms of conscience, however, now arose in Rabbie’s
mind as to the propriety of depriving the corpse of what had been
honestly bought and paid for. He could not help allowing, that if the
ghost were troubled with cold feet, a circumstance by no means
improbable, he might naturally wish to remedy the evil. But, at the
same time, considering that the fact of his having made a pair of
shoes for a defunct man would be an everlasting blot on the
Heckspeckle escutcheon, and reflecting also that his customer, being
dead in law, could not apply to any court for redress, our Sutor
manfully resolved to abide by the consequences of his deed.
Next morning, according to custom, he rose long before day, and
fell to his work, shouting the old song of the “Sutors of Selkirk” at the
very top of his voice. A short time, however, before the dawn, his
wife, who was in bed in the back room, remarked, that in the very
middle of his favourite verse, his voice fell into a quaver; then broke
out into a yell of terror; and then she heard a noise, as of persons
struggling; and then all was quiet as the grave. The good dame
immediately huddled on her clothes, and ran into the shop, where
she found the three-legged stool broken in pieces, the floor strewed
with bristles, the door wide open, and Rabbie away! Bridget rushed
to the door, and there she immediately discovered the marks of
footsteps deeply printed on the ground. Anxiously tracing them, on—
and on—and on—what was her horror to find that they terminated in
the churchyard, at the grave of Rabbie’s customer! The earth round
the grave bore traces of having been the scene of some fearful
struggle, and several locks of lank black hair were scattered on the
grass. Half distracted, she rushed through the town to communicate
the dreadful intelligence. A crowd collected, and a cry speedily arose
to open the grave. Spades, pickaxes, and mattocks, were quickly put
in requisition; the divots were removed; the lid of the coffin was once
more torn off, and there lay its ghastly tenant, with his shoes
replaced on his feet, and Rabbie’s red night-cap clutched in his right
hand!
The people, in consternation, fled from the churchyard; and
nothing further has ever transpired to throw any additional light
upon the melancholy fate of the Sutor of Selkirk.
ELSIE MORRICE.

From the “Aberdeen Censor.”


Oh, wert thou of the golden-wingèd host,
Who, having clad thyself in human weed,
To earth, from thy prefixèd seat didst post,
And, after short abode, fly back with speed,
As if to show what creatures Heav’n doth breed,
Thereby to set the hearts of men on fire,
To scorn the sordid world, and unto Heav’n aspire?—Milton.

In the neighbourhood of the pleasant village of ——, on the east


coast of Scotland, lived Janet Morrice and her grand-daughter Elsie.
A small cottage, overlaid with woodbine on the exterior, and neat
and clean in the interior, contained this couple; and a small farm
attached to it served to supply all their humble desires. The place was
no doubt agreeable to look on; but it was a pair of bright blue eyes,
some light brown locks, and a sweet and modest face, that drew all
the male visitors to the house of Janet Morrice. Elsie Morrice, her
grandchild, had been left a young orphan to her charge. She was the
only child of an only son, and thus came with a double call on the
feelings of her old grandmother. Dearly was she loved by her, and
well did she deserve it; for a better and a kindlier girl was not in all
the country round. Out of the many young men that paid their
attentions to Elsie, it was soon evident that her favourite was William
Gordon. In his person he had nothing particular to recommend him
above his companions; but there was in him that respectful
demeanour, that eagerness to please, and that happiness in serving
the object of his affections, which the eyes of a young woman can so
soon perceive, and her heart so readily appreciate. In their
dispositions, though not similar, they were drawn to each other. She

You might also like