Ebooks File Explorations in Computing An Introduction To Computer Science 1st Edition John S. Conery All Chapters
Ebooks File Explorations in Computing An Introduction To Computer Science 1st Edition John S. Conery All Chapters
com
https://ebookname.com/product/explorations-in-computing-an-
introduction-to-computer-science-1st-edition-john-s-conery/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/chemical-engineering-dynamics-an-
introduction-to-modelling-and-computer-simulation-3rd-edition-
john-ingham/
https://ebookname.com/product/software-engineering-and-testing-
an-introduction-computer-science-1st-edition-b-b-agarwal/
https://ebookname.com/product/matlab-for-neuroscientists-an-
introduction-to-scientific-computing-in-matlab-1st-edition-
pascal-wallisch/
https://ebookname.com/product/alzheimer-s-disease-a-century-of-
scientific-and-clinical-research-stand-alone-1st-edition-ios-
press/
Autodesk Revit Architecture 2015 No Experience Required
Autodesk Official Press 1st Edition Eric Wing
https://ebookname.com/product/autodesk-revit-
architecture-2015-no-experience-required-autodesk-official-
press-1st-edition-eric-wing/
https://ebookname.com/product/automotive-engine-valve-recession-
engineering-research-series-rep-1st-edition-roger-lewis/
https://ebookname.com/product/mcgraw-hill-s-gmat-2009-edition-
james-hasik/
https://ebookname.com/product/advanced-methods-of-biomedical-
signal-processing-ieee-press-series-on-biomedical-
engineering-1st-edition-sergio-cerutti/
https://ebookname.com/product/kierkegaard-and-luther-coe/
Planet Savers 301 Extraordinary Environmentalists 1st
Edition Kevin Desmond
https://ebookname.com/product/planet-savers-301-extraordinary-
environmentalists-1st-edition-kevin-desmond/
EXPLORATIONS
IN COMPUTING
An Introduction to Computer Science
Series Editors
This series covers traditional areas of computing, as well as related technical areas, such as
software engineering, artificial intelligence, computer engineering, information systems, and
information technology. The series will accommodate textbooks for undergraduate and gradu-
ate students, generally adhering to worldwide curriculum standards from professional societ-
ies. The editors wish to encourage new and imaginative ideas and proposals, and are keen to
help and encourage new authors. The editors welcome proposals that: provide groundbreaking
and imaginative perspectives on aspects of computing; present topics in a new and exciting
context; open up opportunities for emerging areas, such as multi-media, security, and mobile
systems; capture new developments and applications in emerging fields of computing; and
address topics that provide support for computing, such as mathematics, statistics, life and
physical sciences, and business.
Published Titles
EXPLORATIONS
IN COMPUTING
An Introduction to Computer Science
John S. Conery
With Illustrations
by Phil Foglio
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to
publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials
or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material repro-
duced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any
copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any
form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming,
and recording, or in any information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copy-
right.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400.
CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been
granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identifica-
tion and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
vii
viii
This book is a textbook, intended for courses that are an introduction to computer science.
The emphasis is on how computation helps people solve problems. Computer science is
a huge field, and entire books have been written about algorithms, theory, programming
languages, databases, networks, and other areas. Rather than trying to survey the entire
field and give a brief introduction to each important area, the goals in this book are to
focus on the fundamental idea of computation itself and to give readers some insight into
how computation can be used to solve a variety of interesting and important real-world
problems.
Active Learning
The distinguishing feature of this book is its active learning approach. Each chapter includes
a tutorial project that guides students as they use an interactive environment to explore
important ideas in computing by running programs, modifying them, and trying them out
on different inputs.
One of the inspirations for this approach was the active learning embodied in a role-
playing game called The Oregon Trail. Students who played this game learned about the
great westward migration of the nineteenth century by making decisions for their character
as they traveled from Missouri to Oregon in 1848, trying to manage their resources and
avoid hazards along the way. By actively engaging with the material in a virtual environ-
ment, and making decisions that would affect the outcome of the game, students gained a
much deeper appreciation of what life was like for the people who set out on that journey.
One of the factors often cited for the success of this game is that students were able to
try many different variations. Students could play the game several times, assuming sev-
eral different roles, and often seeing a different outcome, even when they made the same
decisions.
The title of this book, Explorations in Computing, conveys the idea of how we will use a
similar active learning approach to study computation. Each chapter is organized around
a single project that introduces an important concept or application in computer science.
To complete the project, students type commands in Ruby, an interactive programming lan-
guage, following a detailed script set out in the text. The aim is for the students to immerse
themselves in the interactive environment and experience first-hand what goes on inside a
computer as it solves some interesting problems. Many parts of the projects are open-ended,
and students are encouraged to continue exploring on their own, after using the exercises
in the book as a starting point.
An example of this approach is the project in a chapter on the N -body problem, where
students set up an experiment that simulates the motion of the planets in the solar system.
After running the basic exercises, which lead up to a simulation that shows the planets
moving in elliptical orbits around the Sun, students can explore on their own, to see what
happens in a chaotic system when the initial conditions change just slightly, or when the
mass of one of the planets is increased to the point where the system has two bodies the
size of the Sun. Another example is a project on the traveling salesman problem, where
students run experiments based on a genetic algorithm. After running a set of preliminary
experiments to learn how the algorithm evolves an efficient tour through random mutations,
students can run more simulations, varying the simulation parameters to see what effect
each has on the outcome.
ix
Intended Audience
This book was written for students who want to learn what computer science is about. It was
written with two different audiences in mind: students who intend to continue on to major
in computer science, and would like a general overview of the field, and students who have
chosen to major in a different field, but who would like to take a computer science course
as a science elective.
Although the projects in this book are set up to run in an interactive programming en-
vironment, no prior experience with programming is necessary. To complete a project,
students follow detailed instructions from the text, much like working on a tutorial to learn
how to use a new software application. By working through the projects in each chap-
ter, readers will build up a working knowledge of the concepts and terminology of Ruby
programming, but the projects do not require students to write any of their own programs.
Although students do not need programming experience, they should be proficient com-
puter users. Students who want to do the projects on their own computers will need to
install some software (explained in more detail below), so they should be comfortable with
the process of connecting to the Internet and downloading and installing applications. Sev-
eral projects also require students to create folders and navigate through a file system, and
to open, edit, and save text files.
The projects are based on a variety of different subjects, but none of the exercises assume
any detailed knowledge of the subject area. The introduction to each section should provide
the necessary background to work on the project in that chapter.
As might be expected for a science class, many projects do require a basic proficiency
in math. Students should be comfortable with logarithms, exponents, square roots, and
other basic mathematical functions. Projects do not require students to solve equations or
to work through proofs, as they would in a math course, but students should understand
what the functions are and how they are used. Students will gain a deeper appreciation for
scalability and other important concepts in computer science when they have the necessary
math background.
© Advanced Topics
Some chapters include more challenging ideas or exercises. In some cases there will be an
entire section devoted to an advanced topic, and in other cases there may be recommended
projects for students who want to learn more about a topic or do some more exploration on
their own. These sections and projects are indicated by a © symbol, to indicate material that
requires more advanced skills, like the trails marked with a “black diamond” at a downhill
ski area.
thinking about what your computer is doing as it runs a computation, you will be rewarded
by gaining a deeper insight into how computers can help solve a wide variety of important
problems.
A useful analogy for these projects are the lab projects that go along with an introductory
chemistry course. An instructor selects a set of concepts the students should learn and then
develops a set of lab projects to help students gain some experience and reinforce their
learning of the concepts. The materials and methods are all spelled out in great detail,
and students follow a set of well-specified steps. Those who continue on in chemistry will
later learn to design their own experiments, but for beginners everything is set up by the
instructor.
That same approach is taken here in this book. The “computational experiments” in each
chapter are tutorials that contain detailed instructions for how to start a piece of software
and then what to type in order to run the experiment. As you interact with the software
you will see how the computation unfolds. The tutorials are designed so that you should be
able to complete them in about the same amount of time you would spend on a lab project
in a chemistry class. You could run through the tutorials in less time—about as fast as you
can type, or if you get examples from web pages, as fast as you can cut and paste—but you
should take the time to make sure you understand what your computer is doing as you carry
out each step in the tutorial.
At the end of each chapter you will find a set of exercises. These are similar to the ques-
tions you would find in a more traditional textbook and are designed to test your under-
standing of the material in that chapter. If you have completed the tutorial and understood
what happened at each step along the way you should be able to answer these questions.
expressions students enter create and manipulate objects and call methods that implement
the algorithm being studied.
The viability of the scripted tutorial approach is based on the fact that is is much easier
to learn to read existing programs than to write new ones. Anyone who has tried to learn a
foreign language knows how much easier it is to read phrases in the new language than it
is to speak or write a sentence. A similar effect applies to programming languages as well.
Beginning students can reach a surprising level of literacy by just learning a few fundamental
concepts of object-oriented programming—objects, classes, methods, variables, and control
flow—with the view that they are learning a language that is a notation for describing
algorithms. Since students are only expected to understand programs, they do not need to
learn how to design, implement, test, and debug their own code, and several messy details
covered in introductory programming courses, like scope rules, call by reference, variable
lifetimes, etc., can safely be ignored.
I chose to use Ruby for these projects for several reasons, the foremost being the inter-
active programming environment that supports experimentation. Ruby has a very clean
syntax, and for most operations it provides an intuitive notation. Ruby is open source and
is easily downloaded and installed on a wide variety of systems.
An important question was whether to try to make the book a comprehensive introduction
to the entire field of computer science, or whether to focus on fewer topics and go into them
in more depth. I chose the latter. I think the projects will be much more interesting, and
students will gain a better overall understanding of what computer science is about and
how computer scientists think about problems, if the book has a few well-chosen examples,
even if it means leaving out several important topics.
The topics presented in the book are outlined below. The general pattern for each chapter
will be to first introduce the concept presented in that chapter; this introductory section will
essentially be an essay that tries to make the case that the idea is interesting and worth un-
derstanding in more detail. The main part of the chapter will be the development, through a
series of projects, of one or more algorithms that illustrate the idea and provide the student
with a chance to experiment.
1 Introduction
The book starts with a general introduction to computation, expanding on the themes men-
tioned in the first section of this preface: computer science is not just about computers and
is not just programming.
The second chapter is a practical introduction to Ruby and how it can be used as a “com-
putational workbench” to set up experiments with computations. The tutorial takes the
students through the construction of a simple program to convert temperature from Celsius
to Fahrenheit, and introduces the ideas of variables, objects, and methods.
xii
This chapter introduces the first real algorithm studied in the book. It also introduces a few
more practical techniques used later in the book: making lists of numbers and iterating over
a list. The tutorial starts with simple expressions involving integers, shows how to make a
list of numbers, then how to selectively remove composite numbers, and leads finally to an
algorithm that creates a complete list of prime numbers.
This chapter builds on the basic idea of iteration presented in the previous chapter. The
project shows how iteration can be used to solve two common problems, searching and
sorting, using linear search and insertion sort. An important idea in computing in this
chapter is scalability, and students are introduced to O notation.
The important idea in this chapter is that a more sophisticated strategy for solving a problem
can lead to a more efficient computation. The tutorial shows how binary search takes up to
log2 n steps instead of n, and merge sort takes at most n log2 n steps instead of n2 .
The new concept in this chapter is that our ability to solve a problem computationally de-
pends not only on the sequence of steps defined by an algorithm, but also on how the data
is organized. The tutorial project is based on a data structure that implements an index for a
large collection of data. Students learn about hash functions and eventually do experiments
with a hash table that resolves collisions with buckets.
7 Bit by Bit
The projects in this chapter are related to encoding data: using patterns of binary digits
to encode numbers and letters, the number of bits required to encode a set of items, text
compression with Huffman trees, and error correction with parity bits.
This chapter introduces the important ideas that functions can also be encoded as a string
of bits and that instructions (bit patterns representing steps that implement functions) are
stored in a computer’s memory along with data. The tutorial uses the game of Corewar,
which is a contest between two programs running in the same virtual machine; a program
wins if it can write a halt instruction over the opponent’s code. The tutorial leads the student
through the phases of a processor’s fetch-decode-execute cycle and emphasizes how a word
that is a piece of data (the constant 0) for one program becomes an instruction (halt) for
the other program.
xiii
The big idea in this chapter is randomness, and how random numbers can be used in a
variety of algorithms, from games to scientific applications. There is an interesting paradox
here: can we really generate random outputs from an algorithm? Isn’t a method in Ruby
supposed to carry out exactly the same calculations and produce the same result each time
it is called? The answer is that random numbers generated by an algorithm are pseudoran-
dom, and the project takes students through the steps in the development and testing of a
pseudorandom number generator.
The tutorial project in this chapter is based on a Ruby implementation of Joseph Weizen-
baum’s ELIZA program, and shows how very simple pattern matching rules can be used to
transform input sentences, giving the illusion that the computer is carrying on a conversa-
tion. By the end of the chapter students will see how difficult natural language processing
is, and how semantics and real-world knowledge are required for effective natural language
understanding.
The big idea in this chapter is computer simulation. The project leads to an ab initio simu-
lation of the motion of planets in the solar system. The chapter introduces issues related to
verification and other topics in computer simulation.
The last chapter introduces the idea of intractable problems, building on ideas of scalability
from earlier chapters. The project is based on a genetic algorithm, and gives students the
opportunity to explore probabilistic solutions. The tutorial has students use predefined code
for Map and Tour classes to create random tours, so they can see how tours can be mutated
and how collections of tours evolve until an optimal or near-optimal solution is obtained.
Pedagogical Considerations
The chapters and projects described above have been used in a course at the University of
Oregon (CIS 170: The Science of Computing). We cover the first two chapters during the first
week, but after that we spend between one and two weeks on the remaining topics chosen
for that term. Lectures emphasize material from the first sections of a chapter, describing the
problem and how it might be solved computationally, and explaining how that week’s lab
project gives some experience with the computation. Students have an option of attending
a lab session, where an instructor is available to help them work through the material, but
many students do the tutorials on their own. Live demonstrations of the tutorial projects,
both in lecture and in lab sessions, have proved to be very effective.
xiv
1: Introduction
2: Ruby Workbench
At the end of each chapter there is a set of exercises that ask questions about issues raised
in the chapter. After the students have completed the tutorial, they are asked to answer
a selected set of questions and submit them as a “lab report” that gives them a chance to
explain what they learned. Similar questions are given on exams.
When selecting topics to use in a course, Chapters 1 through 4 should be used every
term, since they introduce key concepts (algorithms, scalability) and practical lab skills (in-
stantiating objects, calling methods, creating and iterating over containers) used in other
projects. The remaining chapters are mostly independent, and can be selected according to
the interests of the students. The chapters on data representations (Bit by Bit) and machine
language programming (War of the Words) are both based on the idea of encoding informa-
tion, but students will have no trouble completing the Corewar project without having done
the data representation projects. Similarly, The Traveling Salesman uses random numbers,
but students will get a lot out of this project even if they haven’t seen how random numbers
are generated.
It is also possible to organize a course that includes additional topics and activities beyond
those described in this book. In Spring 2008, a few months before the national elections in
the U.S., we used electronic voting as a theme for CIS 170. There were additional units on
the history of elections and the need for privacy and security in voting, and the computer
science topics included networking, encryption, and software engineering, all of which play
a role in the design of electronic voting machines.
• A single command typed in a terminal window will install Ruby on a Linux system.
• Ruby is already installed on Mac OS X 10.4 and later (although users running Mac OS
X 10.6 may have to reinstall Ruby to work on labs that have interactive visualizations).
The software students will use for the projects is named RubyLabs. RubyLabs is written
exclusively in Ruby, using only libraries and modules that are part of the standard Ruby
distribution. There is one Ruby module for each lab project. All of the modules have been
collected into a single “Ruby gem,” which makes it easy to install all the lab software in one
step at the beginning of the term. The RubyLabs gem also includes data files and sample
Ruby code that students can copy and modify.
A Lab Manual with step-by-step instructions for installing Ruby and the RubyLabs gem
is available from the book web site at http://www.cs.uoregon.edu/eic. There is a
separate version of the manual for Windows XP, Mac OS X, and Linux. The manual also
includes tips for editing programs and running commands in a terminal emulator.
The web site also has on-line documentation of all the modules in the RubyLabs gem.
After the gem has been installed, this documentation can be read locally by a web browser,
without having to connect to the Internet.
Web Site
Explorations in Computing
The web site for this book is
http://www.cs.uoregon.edu/eic
Acknowledgments
The most important group of people who influenced the development of this book are, with-
out a doubt, the students at the University of Oregon who have been involved in one way
or another with CIS 170, the Science of Computing course I have taught each year since the
2005-06 academic year. Students who took the course and provided invaluable suggestions
(often without waiting for me to ask) include: Joyce Corrao-Clanon, Alex Forbes, Emily
Hayes, Isla Globus-Harris, Peri Moritz, Paul Russ, Charles Sheinin, Richard Suhr, and Ace
Taylor. Jeff Blakeslee developed an early version of the binary tree visualizations used in
Chapter 7, and Michael Maag made a key contribution to the RubyLabs canvas that is used
in all the visualizations.
Anyone who has taught a college or university level course knows how important it is to
have motivated and engaged teaching assistants, and I have been lucky to work with the
best: Megen Brittell, Tom Bulatewicz, Victor Hanson-Smith, and Shad Stafford. Shad also
used an early draft of Chapters 2 and 3 in a course he taught at Pacific University in Forest
Grove, Oregon, and I received many helpful comments from Shad and his students.
I was thrilled when Phil Foglio responded to my e-mail and said he would be willing to
make a set of illustrations for the book. Many thanks to Phil, Kaja Foglio (self-proclaimed
“scanning bot”), and the other folks at Studio Foglio, LLC for making it happen.
John Impagliazzo and Andrew McGettrick, the series editors for Chapman & Hall/CRC
Press, provided several constructive suggestions during the early phase of the development
of the book. From the rough draft I initially submitted, they were able to help me focus
on a better choice of topics and more readable presentation. I am also indebted to the
external reviewers, especially Jessen Havill, of Denison University, and Andrew Neel, from
the University of Memphis.
While the students, reviewers, and editors all had a tremendous influence on the contents
of the book, it would have remained just another interesting idea instead of a real book if
not for the efforts of Randi Cohen, my editor at CRC Press. Randi somehow knew exactly
when I needed encouragement and positive feedback, to keep me going when it seemed like
there was no end in sight, and when to set a firm deadline, when it looked like I was going
to keep exploring forever.
Finally, I am grateful for the support of my wife Leslie and my daughter Kathleen. Kath-
leen looked over my lecture notes, read early versions of some of the chapters, and, thank-
fully, let me know how some of my attempts at humor would have been received by others
of her generation. I love you both.
John Conery
Eugene, Oregon
Contents
1 Introduction 1
1.1 Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 The Limits of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 A Laboratory for Computational Experiments . . . . . . . . . . . . . . . . . . 12
xvii
xviii Contents
Index 365
Chapter 1
Introduction
In the summer of 1821, an English mathematician named Charles Babbage was working
with his friend, the astronomer John Herschel, to create a book of mathematical tables.
Before computers and calculators were available, people who needed to solve mathematical
equations would find the value of a function by searching a table in a reference book like the
one shown in Figure 1.1. These books were essential for navigators, architects, merchants,
bankers, and anyone else who used math in their profession. There were tables for interest
rates, currency conversion, liquid and dry measures, and just about any other quantity that
could be expressed with numbers. Not surprisingly, there was a strong demand for accurate
tables, and a tremendous amount of time and effort went into creating and checking values
printed in reference books.
Babbage and Herschel were working on a nautical almanac, a book of tables containing
the positions of the Moon, planets, and stars. These almanacs were used by navigators to
determine their location at sea. More than any others, these tables needed to be accurate,
as there were concerns that errors in tables could lead to longer routes than necessary, or
even shipwrecks. Babbage and Herschel would meet periodically to check the tables being
made by a group of people they had hired to work through the tedious steps required to fill
the rows. At one of their meetings, when reviewing the latest results, Babbage showed his
frustration with the large number of errors by exclaiming, “I wish to God these calculations
had been executed by steam!”
Of course Babbage wasn’t attributing any special powers to water vapor. The year 1821
was the height of the Industrial Revolution, when machines powered by steam engines
were beginning to automate tasks previously carried out by humans. Babbage was simply
using the terminology of his time to express his wish that the calculations should be done
automatically, by a machine, so the results would be more accurate and reliable.
The quote from Babbage brings up an interesting question. Steam power was helping
transform physical labor, and machines were beginning to be widely used to augment, or
even replace, human effort. But what about mental labor? What made Babbage think steam
engines could help him solve mathematical problems?
1
2 Chapter 1 Introduction
Figure 1.1: Chambers’s Mathematical Tables, New Edition, London, 1901. Before there were
computers to calculate mathematical functions, if a person wanted to know the value of a
trigonometric function, they would look in a table of sines and cosines. For example, to find the
value of cos 30◦ 200 , the person would find the page for 30◦ , then scan down to the row for 200
and look in the column labeled “cosine.”
This is a book about computation. The focus is on the nature of computation, with the
goal of showing how executing a series of simple steps can eventually lead to the solution of
a complex problem. Computers are widely used, not just in math and science, but in every
facet of modern life. The aims of this book are to explore the computations that take place
in a wide variety of applications and to learn how this powerful idea helps people solve
interesting and important problems.
1.1 Computation
Charles Babbage was not the first person to dream of using a machine to help him with
his math. The idea of solving a complex problem by systematic execution of simple and
straightforward operations is thousands of years old. Ancient Greek, Egyptian, and Chinese
philosophers all discovered many important facts about numbers and their relationships.
These mathematicians developed methods that are still used today to determine whether
a number is prime or how to find the largest common denominator of a pair of numbers.
They also devised many different tools to help them perform their calculations; in fact the
word “calculate” comes from the Latin for “pebble,” since small stones or beads were used
in an abacus or similar device.
Many famous mathematicians in post-Renaissance Europe, including Johannes Kepler
(1571–1630), Blaise Pascal (1623–1662), and Gottfried Leibniz (1646–1716), dreamed that
one day there would be machines to carry out the steps in a computation automatically. As
Leibniz once wrote,
Astronomers surely will not have to continue to exercise the patience which is required
for computation. It is this that deters them from . . . working on hypotheses and from
discussions of observations with each other. For it is unworthy of excellent men to lose
hours like slaves in the labor of calculation which could safely be relegated to anyone
else if machines were used.
Pascal invented a mechanical calculator that was able to perform additions and subtrac-
tions of numbers up to six digits long. Leibniz designed a calculator that could also do
multiplications and divisions. These early machines were able to assist human computers,
in much the way an abacus or other device might. It wasn’t until the nineteenth century
that designs for fully automated machines started to appear. Babbage himself played a key
role. He designed a machine he called the Difference Engine, coming up with ingenious
ideas that later influenced the builders of some of the first successful mechanical computers
in the middle 1900s.
The first electronic computers were developed during World War II. Soon after the end
of the war the idea of using machines to automate the calculations in science and business
began to spread, and several companies started manufacturing computing machines. The
machines were very big and very expensive, though, and were found only in the largest
corporations, government bureaus, or university research labs. They were used for such
diverse tasks as computing the trajectories of rockets and missiles, predicting the weather,
and business data processing applications for payroll and accounting.
Fast forward fifty years, and computation has now become an essential part of modern
life. Every day we write mail, share photographs, play music, read the news, and pay bills
4 Chapter 1 Introduction
using our personal computers. Engineers use computers to design cars and airplanes, phar-
maceutical companies use computers to develop new drugs, movie producers generate spe-
cial effects and in some cases entire animated films using computers, and investment firms
use computational models to decide whether complex transactions are likely to succeed.
Not surprisingly, given the role astronomy has played in the history of computing, modern
astronomers also rely heavily on computation. Organizations like the Jet Propulsion Labora-
tory use computers to carry out the calculations that track the locations of planets, asteroids,
and comets with the goal of keeping an eye out for potential threats from impacts, such as
the one involving the comet Shoemaker-Levy and Jupiter in 1994.
Computation plays a much more extensive role in modern science than the straightfor-
ward “number crunching” involved in the calculation of orbits. The phrase computational
science refers to the use of computation to help answer fundamental scientific questions.
Here the word “computational” is an adjective that describes how the science is done. Com-
putational science is, like the more traditional approaches of theoretical science and ex-
perimental science, a way of trying to solve important scientific problems. Computational
physicists use computers to study the formation of black holes, investigate theories of how
planets form, and simulate the predicted collision, three billion years from now, of our Milky
Way galaxy with Andromeda.
As we look at the wide variety of problems that are being solved with the help of com-
putation, several questions naturally arise. Do these problems have anything in common?
Is there some aspect of a problem that would lead one to believe it can be solved computa-
tionally? For that matter, what does it mean to “compute” something?
The generally accepted definition of a computation is that it is a sequence of simple,
well-defined steps that lead to the solution of a problem. The problem itself must be defined
exactly and unambiguously, and each step in the computation that solves the problem must
be described in very specific terms.
This technique is known as the “method of differences.” The Difference Engine, the
machine designed by Charles Babbage, was designed to employ this technique to
compute the value of any polynomial.
1.1 Computation 5
Stream A
40, 39, 69, 57, 50 (40 + 39 + 69 + 57 + 50) ÷ 5 = 51
Stream B
Figure 1.2: To compare the average length of fish in two different streams, an ecologist would
compute the mean length of fish seen in each stream. The mean length is defined as the sum of
lengths divided by the number of fish.
• When we want to send a text or e-mail to someone, we need to know their contact
information. If the person is in our address book it’s trivial to look up their e-mail
address, but if we don’t know the person we’re stuck. In some cases we can do a web
search, e.g., to find the name or e-mail address at a company we want to correspond
with, but we can’t ask a computer to find the e-mail address of someone we just met
at a coffee shop.
• When using a computer to manage finances we can connect to a bank or credit card
company to download a list of transactions, and we might be able to have a pro-
gram do some calculations for different investment options, based on interest rates or
projected earnings. But we know the computer can’t choose the perfect investment
because it can’t predict which companies will succeed or future interest rates.
• A computer can help find mileage estimates for different types of cars, or admis-
sion and enrollment statistics for different colleges. But a computer can’t determine
1.2 The Limits of Computation 7
whether the fun of driving a flashy convertible outweighs the practicality of an all-
wheel drive station wagon, and people usually find it difficult to quantify all the at-
tributes of different colleges and universities that would allow a computer to make a
perfect decision on the best school to attend.
Ambiguous Problems
The problem of sending a message to a person we meet at a coffee shop is simply too vague
to be solved computationally. It lacks a well-defined starting point and there is no sequence
of steps a computer can carry out to solve it. It’s worth noting this is a problem that cannot
be solved by a human, either—a friend won’t be able to help any more than a computer
unless we supply a lot more information.
Some attributes students use when deciding which college to attend are well defined. The
cost of tuition, living expenses, and the average GPA and SAT scores of entering freshmen
are important factors. If these easily quantified items are the only criteria that are important,
a computation could lead to a decision of which college is best. For most people, however,
intangible qualities like geographical location and quality of life are important, and these
are hard to put into terms that could be used in a computation (Figure 1.3). People do solve
problems that involve intangibles, and it might seem like this is the sort of thing a person
could do better than a computer. But the “solutions” obtained by people aren’t like the
solutions to the problem of computing the mean length of fish: they are recommendations,
not unambiguous and reliably correct answers.
SAT s
eam
skiing and hiking rts t
pre- spo
me d GPA
prog pe
ram rce
financial aid nt athe r
Figure 1.3: In order to use a computer y adwe
cit mi
to choose a college to attend, big tte
d
distance to home
each attribute would have to be
well-defined and quantifiable.
8 Chapter 1 Introduction
Natural Language
It would be nice if we could open a cell phone and say “send a message to Aleah, Katie,
and Erica to see if they want to come over to study calculus.” We could then work on
something else while the phone composes a text message, sends it to our friends’ phones,
and negotiates with the other phones to find a time when everyone wants to meet. This
sort of interaction is not possible with current computers, but researchers in a field known
as artificial intelligence are trying to understand what is involved in these types of com-
munications and developing computational methods to carry them out. A human personal
assistant can accomplish this task, so this is an example of the kind of problem that hu-
mans solve but computers (currently) do not. It is an open question whether this problem
is beyond the limits of computation. It very well might be possible for some future personal
digital assistant to accomplish this task.
Intractable Problems
It’s tempting to think a computer could easily win a chess tournament by considering all
possible moves starting from a given board configuration, then examining each possible
response its opponent could make, and eventually choosing the move that leads to a certain
victory. This is an example of a problem that should be solvable by a computer. The problem
has a well-defined input (the starting configuration of a chessboard), output (configurations
where each move leaves the opponent’s king in “check”), and very specific and well-defined
set of operations (the legal moves for each chess piece).
Before we try to write a program that uses this strategy, however, we should do some back
of the envelope calculations first. The number of possible chess games has been estimated
to be more than 1043 . Even if this computation were run on a supercomputer far more
powerful than the fastest computers available today, on a hypothetical machine that could
somehow compute 1 trillion (1012 ) alternative board combinations per second, it would
require 1043 /1012 = 1031 seconds, or roughly 1021 years. To put this in perspective, the
universe is only 1013 years old. So even though this is a well-defined computation, it is one
no computer will ever complete, and in that sense it is well beyond the limits of computation.
It goes without saying that no human will ever do this computation, either. When humans
♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
and computers play chess successfully they are using other strategies than simple “brute
force” exploration of all possible moves.
Computer scientists refer to this sort of problem as intractable. Small portions of the
problem, such as different opening strategies or endgames, can be analyzed by considering
every option, but evaluating every move in a full game is beyond reach. Chapter 12 explores
another intractable problem, one that is often faced by organizations that need to do a
substantial amount of scheduling or planning.
© Unsolvable Problems
Mathematicians in the 1930s made a startling discovery that some problems are simply
unsolvable. In logic, these problems are called undecidable. The group of unsolvable prob-
lems includes determining whether paradoxes, like the familiar statement “this sentence is
false,” are true or false. The statement can’t be true, because that would imply it is false,
and likewise it can’t be false, because that would make it a true statement about itself. In
mathematical terms it is simply undecidable.
The computer science equivalent of the undecidable functions are called noncomputable
problems. The most well-known, the Halting Problem, asks whether it is possible to exam-
ine a running program and decide whether that program will ever terminate. Imagine a
situation where a an application is running on a laptop, and an icon appears on the screen
that says the program is busy, so it will not respond to any keystrokes or mouse clicks.
After five minutes we might start to
wonder whether the application is pro-
gressing very slowly or has crashed. It
would be nice to be able to run another
program that would examine the first
one and say “be patient, it will termi-
nate” or “it crashed, you need to kill it
and restart it.” A fundamental result
in theoretical computer science tells us
that this problem is logically equivalent
to an undecidable function and that
it is impossible to write such a “halt-
checking” program.
Unsolvability is a different type
of limitation than intractability, the
limitation encountered by the chess-
playing program. The chess player will
compute the perfect game of chess if
we are patient enough to wait 1021
years, so it is only unsolvable in a prac-
tical sense. The halt-checker requires
us to evaluate an undecidable function,
so it is beyond the limits of computa-
tion in that we know it is impossible to
write a general purpose program that could carry out a sequence of steps that will let it
determine whether another program will terminate.
10 Chapter 1 Introduction
1.3 Algorithms
Let’s return to the simple example of a computation presented in Section 1.1, where an
ecologist wants to know the average length of fish observed in a stream. We now know
what the computation involves: sum up the lengths and divide by the number of fish. The
next question is, how do we describe the computation in sufficient detail so the steps can be
carried out by a machine?
First consider how the ecologist might enlist the aid of a human research assistant. If
the assistant has taken a statistics class, the ecologist can just give the assistant the data
and expect them to compute the mean lengths. But if the assistant does not know how to
compute a mean, the ecologist needs to describe the operation in detail: write the list of
numbers on a piece of paper, and then cross them off one by one as they are added to a
running sum, and after adding the last piece of data, divide by the number of fish.
A detailed description of how to solve a problem by first specifying the precise starting
conditions and then how to follow a set of simple steps that lead to the final solution is
known as an algorithm. An algorithm is characterized by
• a precise statement of the starting conditions, which are the inputs to the algorithm;
• a specification of the final state of the algorithm, which is used to decide when the
algorithm will terminate;
• a detailed description of the individual steps, each of which is a simple and straight-
forward operation that will help move the algorithm toward its final state.
In short, an algorithm is a specification for how to carry out a computation. Although the
word “algorithm” can be used to refer to any method for systematically solving a problem,
and algorithms were widely used long before anyone thought of building a machine to
perform the steps in a computation, today the term generally refers to a method that will be
carried out automatically by a computer.
In the description of an algorithm, the steps have to be simple enough to be “understood”
by a machine. One way to think of what a machine is capable of doing is to think in terms
of symbols, such as numbers or letters. The steps in an algorithm are basically symbol ma-
nipulations like simple arithmetic operations or comparisons that determine which words
The world algorithm comes from the name of a Persian mathematician, Mohammed
ibn Mûsâ al-Khwârizmî (ca. 780–850), whose book on the use of Indian numerals
introduced Europeans to the numeral 0. The book was translated into Latin with the
title Algoritmi de numero Indorum (“al-Khwârizmî Concerning the Hindu Art of
Reckoning”).
The earliest algorithm, now known as Euclid’s Algorithm, dates from at least 300 BC.
This algorithm is still used today to find the lowest common denominator of two
numbers. Other ancient algorithms include the Sieve of Eratosthenes, a method for
making lists of prime numbers (and the basis for one of the projects in this book), and
methods used by Sun Tzu and other Chinese mathematicians around AD 200.
1.3 Algorithms 11
(a) (b)
Write the input data as a list of numbers 0 40, 39, 69, 57, 50
Enter 0 on a calculator
Figure 1.5: (a) An algorithm for computing the mean of a set of numbers. (b) The initial state of the
computation defined by this algorithm, after entering a 0 into a calculator and writing the input
data on a sheet of paper. (c) The state of the computation after adding the first number and
crossing it off the list. (d) After the last number has been removed from the list, the calculator
holds the sum of all the numbers. For this data set, the mean is 51, the result of dividing 255 by 5.
come before others in the alphabet. By putting together a large number of simple sym-
bolic operations, a machine can do very complex tasks, such as sorting long lists of names,
counting millions of votes cast in an election, or using words to build an index of web pages
gathered from the Internet.
As an example of how a task can be described as a sequence of symbol manipulations,
the process followed by the research assistant to compute the mean length of a group of
fish is shown in Figure 1.5. On the left is the algorithm, showing what needs to be done at
each step. Three different stages of the computation are shown on the right. To initialize
the computation, the number 0 is entered into a calculator, and all the values in the data
set are written out on a sheet of paper. Each time the assistant removes a number from the
list, it is added to the running total on the calculator and crossed off the list. By the time
the last number has been crossed off, the value displayed on the calculator is the sum of all
the lengths. Each step in the algorithm is a symbol manipulation, where the list becomes
shorter by one item and the sum has been updated through simple arithmetic operations
(which could easily be done by hand as well as a calculator). The final output is a single
number, again the result of a simple arithmetic operation, in this case a division.
Often the descriptions of the steps of an algorithm are given in English or another human
language, as in the algorithm for computing the mean value of a set of numbers shown in
Figure 1.5. This notation, which is sometimes called pseudocode, is sufficient for talking
about the algorithm, for describing the process to another person, or for trying to understand
whether or not the algorithm works. But in order to run the algorithm on a computer, the
steps have to be written more precisely as statements in a programming language. If the
ecologists find they are spending too much of their time computing means by hand, they
12 Chapter 1 Introduction
might decide to invest some time in implementing their algorithm in the form of a program
and running it on their computer.
The idea that one can solve a problem through the use of an algorithm is the central
concept in computer science. Computer scientists analyze the theoretical properties of al-
gorithms, develop programming languages used to implement algorithms, and design com-
puter systems to automatically execute the steps in algorithms. As technology opens the
doors for new applications, computer scientists work with researchers in other fields to
find ways to solve important real-world problems, either by inventing new algorithms or
improving and adapting existing algorithms.
• The first nontrivial algorithm presented in this book is the Sieve of Eratosthenes, a
very old algorithm that has been used since the time of the ancient Greeks to make
lists of prime numbers. The name of the algorithm is a hint to the basic idea: create
a list of numbers, and then sift out those that are not prime. It is easy to set up a
1.4 A Laboratory for Computational Experiments 13
straightforward program that repeatedly works its way through the list. After exper-
imenting with the method, we will find that it is not necessary to do as many sifting
operations as one might think, and the insight we gain from the initial experiments
will be used to implement a more elegant version that does the minimal amount of
work.
• One of the early milestones in artificial intelligence was a program named ELIZA, which
gave the appearance of carrying out a conversation by playing the role of a psychia-
trist. A user would type a sentence on a computer terminal, and ELIZA would respond.
For example, if a person typed “I don’t like computers” the program might print “Do
computers worry you?” What was fascinating about ELIZA was how well it seemed
to participate in a conversation, in spite of the fact that it only did very simple syn-
tactic transformations on input sentences. For this project, we will create objects that
represent the transformation rules and run experiments that apply the rules to test
sentences.
• A classic problem from the world of mathematics, known as the Traveling Salesman
Problem, has the same basic structure as several important real-world problems that
require efficient schedules. We will use what is known as a “genetic algorithm” to
experiment with one way of solving the Traveling Salesman Problem. Each object
in this project will represent a complete tour. We will create a set of tours and put
them in a “virtual Petri dish,” then sit back and watch as the tours mutate and evolve,
eventually giving rise to an efficient solution to the problem.
The important point to keep in mind when working through these projects is that Ruby,
like any programming language, is simply a notation for describing an algorithm. Any time
one learns a foreign language there are myriad details to deal with, and that is certainly the
case with a programming language. At times it will seem like this book is more concerned
with teaching the ins and outs of Ruby programming than it is with the ideas of computation.
But remember the goal here is “literacy.” Readers will need to learn this new notation well
enough to understand the basic steps of an algorithm, but will not have to memorize all the
details that would be required to write their own new programs. Anyone who has ever tried
to learn a foreign language knows it is easier to read sentences in a new language than it is
to write a sentence. A similar thing will happen with Ruby. After a bit of practice it will be
possible to understand the basic steps of an algorithm when they are written as statements
in Ruby, even though it might be difficult to write a new Ruby program from scratch.
The reason we are using Ruby is that there is a tremendous benefit from using a real
programming language as the notation for describing an algorithm. After an algorithm has
been implemented in the form of a program, we can run it on a computer: we can apply it
to different inputs, modify it, extend it, and carry out any number of experiments that will
help lead to a deeper understanding of the algorithm.
The Queen, at the time of the King’s illness, was assailed with
unmeasured vituperation by the Opposition papers. Even her
interviews with Pitt were made base account of, in order to raise the
public odium against her. In the present year the ‘Hopes of the
Party,’ a caricature so named, by Gillray, served to show the
supposed wishes of the Opposition. The caricature represents many
revolutionary horrors. Among them is what is termed ‘a pair of
pendants,’ showing the Queen and prime minister each hanging from
a lamp iron. ‘It is commonly believed,’ says Mr. Wright, in the History
from which a passage has been already quoted, ‘that Pitt and Queen
Charlotte were closely leagued together to pillage and oppress the
nation; and she was far less popular than the King, whose infirmity
produced general sympathy, and who had many good qualities that
endeared him to those with whom he came in contact. In another
part of Gillray’s picture the King is brought to the block, held down
by Sheridan, while Fox, masked, acts as executioner. Priestley, with
pious exhortations, is encouraging the fallen monarch to submit to
his hard fate.’ Later in the year, in September, the Queen’s second
son, Frederick Duke of York, married Frederica, eldest daughter of
the King of Prussia. The marriage was solemnised on Michaelmas
Day, at Berlin. The bride was then in her twenty-fourth year, her
husband in his twenty-eighth. She was fair, virtuous, accomplished,
and kindly-hearted,—by far too good a wife for the profligate Prince
to whom she was allied. The newly-married pair travelled to England
through France, where they met with but rough treatment from the
republican mob, some of whom very unceremoniously scratched the
royal arms off their carriages. The ceremony of marriage was
reperformed in England on the 23rd of November by the Archbishop
of Canterbury, in presence of the entire royal family. By an addition
of 18,000l. to the Duke’s income, his revenue amounted to 35,000l.
a year; and an annual 30,000l. was settled on the Duchess, in case
of her surviving him.
The Queen, accompanied by the King and the elder branches of
her family, paid a visit of welcome to the young couple, which was
the most formal and ceremonious matter that can well be conceived.
The visit took the form of a tea-party; it ought, therefore, to have
been social and chatty, but it was as stiff and silent as much
ceremony and formal etiquette could make it. The King’s tea was
solemnly handed to him by the Prince of Wales, while the Duchess
of York, receiving a cup from the Duke, presented it, with much
reverence, to the Queen. But in the cups which cheer and not
inebriate, ceremony was soon dissolved; and the King getting
loquacious, the family party, before the night was far gone, became
as mirthful and pleasant as if it had been made up of more mirthful
and pleasant materials.
Despite the great popularity of the excellent Duchess, the
caricaturists spared neither her nor her royal father and mother-in-
law. In one of the satirical prints by Gillray, the King and Queen—the
latter most outrageously caricatured—are represented in ridiculous
attitudes of joy: the King is fairly ‘kicking up his heels’ in ecstasy,
offering eager welcome to the Duchess. The Queen is holding out
her apron to receive some of the wealth and jewels which her
daughter-in-law was popularly supposed to have brought with her.
The latter has her apron full of money, and the Duke is introducing
her to his parents.
The poor Duchess was soon one of the unhappiest of wives. The
profligacy and shameless infidelity of her husband, to whom she had
been fondly attached, disgusted her. His extravagance involved him
in a ruin from which he could never relieve himself, and which his
creditors never forgot. It made many a hearth cold, and it brought
misery to that of the Duchess. For six years she bore with treatment
from the ‘commander-in-chief’ such as no trooper under him would
have inflicted on a wife equally deserving. At the end of that time
the ill-matched pair separated, and the Duchess withdrew from the
world; but in her retirement she forgot none of the duties which it
could fairly demand of her. She was beloved by all, and was
popularly and affectionately mentioned by the popular voice as ‘the
poor soldier’s friend.’
She was indeed the friend of all who needed her service, and did
not refuse even to give to poor ‘Monk’ Lewis the meed of admiration
which his little vanity required. He was once met coming in tears
from the Duchess’s drawing-room; and on intimating to his
questioner that they had their source in the very kind and flattering
things the Duchess had said to him, the weeper was roughly
consoled by his acquaintance, with the soothing advice, to ‘Never
mind, as perhaps she did not mean it!’
Never was the alleged avarice of the King and Queen more
bitterly satirised than during this year (1791). The King, however,
was a cheerful giver, and the amount of property which the Queen
left at her death proves that she was no hoarder. The caricaturists,
nevertheless, smote them mercilessly. Peter Pindar assailed them in
coarse and witless lines, that had in them a certain rough humour,
but as ill-natured as rough. Gillray exhibited them as cheapening
wares in the streets of Windsor. In another print, the King, in the
commonest of garbs, was seen toasting his own muffins; and the
Queen, with a hideous twist given to her now plain features, and
with pockets bursting with the national money, was depicted busily
engaged in frying sprats for supper. In another, the Queen is sourly
commanding her highly-disgusted daughters to take their tea
without sugar, as a saving to papa. There were many of a similar
cast, and not a few which exposed the vices to which the Princes of
the family—young men of great hopes and with much kindliness of
feeling, but with little principle—had unfortunately surrendered
themselves.
The King himself was ever depicted as slovenly both in dress and
gait—the Queen as mean in attire and sharply sour of visage. The
latter always wears a far more acute, but a less inquiring, air than
her husband. This was a true reflection. After Dr. Johnson had his
celebrated interview with the monarch at Buckingham Palace, he is
said to have declared that ‘His Majesty seems to be possessed of
some good nature and much curiosity; as for his nous, it is not
contemptible. His Majesty, indeed, was multifarious in his questions;
but, thank God, he answered them all himself.’
The public discontent and the general distress increased greatly
at this time, and had their effect in throwing a gloom over the court
circle. The old formality and not a very diminished festivity were still,
however, maintained there, and the republican fashions of France
were held in abhorrence at Windsor.
The sons of Queen Charlotte were not so formal in their
behaviour towards her, before witnesses, as the daughters were.
The Duke of York was now the most observant of ceremony, but he
exhibited therewith a show, perhaps a reality, of very tender feeling.
Even on common occasions the household of the Queen was
encumbered by much stiffness of observance of etiquette. It was not
an uncommon occurrence for the Duke of York to attend at his
mother’s toilette, conversing with her during its closing progress.
When this was the case, and the dresser’s task was done, that lady
could not leave the room if the Duke happened to stand between
her and the door; to cross the Duke would have been a terrible
breach of good manners. Nor could the Queen help the dresser; all
that the illustrious lady could do was to watch till the Duke changed
his position, and then with a smile, and a ‘Now, I will let you go,’
give freedom to the dresser, longing for liberty.
The Prince William (Duke of Clarence) was the least courteous of
the sons of Charlotte. But it must be remembered that he not only
went early to sea, but it was at a time when roughness of manner
was considered as more becoming to a naval officer than
refinement; to support the character, the young Prince probably
assumed more coarseness of style and speech than was really
natural to him. The Queen’s birthday drawing-room, in 1791, was
followed by a ball, at which the pretty Princess Mary was to dance
her first minuet in public, and her brother, the sailor Prince, had
promised to be her partner. But previous to the ball there was a
dinner, and at a birthday dinner more champagne was drunk by the
Prince than on ordinary days. Under its inspiration, the Duke found
his way to the table of some of the ladies and gentlemen in waiting.
There he ruled as king, insisted upon more champagne, compelled
the not-unwilling gentlemen to drink with him glass after glass,
laughed at its effects upon them and himself, smacked the servants
on the shoulder, abused them good humouredly, praised his sister
Mary, had more champagne, kissed the hand of old Madam
Schwellenberg with infinite mock heroics, was always going and
never went, and ended all he said with the common oath of
gentlemen, a loudly-uttered ‘By G—!’ With a morning so spent, he
was not likely to be steady enough for the minuet at night. In fact,
he was incapable of appearing at the ball at all; much to the chagrin
of the Queen; still more to that of the Princess Mary, to whom,
however, the offender made less apology the next morning than
confession, that on the Queen’s birthday he had been ‘too far gone’
to think of dancing.
The Prince of Wales was not more temperate even on ordinary
occasions; and he was less heartily courteous to ladies than his
brothers, while perhaps he was more formally polite. Miss Burney
describes him as staring at her when she was in attendance upon
the Queen, not haughtily or impertinently, she says, but in an
‘extremely curious manner’—probably as Don Juan may have looked
upon Zerlina.
With all the Queen’s respect for the formality of court, she
enjoyed herself most when she was least observant of it. Reading
the letters of Johnson and Mrs. Thrale, she liked to talk them over
with Miss Burney, who could explain so many circumstances
connected with them which would, otherwise, have been
incomprehensible to the Queen. She loved to hear her dresser’s
graphic account of Warren Hastings’ trial, whither she had sent her
with a reticule stuffed full of cakes from the Queen’s own table. At
Cheltenham, when she accompanied the King thither previous to his
late illness, the royal residence was of such contracted dimensions,
and so scant of accommodation, that her Majesty dressed and
undressed in the drawing-room. Many of her ladies would not have
submitted half so cheerfully as she did to such an arrangement. In
the rural expeditions of the royal pair, there was indeed a comic sort
of mixture of formality and fun. At Weymouth, for instance, when
the King went to take his ‘dip,’ the royal machine was followed by
another full of fiddlers and other musical persons, who, as the
monarch plunged into the ocean, saluted him and the bold deed
with ‘God save the King,’ horribly out of tune!
It was when the royal pair were at Weymouth that, on one
occasion, the mayor of the borough, after presenting an address,
and receiving the stereotyped answer, boldly walked up to the
Queen to kiss her hand. ‘You must kneel,’ whispered the master of
the ceremonies. Mr. Mayor, not heeding the court guide, continued
standing, and in that position kissed the royal hand. As he retired,
the highly offended master of the ceremonies remarked, angrily, ‘Sir,
you ought to have knelt.’ ‘Sir,’ said the Mayor, ‘I can’t; don’t you see I
have got a wooden leg?’
It is upon record that the Queen once attempted to write some
verses; and having got to the third line gave the matter up in
despair—leaving her ‘reader’ to finish and perfect the rhymes. The
occasion was on presenting a pair of old-fashioned gloves to Lord
Harcourt, who had an affection for ancient gear, and cared more for
old gloves than new verses. Miss Burney acquitted herself, however,
very well with her impromptu; indeed, she may be said to have been
the Queen’s laureate during the five years she served that
Sovereign. Her royal mistress employed her to compose some
congratulatory verses on the King’s recovery from his serious
indisposition; and of these it may be said that if Warton, over whom
paralysis was then pending, might have written better, Henry James
Pye, the succeeding laureate, could hardly have written worse.
The taste of the Queen was itself not unimpeachable. With
regard to the drama, she would rather have seen little Quick in Tony
Lumpkin, than Mrs. Siddons in Lady Macbeth. So her ‘reader’ was
not called upon to exert her powers upon any great works. The first
book she was required to read aloud was Colman’s broad farce of
‘Polly Honeycomb.’ The young lady must have had a difficult task
with the novel-reading Polly, whose heart beat for Mr. Scribble, and
into whose head her sire could not beat a favourable opinion for ‘the
rich Jew’s wife’s nephew,’ Mr. Ledger. The young Princesses were
listeners, and it could hardly have been edifying for them to hear the
rollicking Polly say of her father, ‘Lord, lord! my stupid papa has no
taste; he has no notion of humour and character and the sensibility
of delicate feeling.’ ‘A novel,’ says Miss Honeycomb, ‘is the only thing
to teach a girl life;’ and she adds, ‘Every girl elopes when her
parents are obstinate and ill-natured about marrying her.’ Her ridicule
of the long-lived affection of her parents is expressed in the coarsest
manner; and she thinks it a good joke that her father recommends
her to read the ‘Practice of Piety;’ she runs away with a scamp, and
her honest lover, rightly disenamoured, declares of her that ‘he
would not underwrite her for ninety per cent.’ What Miss Pope made
of Polly and King of Scribble, when this farce was first produced, in
1760, it is not worth inquiring. Miss Pope was considered great in it;
but it is worth noticing that when Miss Burney was reading the piece
to the Queen and her daughters, an actress whose name can never
be separated from that of the Queen’s third son was then turning
half the heads in town with her Polly. Mrs. Jordan was well
supported by Palmer in Scribble, and the piece seems to have found
its way to court, as the ‘Dragon of Wantley’ did in the preceding
reign, on the strength of its popularity.
The reader to the royal audience performed her vocation under
great disadvantages. She read on in mortal silence on the part of
those who listened; neither comment, applause, nor feeling of any
sort was ever exhibited; and when Miss Burney had to read other of
the elder Colman’s plays, and once ventured to relieve the voice,
long fatigued by reading, by making some remark on the
construction of the piece, the innovation was submitted to without
being commended.
This scene of a Queen whose high moral character and purity of
taste have been long matters of eulogy, seated amid her daughters,
listening to a farce which would hardly now be tolerated, is not
pleasant. But society had not yet freed itself from the uncleanness
with which it had been overwhelmed during the two preceding
reigns. The unspeakable degradation into which the first two
Georges dragged the country must not be forgotten, though it may
not be detailed. While detesting the restrictions with which
monarchy had been loaded in the great revolution, they indulged
unrestrainedly in the worst coarseness of vice. Kept back from
pressing despotically upon the people, they yielded unbridled sway
to their own passions, and their infamous example corrupted three-
fourths of society. Caroline herself would listen to stories told her by
Sir Robert Walpole, upon which the eye of the student of history
cannot rest without a blush of indignation mantling in his cheek. If
the Stuarts were vicious, they were, in a certain degree,
gentlemanlike in their vices. The first two Georges were as vicious,
but they had none of the refinement of the Stuarts, and would have
been to the full as tyrannical had the men of England left them the
power. Their conduct was enough to render monarchy detested, and
the name of Brunswick execrable. The domestic virtues of George
III. and Queen Charlotte insured respect for the first, and
surrounded the latter name with something like a halo of love. If
there be any yet among us who sing ‘Hail, Star of Brunswick!’ with
any mental reservation, the reason may probably be traced to
impressions received from the records of the first Georges. The tone
of society had not yet recovered itself fully when Queen Charlotte
caused ‘Polly Honeycomb’ to be read aloud to herself and daughters.
It is true that her Majesty also listened in like company to the
teaching of Mrs. Hannah More; but even that high moralist hardly as
yet understood how the work of morality might best be sped. Even
ten years later than the time when Colman’s farces were deemed not
unfitting to be read to an audience of mother and children, Mrs.
More, in ‘Cœlebs,’ was recommending the observance of modesty on
the part of ladies on very selfish grounds. In allusion to the ‘naked
style’ of dress which was then the fashion with women, Mrs. More
admonitorily and significantly exclaims: ‘Oh, if women in general
knew what was their real interest; if they could guess with what a
charm even the appearance of modesty invests its possessor, they
would dress decorously from mere self-love, if not from principle.
The designing would assume modesty as an artifice; the coquet
would adopt it as an allurement; the pure as her appropriate
attraction; and the voluptuous as the most infallible art of seduction.’
When the Reverend Sydney Smith read this passage, he remarked
that if there were any truth in it, ‘nudity becomes a virtue, and no
decent woman for the future can be seen in garments.’ This is,
perhaps, more smartly than truly said. Queen Charlotte certainly
abhorred the style of dress which is censured in ‘Cœlebs.’ When the
Lady Charlotte Campbell, famous for her beauty and for her
subsequent connection with Queen Caroline, first went to court, she
was attired in the scant costume of the period. She was, in fact, in
the very highest of the fashion, and as she was passing before
Queen Charlotte, the latter recommended her to ‘let out a tuck in
her petticoat!’
While on the subject of fashion, it may here be noticed that
when the marriage of the Princess Royal with the head of the House
of Wurtemburg had been determined on, her Majesty made the
bridal dress, and helped to deck her daughter with it. As a King’s
eldest daughter, she had a right to be attired in a dress of white and
silver. The Princess, however, was about to marry a widower, and it
appears that custom, consequently, required the bride to wear white
and gold. And so the robe was fashioned accordingly, and the
preference of the Princess was made to yield to etiquette. This
marriage, however, did not take place till 1797.
In 1792, the Prince’s pecuniary affairs were in a worse condition
than ever. Several executions had been in his house, from one of
which he had been saved by the benevolence of Lord Rawdon. His
debts now amounted to 400,000l. The Queen advised him to press
the King, through the lord chancellor, to apply for an increase of
income. What the Prince required was 100,000l. yearly, and if that
were granted he proposed to set aside 35,000l. per annum for the
liquidation of his debts. He had now abandoned racing, a silly pursuit
which had cost him yearly not less than 30,000l.; and having done
that, he feigned to be shocked at his equally embarrassed brother,
York, remaining on the turf. He added, that if his request were not
acceded to, he should shut up Carlton House, go abroad, and live
upon 10,000l. a year. It was very properly suggested to him that he
would do much better, if the Queen’s wishes and his own could not
be carried out, by staying in England and showing the people that he
could adapt his circumstances to his revenue. This was a course,
however, which he had never seriously determined to follow. He was
made up of contradictions; and although he was at this period more
than ever attached to Mrs. Fitzherbert, it did not prevent him from
maintaining the well-known actress, Mrs. Crouch, in the post of
‘favourite.’ Mrs. Fitzherbert met this course by ridiculing it, and by
coquetting on her side. This hurt the Prince’s vanity, and brought
him again under her influence. What his homage was worth may be
judged of by the fact that it was paid to many deities, and while he
was maintaining Mrs. Crouch, forgetting poor Perdita Robinson,
making love to the beautiful Duchess of Devonshire (who was
separated from her husband, but did not on that account in the
slightest degree regard the Prince), he had also opened an
intercourse with Lady Jersey, who was not half such a prude as the
Duchess, and who was the most shameless of those to whom the
heartless Prince had pretended to surrender his heart. With many
loves, or what were called such, Mrs. Fitzherbert continued the
married sultana. He built for her a residence at Brighton, where she
kept up the establishment of a queen—really looked like one, for she
was a superb woman—had as brilliant diamonds as Queen Charlotte
herself, and was greeted by all the bathing women with the
respectful appellation of ‘Mrs. Prince.’
But the Queen had soon to deplore another mésalliance. Her son
Prince Augustus (Sussex), when travelling in Italy, had become
attached to the Lady Augusta Murray, daughter of the Earl of
Dunmore; and, after a courtship during which the Prince wrote love-
letters to the lady that, with respect to style were neither sublime
nor beautiful, and with regard to grammar were calculated to make
Lindley Murray die of despair, the parties were married privately by
an English clergyman, and were re-married, at St. George’s, Hanover
Square, on their return to England. Of this union two children were
born, of whom the daughter (once known as Mademoiselle d’Este)
became the wife of Lord Truro, who, when Mr. Serjeant Wilde,
endeavoured to establish the validity of her father’s marriage, and
acquired the lady’s hand by way of honorarium. The moment the
marriage of the Duke with Lady Augusta Murray was first declared
invalid by the ecclesiastical court, Lady Augusta separated from her
husband. The latter appears to have borne the separation very
philosophically, but he did not marry again during Lady Augusta’s
life. In his later days, when his brother, William IV., was King, he
married the lady who long survived him under the title of Duchess of
Inverness. But a marriage of more importance remains to be
noticed.
CHAPTER X.
LENGTHENING SHADOWS.
The subject of the marriage of the Prince of Wales will come more
fully under our notice in the Life of Caroline of Brunswick. Here it
may be mentioned that the period at which the question of the
marriage of the Prince was first moved, is not known with certainty.
It was soon, however, publicly ascertained that whenever that much-
desired event should take place the Prince’s debts were to be paid,
on the condition that after such settlement and the fixing of his
establishment as a married man, he was never to incur such
liabilities again. The agreeing to this condition debarred him from
ever again applying to Parliament for pecuniary relief.
There is little doubt as to the wish of Queen Charlotte that her
son should marry a Princess of Mecklenburg. It was sufficient for the
Prince that his mother had such desire that he should oppose it.
According to Lord Liverpool, the intimation of the Prince’s wish to
marry was abruptly made to the King, who received the information
with a cheerful complacency, and simply required that the lady
chosen should be a Protestant and a Princess. Mrs. Fitzherbert was
neither.
The King offered to send a commissioner to the German courts
on the pleasant mission of reviewing the daughters of the sovereign
dukes there, and reporting on their eligibility. The Prince’s choice,
however, appears to have been made, if that can be called choice
which fixes on an object utterly unknown. He named his cousin, the
daughter of the Duke and Duchess of Brunswick. Her mother was
Augusta, sister of the King, whose birth had taken place at St.
James’s Palace under circumstances which gave such offence to
Caroline and George II. The King made no objection: and yet he
must have known that if the object selected was pretty, she was far
less fair than the lady of Mecklenburg whom Charlotte would fain
have had for a daughter-in-law; and that her reputation, even in
Germany, where the best people then construed liberally of female
conduct, was none of the best. She was known as a bold, dashing,
careless girl, whose tongue was ever in advance of reflection; who
called the coarsest things by the coarsest names, and who only
needed temptation and opportunity to fall into any sin which had a
pleasant side to it. She was not worse than many of her
contemporaries with whose doings fame was less busy. Her great
defect was a want of self-control, if that be a great defect compared
with a want of cleanliness. But in this latter respect Caroline’s
neglect was not singular. In her young days dirtiness had not yet
quite gone out of fashion.
It is credibly asserted that the Prince’s favourite, Lady Jersey, led
him to select the Princess of Brunswick for his wife. It was Lady
Jersey’s object that he should have a legal consort who must draw
him away from his (illegal) wife, Mrs. Fitzherbert; but it was also
Lady Jersey’s object that the wife should not possess attractions that
should prove more powerful than her own.
It will suffice to record here that the marriage took place on the
8th of April, 1795, under unseemly auspices. The behaviour of the
Prince at the ceremony undoubtedly may be received as confirming
the accounts of his aversion to the bride. He confessed to the Duke
of Bedford (one of the two unmarried dukes who supported him at
the marriage) that he had taken several glasses of brandy before
proceeding to it. He must have taken many, for he was so drunk that
the two dukes could scarcely keep him from falling. The conduct of
the Prince was, of course, the subject of much remark, and it was
set down, at the time, not to brandy but remorse—remorse at the
idea of that other marriage which he had contracted with the woman
whom he undoubtedly did love, if he ever entertained for woman at
all a sentiment worthy of that name. Very few days passed after the
solemnisation of the ceremony before ‘many coarse and indelicate
strictures on the bride’s person and behaviour were currently
reported as coming directly from the Prince in every society in
London.’ So says Lord Holland; and that noble writer, who
pronounces to be a bad and worthless woman—mad, at least, if not
bad—a princess whom his party, if not he himself, held up, in the
days of her persecution, as a martyr of virtue, goes on to say, that
the ill-usage to which the Princess of Wales was exposed at Brighton
and elsewhere from the Prince and his mistress, Lady Jersey, was
notorious, unpardonable, and so utterly disgraceful, ‘that persons of
rank (afterwards indebted to him for advancement in it) have
plumed themselves upon refusing to meet him at dinner at my
house [Holland House, Kensington], observing that he was not fit
company for gentlemen.’
The marriage began miserably, continued miserably, and ended
miserably. As Lord Holland observes, neither the Prince’s
reconciliation with Mrs. Fitzherbert nor his subsequent intimacies
with Lady Hertford and others (although such returns and changes
of love were usually accompanied by similar changes and returns of
a train of favourites, friends, and dependents), ever softened his
hatred to the Princess. When, in 1820, on the death of Napoleon,
some officious courtier ran up to him to apprise him of the news
which he supposed would be welcome to him, in these words, ‘Sir,
your greatest enemy is dead!’—‘Is she, by G—?’ was the royal
husband’s dignified and pious ejaculation.
‘Many seeds of discontent,’ says Lord Holland, ‘were
imperceptibly sown during the year 1795, among the supporters of
the ministry, which time brought to maturity. Among these may be
reckoned the influence of Carlton House. The Prince of Wales
thought himself duped by Mr. Pitt about the payment of his debts at
the time of his marriage. He had been treated superciliously, more
than once, by Mr. Pitt, and he had never liked him, though his own
dread of revolutionary principles, quickened by a recent quarrel with
the Duke of Orleans, had rendered him eager, and even vociferous,
for the war. The last injury, real or supposed, which he had received
from Mr. Pitt, by the latter’s acquiescing in devoting, on his marriage,
the whole increase of his revenue to the payment of his debts, sank
into his weak and fretful mind deeper than usual, because he was
continually reminded of it by his connection with a woman whom he
loathed.’
Meanwhile, the Queen maintained the long-standing reputation
of her court with undiminished strictness. ‘The Queen’s public
receptions,’ says Sir Jonah Barrington, ‘were the most gracious in the
world. There could not be a more engaging, kind, and
condescending address than that of the Queen of England. An
illustration of her strictness is afforded us by an anecdote told of her
Majesty and an English duchess, who was aunt to a niece of rather
blemished reputation, but to which it was hoped some lustre might
be restored if she could only be made to pass through a court
atmosphere. The duchess, on asking the Queen to receive her niece
at the drawing-room, of course insisted that the young lady’s fame
had been unfairly attacked, and that she trusted to her Majesty’s
clemency and generosity to set it fair again with the world. The
Queen remained silent; whereupon the duchess, previous to retiring,
beseechingly inquired what she might be permitted to say to her
niece. ‘Tell her,’ said Queen Charlotte, ‘that you did not dare to make
such a request to the Queen.’ The duchess, who held some post in
the royal household, felt that such a speech involved her own
dismissal.
Never was the court so unpopular as at this time. In October
1795 the King, on proceeding to the House of Lords, was not only
assailed by seditious cries, but was fired at by some assassin among
the mob. On his return from the House he was pelted with stones,
and, later in the day, when driving to the Queen’s House, in a private
carriage, without guards, the excited mob, with cries of ‘Bread—
cheap bread!’ ‘No war!’ and ‘No king!’ made an attempt to force open
the door of the vehicle in which he was riding. The same spirit was
shown in 1796. On the 1st of February the King and Queen went to
Drury Lane to see ‘The Fugitive.’ On their return a stone was thrown
at the carriage, which passed through one of the glass panels and
struck the Queen in the face. Soon after a female maniac was
discovered in the palace, making no secret of sanguinary designs
against ‘Mrs. Guelph,’ her alleged ‘mother.’ Added to these private
vexations, the negotiation entered into, at the King’s express desire,
to establish a peace with France, entirely failed, and the difficulties
of the situation were further increased by Spain uniting with our
other enemies against us in war.
In the month previous to that last mentioned the birth of the
Princess Charlotte, daughter of the Prince and Princess of Wales,
was speedily followed by the separation of the parents. We may cite
here an incident of the christening, as the Queen Charlotte is rather
the heroine thereof than the infant Princess.
Lady Townshend held the little Princess at the font. Some time
elapsed before the officiating prelate took her from Lady Townshend,
whose state of health at the time was such as to make her incapable
of standing long without some peril to her own future hopes. The
Princess of Wales pitied her, and asked the Queen, in a low voice, if
she would not command poor Lady Townshend to be seated. But
Queen Charlotte liked nothing so little as an interruption of
established ceremony; and, blowing the snuff from her fingers, she
exclaimed, ‘No, no! she may stand—she may stand!’ The Queen was
nearly as strict in public with her own children. They, on such
occasions, never sat down in her presence unless commanded;
never spoke, unless first spoken to; and once, it is said, when the
Queen was playing at whist, one of the Princesses, standing behind
her chair, fell fast asleep from sheer fatigue.
The domestic troubles of the Queen were now in great part
connected with the affairs of her eldest son and her daughter-in-law.
They will be found alluded to in the Life of the latter. Another
marriage, scarcely more promising, soon occupied her attention. The
widowed Prince of Wurtemburg proposed for the hand of the
Princess Royal. His first wife was the daughter of Augusta, and sister
of the Caroline of Brunswick for whom the Queen, her mother-in-
law, had such small measure of affection. This first marriage had
been an unhappy one. The Prince had taken his wife to Russia,
where she is said to have become so thoroughly corrupted as to
have shocked the unclean Czarina, Catherine, herself. From Russia
she never returned; but how, when, or where she died, no writer
seems to be able to state with certainty. That she died there in
confinement cannot be doubted; and yet her sister Caroline used to
express her belief that she had been seen in Italy long after the
reported period of her death. Queen Charlotte had an especial
dislike to the projected match of this Prince with her daughter, nor
would the King consent until he had been satisfied that the Prince
had not been a cruel husband to his first wife, and that he had not
become a widower by unfair means. What the nature of this
satisfaction was no one knows. The marriage took place on the 18th
of May. After a thirty years’ residence in Wurtemburg, during which
time that locality was raised to the rank of a kingdom, and the
daughter of our own Charlotte was visited more than once by the
first Napoleon, of whom her husband was a very active ally,
Charlotte Augusta, the ‘good Queen-dowager,’ and a childless widow,
visited England once more, in order to obtain medical relief for a
dropsical complaint. On her voyage back, in worse health than when
she came hither, the vessel had nearly perished in a storm. To her
terrified attendants she calmly remarked, ‘We are as surely under
the protection of God here as upon the dry land—be not afraid!’ She
survived her mother ten years, dying in October, 1828. Her letters
addressed to the lady who superintended the education of the
Princess Charlotte of Wales are creditable alike to her head and her
heart.
The Princess Royal was married in 1797. Soon after she had set
out from St. James’s, early on a morning in June, in tears, and
without a relation to bid her adieu, all having gone through that
ceremony the night before, in order to be saved the trouble of early
rising, the mutiny in the navy broke out—a circumstance which
hardly annoyed the King more than the agitation for Parliamentary
reform; for it was more easily suppressed. There was some
compensation for these vexations in the visit to Duncan’s victorious
North Sea fleet, and in the triumphs of our other naval squadrons.
The year ended appropriately with the royal procession to St. Paul’s
to render fervent thanksgiving for the success of the arms of
England.
It was early in 1798 that the first book was stereotyped in
England, and the Queen was the origin of this innovation—not that
she had any idea of innovation. The facts are simply these:—The
press had been teeming with productions offensive alike to virtue
and religion. To protect both was an anxious object with the Queen.
According to contemporary report, she procured from a German
Lutheran divine (Freylighausen) his ‘Abstract of the whole Doctrine
of the Christian Religion,’ and this she submitted to the judgment of
Dr. Porteus, Bishop of London. The prelate, well pleased to see the
State thus submissive or suggestive to the Church, read the
pamphlet—not only read it, but approved of, and (as it was said,
erroneously) translated it into English. He caused it to be printed in
stereotype, and this translated book was the first volume that was
ever so printed in England. With stereotyping, the name of Queen
Charlotte should always be mentioned in honourable connection.
The year 1798 was marked by the Irish rebellion, the national
subscription for the exigencies of the state, and for the uneasiness
felt at court at the standing toast of the Whigs—‘The sovereignty of
the people!’ That and the following year were the years of the
Volunteer mania. The King and Queen were too happy to encourage
this sort of enthusiasm; and, even in their retirement at Weymouth,
the Volunteer reviews were among the most cherished of their
amusements. They hoped they had reconquered the love of a people
on whom the burden of war pressed heavily. They were at least not
safe from popular fanaticism. On the 15th of May, 1800, the royal
family attended Drury Lane Theatre, after a review in the morning.
As the King entered the box, and was in the act of bowing to the
audience, he was fired at from the pit. The Queen and her
daughters were entering as the shot was fired; and the King kept
them back with his hand, lest, as he said, ‘there might be another.’
After Hatfield, the assassin, had been secured and carried off, the
King and his family sat calmly down, and witnessed the whole
representation. This coolness was deservedly admired. On the return
to the palace the King replied to a sympathising observation of the
Queen, ‘I am going to bed with a confidence that I shall sleep
soundly; and my prayer is that the poor unhappy prisoner who
aimed at my life may rest as quietly as I shall.’
The other domestic incidents in the life of the Queen or King are
not of sufficient interest to be worth the detail. We may make
exception of one, however, which introduces us once more to the
earnest and indefatigable Lady Huntingdon.
Early in the present century we again meet with this lady, busy
at, with, and in defiance of courts. In her zeal as a reformer of
manners and morals, she was bold without being indiscreet; and she
was never more bold than when she attacked, courteously and
courageously, no less a person than Dr. Cornwallis, Archbishop of
Canterbury. This right reverend lord primate had given several grand
routs at his palace. The archbishop was an old-fashioned man; and
what had been tolerated in his father and mother must also be
permitted to himself and wife, the magnificent Mrs. Cornwallis—
leader and slave of ton. Let the world have justice done to it, the
majority therein were sorely scandalised at these irreverend
proceedings. But Lady Huntingdon was the only one bold enough to
give expression to what she felt. With the energy and tact natural to
such a woman she contrived to obtain the grant of an audience with
the primate and his lady, and thither she went, accompanied by the
Marquis of Townshend.
The priests of the sacred cities of Anahuac were not more
horror-stricken when Cortez asked them to burn their gods, than the
primate of all England was when the good lady pressed upon him
sacrifices which would entail the necessity of spending very dull
evenings. As for Mrs. Cornwallis, she tarred and feathered Lady
Huntingdon, metaphorically, by flinging missiles which soiled her
who flung them, and by scattering light ridicule which was blown
back upon the face and reputation of the scatterer. Lady Huntingdon
again and again assaulted the archi-episcopal fortress, but she was
driven back by repeated discharges of ‘Methodist!’ and ‘Hypocrite!’
She could do nothing at Lambeth, and accordingly she turned
her face towards Kew. Nor had she long to wait before Queen
Charlotte and her royal consort admitted her to an interview, to
which she was conducted by Lord Dartmouth and the Duchess of
Ancaster.
The sovereigns listened to the simple yet earnest story. The King
was especially warm in expressing his indignation, and the Queen
took her full share in such expression. ‘I had heard something of this
before,’ said George III., ‘but I knew not if all was as bad as Lady
Huntingdon has detailed it. The archbishop has behaved very ill to
the lady. I will see if he dare refuse to listen to a King.’ The gay and
orthodox courtiers present began to think that the world was at an
end. Here was the State placing itself above the Church! Mentally,
they no doubt denied the royal supremacy.
In an after-conversation the honest King confessed that Lady
Huntingdon herself had been painted to him in very odd colours,
and, in admitting her to an interview, he was partly influenced by his
curiosity to see whether she was so strange a creature as she had
been described by her enemies. To his expressions of admiration for
herself and her work the Queen added similar assurances; and could
the archbishop have seen two sovereigns thus complimenting a
‘Methodist’ and a ‘Hypocrite,’ no doubt the primate, zealous for
nightly ‘drums,’ would have burst into tears, and have declared that
the sun of England was set for ever!
‘His Majesty,’ said Queen Charlotte, ‘had complaints made
against yourself, in part, Lady Huntingdon, but chiefly against your
students and ministers, whose preaching annoys one or two of our
bishops who are careless.’ The King nodded assent, adding, it was a
pity that these students and ministers could not be made bishops of,
as then they would cease to annoy anyone by preaching. It was
objected that even the Lady Huntingdon could not be made a bishop
of, and so the evil would be as rife as ever. ‘I wish we could make
her one,’ said the Queen, with a smile at the idea; ‘I am sure her
ladyship would shame more than one upon the bench!’
The King then conversed with Lady Huntingdon, chiefly upon old
times and persons of his father’s court, at which she had for a while
been a frequent visitor. ‘We discussed a great many subjects,’ says
the lady herself, in her account of the interview, ‘for the conversation
lasted upwards of an hour, without intermission. The Queen,’ she
adds, ‘spoke a good deal, asked many questions, and, before I
retired, insisted on my taking some refreshments. On parting, I was
permitted to kiss their Majesties’ hands; and when I returned my
humble and most grateful acknowledgments for their very great
condescension, their Majesties immediately assured me they both
felt gratified and pleased with the interview, which they were so
obliging as to wish might be renewed.’
The Queen repeatedly expressed her admiration of Lady
Huntingdon’s conduct on this occasion, one result of which was a
stringent letter addressed by the King to the primate. In this royal
remonstrance and reproof, the writer told the archbishop that he
‘held such levities and vain dissipations as utterly inexpedient, if not
unlawful, to pass in a residence for many centuries devoted to divine
studies, religious retirement, and the extensive exercise of charity
and benevolence ... where so many have led their lives in such
sanctity as has thrown lustre on the pure religion they professed and
adorned. From the dissatisfaction,’ adds the King, ‘with which you
must perceive I hold these improprieties, not to speak in harsher
terms, and on still more pious principles, I trust that you will
suppress them immediately, so that I may not have occasion to
show any further marks of my displeasure, or to interpose in a
different manner.’
When it was necessary to administer such a reproof as this to an
archbishop, we may readily believe that only a sorry sort of
reputation attached itself to the clergy generally. This had been the
case for many years. Speaking of the Queen’s drawing-room, held in
January, 1777, Cumberland, who was present, says: ‘Sir George
Warren had his order snatched off his ribbon, encircled with
diamonds to the value of 700l. Foote was there and lays it upon the
parsons, having secured, as he says, his gold snuff-box in his
waistcoat pocket upon seeing so many black gowns in the room.’
Foote’s remark was only in jest, but it shows the estimation in
which the clergy were held. They were for the most part, and yet
with some noble exceptions, but wretched teachers both by precept
and example. Where clerical instruction was thus doubly defective,
lay practice was not of a very pure character. Only two or three
years before Lady Huntingdon waited on Queen Charlotte and the
King at Kew, an incident illustrative of my remark occurred at one of
her Majesty’s drawing-rooms. A great crowd had assembled, and
amid the throng—while the Prince of Wales was conversing with the
King—he felt a sudden pull made at the hilt of his sword. He looked
down and perceived that the diamond guard of the weapon was
broken off, but it remained suspended by a small piece of wire, the
elasticity of which had prevented it from breaking, and so preserved
the diamond-studded guard. No discovery was made as to the
author of this felonious attempt, and the Prince did wisely in refusing
to fix on the gentleman who stood nearest to his side as the
offender.
In 1801 the Prince of Wales was in full opposition against the
crown and Pitt. The opposition had a Jacobinical character, and
affected Jacobinical opinion without any reserve. Lord Malmesbury
remarks of the Prince that even ‘his language in the streets is such
as would better become a member of Opposition than the heir to
these kingdoms.’ This conduct was followed at a time when the state
of the King’s health began again to cause some anxiety. He had
contracted a chill and severe cramps by remaining too long in a cold
church, on the 13th of February. We find Lord Malmesbury recording
on the 17th of February: ‘King got a bad cold. Takes James’s
powders. God forbid he-should be ill!’ And the next day he writes:
‘King-better. Lord Radnor saw him yesterday morning, and he clearly
had only a bad cold.’ One day later, on occasion of an audience of
the King being sought by Mr. Pelham, the same writer says: ‘Pelham
came back to me from court; he had seen and consulted the Duke of
Portland, who approved his seeing the King, but said it would not be
to-day, as the King was unwell, and on such occasions it was not
usual to disturb him but on great public business.’ On the 21st
matters appeared worse. ‘Bad accounts from Queen’s House; the
answer at the door is, the King is better: but it is not so. He took a
strong emetic on Thursday, and was requested to take another to-
day, which he resisted.’ It would seem that the progressive
seriousness of the symptoms produced no corresponding effects in
the heir-apparent. On Sunday, the 22nd of February, the diarist
writes: ‘His Majesty still bilious; not getting better; apprehensions of
getting worse. Fatal consequence of Pitt’s hasty resignation. Princess
Amelia unwell. Queen not well. At Carlton House they dance and
sing.’ As the King grew worse, the intrigues of the husband of
Caroline became more active. The regency was the object of these
intrigues. In the meantime the condition of the Sovereign grew daily
more unsatisfactory. On the 29th of February the King’s pulse was at
130 during the night. ‘This makes,’ says Lord Malmesbury, ‘in favour
of the mental derangement, and proves it to be only the effect of
delirium in consequence of fever, but it puts his life in very great
danger.’