0% found this document useful (0 votes)
5 views

Discovering Computer Science Interdisciplinary Problems Principles and Python Programming 1st Edition Jessen Havill pdf download

Ebook

Uploaded by

crompsylteh2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Discovering Computer Science Interdisciplinary Problems Principles and Python Programming 1st Edition Jessen Havill pdf download

Ebook

Uploaded by

crompsylteh2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Discovering Computer Science Interdisciplinary

Problems Principles and Python Programming 1st


Edition Jessen Havill download

https://textbookfull.com/product/discovering-computer-science-
interdisciplinary-problems-principles-and-python-programming-1st-
edition-jessen-havill/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Discovering Computer Science Interdisciplinary Problems


Principles and Python Programming First Edition Jessen
Havill

https://textbookfull.com/product/discovering-computer-science-
interdisciplinary-problems-principles-and-python-programming-
first-edition-jessen-havill/

Discovering Computer Science: Interdisciplinary


Problems, Principles, and Python Programming 2nd
Edition Jessen Havill

https://textbookfull.com/product/discovering-computer-science-
interdisciplinary-problems-principles-and-python-programming-2nd-
edition-jessen-havill/

Discovering Computer Science Interdisciplinary Problems


Principles and Python Programming 2nd Edition Jessen
Havill

https://textbookfull.com/product/discovering-computer-science-
interdisciplinary-problems-principles-and-python-programming-2nd-
edition-jessen-havill-2/

Python Programming An Introduction to Computer Science


John M. Zelle

https://textbookfull.com/product/python-programming-an-
introduction-to-computer-science-john-m-zelle/
Python Programming An Introduction to Computer Science
3rd Edition John M. Zelle

https://textbookfull.com/product/python-programming-an-
introduction-to-computer-science-3rd-edition-john-m-zelle/

Programming Interview Problems: Dynamic Programming


(with solutions in Python) 1st Edition Leonardo Rossi

https://textbookfull.com/product/programming-interview-problems-
dynamic-programming-with-solutions-in-python-1st-edition-
leonardo-rossi/

Practical Programming An Introduction to Computer


Science Using Python 3 6 3rd Edition Paul Gries

https://textbookfull.com/product/practical-programming-an-
introduction-to-computer-science-using-python-3-6-3rd-edition-
paul-gries/

Classic Computer Science Problems in Java 1st Edition


David Kopec

https://textbookfull.com/product/classic-computer-science-
problems-in-java-1st-edition-david-kopec/

Modern and Interdisciplinary Problems in Network


Science: A Translational Research Perspective 1st
Edition Zengqiang Chen

https://textbookfull.com/product/modern-and-interdisciplinary-
problems-in-network-science-a-translational-research-
perspective-1st-edition-zengqiang-chen/
DISCOVERING
COMPUTER
SCIENCE
Interdisciplinary Problems,
Principles, and Python
Programming
CHAPMAN & HALL/CRC
TEXTBOOKS IN COMPUTING

Series Editors

John Impagliazzo Andrew McGettrick


Professor Emeritus, Hofstra University Department of Computer
and Information Sciences
University of Strathclyde

Aims and Scope

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

Paul Anderson, Web 2.0 and Beyond: Principles and Technologies


Henrik Bærbak Christensen, Flexible, Reliable Software: Using Patterns and Agile Development
John S. Conery, Explorations in Computing: An Introduction to Computer Science
John S. Conery, Explorations in Computing: An Introduction to Computer Science and Python
Programming
Jessen Havill, Discovering Computer Science: Interdisciplinary Problems, Principles, and
Python Programming
Ted Herman, A Functional Start to Computing with Python
Pascal Hitzler, Markus Krötzsch, and Sebastian Rudolph, Foundations of Semantic Web
Technologies
Mark J. Johnson, A Concise Introduction to Data Structures using Java
Mark J. Johnson, A Concise Introduction to Programming in Python
Lisa C. Kaczmarczyk, Computers and Society: Computing for Good
Mark C. Lewis, Introduction to the Art of Programming Using Scala
Bill Manaris and Andrew R. Brown, Making Music with Computers: Creative Programming in
Python
Uvais Qidwai and C.H. Chen, Digital Image Processing: An Algorithmic Approach with MATLAB®
David D. Riley and Kenny A. Hunt, Computational Thinking for the Modern Problem Solver
Henry M. Walker, The Tao of Computing, Second Edition
Chapman & Hall/CRC
TEXTBOOKS IN COMPUTING

DISCOVERING
COMPUTER
SCIENCE
Interdisciplinary Problems,
Principles, and Python
Programming

Jessen Havill
Denison University
Granville, Ohio, USA
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2016 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works


Version Date: 20150318

International Standard Book Number-13: 978-1-4822-5416-7 (eBook - PDF)

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 valid-
ity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced 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 uti-
lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy-
ing, 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.copyright.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
identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Contents

Preface xv

Acknowledgments xxiii

About the author xxv

Chapter 1  What is computation? 1


1.1 PROBLEMS AND ABSTRACTION 2
1.2 ALGORITHMS AND PROGRAMS 4
1.3 EFFICIENT ALGORITHMS 11
Organizing a phone tree 11
A smoothing algorithm 13
A better smoothing algorithm 17
1.4 COMPUTERS ARE DUMB 20
Inside a computer 20
Machine language 21
Everything is bits 22
The universal machine 26
1.5 SUMMARY 29
1.6 FURTHER DISCOVERY 30

Chapter 2  Elementary computations 31


2.1 WELCOME TO THE CIRCUS 31
2.2 ARITHMETIC 32
Finite precision 34
Division 34
Order of operations 35
Complex numbers 37
2.3 WHAT’S IN A NAME? 38
2.4 USING FUNCTIONS 45

v
vi  Contents

Built-in functions 45
Strings 47
Modules 51
*2.5 BINARY ARITHMETIC 54
Finite precision 55
Negative integers 56
Designing an adder 57
Implementing an adder 58
2.6 SUMMARY 62
2.7 FURTHER DISCOVERY 62

Chapter 3  Visualizing abstraction 65


3.1 DATA ABSTRACTION 66
3.2 VISUALIZATION WITH TURTLES 70
Drawing with iteration 72
3.3 FUNCTIONAL ABSTRACTION 76
Function parameters 78
Let’s plant a garden 84
3.4 PROGRAMMING IN STYLE 89
Program structure 89
Documentation 91
Descriptive names and magic numbers 95
3.5 A RETURN TO FUNCTIONS 97
Return vs. print 100
3.6 SCOPE AND NAMESPACES 103
Local namespaces 104
The global namespace 107
3.7 SUMMARY 111
3.8 FURTHER DISCOVERY 112

Chapter 4  Growth and decay 113


4.1 DISCRETE MODELS 114
Managing a fishing pond 114
Measuring network value 121
Organizing a concert 124
4.2 VISUALIZING POPULATION CHANGES 136
4.3 CONDITIONAL ITERATION 140
Contents  vii

*4.4 CONTINUOUS MODELS 145


Difference equations 145
Radiocarbon dating 148
Tradeoffs between accuracy and time 150
Propagation of errors 152
Simulating an epidemic 153
*4.5 NUMERICAL ANALYSIS 159
The harmonic series 159
Approximating π 162
Approximating square roots 164
4.6 SUMMING UP 167
4.7 FURTHER DISCOVERY 171
4.8 PROJECTS 171
Project 4.1 Parasitic relationships 171
Project 4.2 Financial calculators 173
*Project 4.3 Market penetration 177
*Project 4.4 Wolves and moose 180

Chapter 5  Forks in the road 185


5.1 RANDOM WALKS 185
A random walk in Monte Carlo 192
Histograms 195
*5.2 PSEUDORANDOM NUMBER GENERATORS 200
Implementation 201
Testing randomness 203
*5.3 SIMULATING PROBABILITY DISTRIBUTIONS 205
The central limit theorem 206
5.4 BACK TO BOOLEANS 209
Short circuit evaluation 212
Complex expressions 214
*Using truth tables 216
Many happy returns 218
5.5 A GUESSING GAME 224
5.6 SUMMARY 233
5.7 FURTHER DISCOVERY 234
5.8 PROJECTS 234
viii  Contents

Project 5.1 The magic of polling 234


Project 5.2 Escape! 237

Chapter 6  Text, documents, and DNA 241


6.1 COUNTING WORDS 242
6.2 TEXT DOCUMENTS 250
Reading from text files 250
Writing to text files 253
Reading from the web 254
6.3 ENCODING STRINGS 259
Indexing and slicing 259
Creating modified strings 261
Encoding characters 263
6.4 LINEAR-TIME ALGORITHMS 270
Asymptotic time complexity 274
6.5 ANALYZING TEXT 279
Counting and searching 279
A concordance 284
6.6 COMPARING TEXTS 289
*6.7 GENOMICS 297
A genomics primer 297
Basic DNA analysis 301
Transforming sequences 302
Comparing sequences 304
Reading sequence files 306
6.8 SUMMARY 312
6.9 FURTHER DISCOVERY 313
6.10 PROJECTS 313
Project 6.1 Polarized politics 313
*Project 6.2 Finding genes 316

Chapter 7  Designing programs 321


7.1 HOW TO SOLVE IT 322
Understand the problem 323
Design an algorithm 324
Implement your algorithm as a program 327
Analyze your program for clarity, correctness, and efficiency 330
Contents  ix

*7.2 DESIGN BY CONTRACT 331


Preconditions and postconditions 331
Checking parameters 332
Assertions 334
*7.3 TESTING 340
Unit testing 340
Regression testing 342
Designing unit tests 343
Testing floating point values 347
7.4 SUMMARY 350
7.5 FURTHER DISCOVERY 350

Chapter 8  Data analysis 351


8.1 SUMMARIZING DATA 351
8.2 CREATING AND MODIFYING LISTS 360
List accumulators, redux 360
Lists are mutable 361
Tuples 365
List operators and methods 366
*List comprehensions 368
8.3 FREQUENCIES, MODES, AND HISTOGRAMS 373
Tallying values 373
Dictionaries 374
8.4 READING TABULAR DATA 384
*8.5 DESIGNING EFFICIENT ALGORITHMS 390
A first algorithm 391
A more elegant algorithm 399
A more efficient algorithm 400
*8.6 LINEAR REGRESSION 403
*8.7 DATA CLUSTERING 409
Defining similarity 410
A k-means clustering example 411
Implementing k-means clustering 414
Locating bicycle safety programs 416
8.8 SUMMARY 421
8.9 FURTHER DISCOVERY 421
x  Contents

8.10 PROJECTS 422


Project 8.1 Climate change 422
Project 8.2 Does education influence unemployment? 425
Project 8.3 Maximizing profit 427
Project 8.4 Admissions 428
*Project 8.5 Preparing for a 100-year flood 430
Project 8.6 Voting methods 435
Project 8.7 Heuristics for traveling salespeople 438

Chapter 9  Flatland 443


9.1 TWO-DIMENSIONAL DATA 443
9.2 THE GAME OF LIFE 449
Creating a grid 451
Initial configurations 452
Surveying the neighborhood 453
Performing one pass 454
Updating the grid 457
9.3 DIGITAL IMAGES 461
Colors 461
Image filters 463
Transforming images 467
9.4 SUMMARY 471
9.5 FURTHER DISCOVERY 471
9.6 PROJECTS 471
Project 9.1 Modeling segregation 471
Project 9.2 Modeling ferromagnetism 473
Project 9.3 Growing dendrites 474

Chapter 10  Self-similarity and recursion 477


10.1 FRACTALS 477
A fractal tree 479
A fractal snowflake 481
10.2 RECURSION AND ITERATION 488
Solving a problem recursively 491
Palindromes 492
Guessing passwords 495
10.3 THE MYTHICAL TOWER OF HANOI 500
Contents  xi

*Is the end of the world nigh? 502


10.4 RECURSIVE LINEAR SEARCH 503
Efficiency of recursive linear search 505
10.5 DIVIDE AND CONQUER 508
Buy low, sell high 508
Navigating a maze 512
*10.6 LINDENMAYER SYSTEMS 518
Formal grammars 518
Implementing L-systems 522
10.7 SUMMARY 525
10.8 FURTHER DISCOVERY 526
10.9 PROJECTS 526
*Project 10.1 Lindenmayer’s beautiful plants 526
Project 10.2 Gerrymandering 531
Project 10.3 Percolation 536

Chapter 11  Organizing data 541


11.1 BINARY SEARCH 542
Efficiency of iterative binary search 546
A spelling checker 548
Recursive binary search 549
Efficiency of recursive binary search 550
11.2 SELECTION SORT 553
Implementing selection sort 553
Efficiency of selection sort 557
Querying data 558
11.3 INSERTION SORT 563
Implementing insertion sort 564
Efficiency of insertion sort 566
11.4 EFFICIENT SORTING 570
Internal vs. external sorting 574
Efficiency of merge sort 574
*11.5 TRACTABLE AND INTRACTABLE ALGORITHMS 577
Hard problems 579
11.6 SUMMARY 580
11.7 FURTHER DISCOVERY 581
xii  Contents

11.8 PROJECTS 581


Project 11.1 Creating a searchable database 581
Project 11.2 Binary search trees 581

Chapter 12  Networks 587


12.1 MODELING WITH GRAPHS 588
Making friends 590
12.2 SHORTEST PATHS 594
Finding the actual paths 598
12.3 IT’S A SMALL WORLD. . . 601
Clustering coefficients 603
Scale-free networks 605
12.4 RANDOM GRAPHS 608
12.5 SUMMARY 611
12.6 FURTHER DISCOVERY 611
12.7 PROJECTS 612
Project 12.1 Diffusion of ideas and influence 612
Project 12.2 Slowing an epidemic 614
Project 12.3 The Oracle of Bacon 616

Chapter 13  Abstract data types 621


13.1 DESIGNING CLASSES 622
Implementing a class 625
Documenting a class 632
13.2 OPERATORS AND SPECIAL METHODS 637
String representations 637
Arithmetic 638
Comparison 640
Indexing 642
13.3 MODULES 645
Namespaces, redux 646
13.4 A FLOCKING SIMULATION 648
The World ADT 649
The Boid ADT 655
13.5 A STACK ADT 665
13.6 A DICTIONARY ADT 671
Hash tables 672
Contents  xiii

Implementing a hash table 673


Implementing indexing 676
ADTs vs. data structures 678
13.7 SUMMARY 682
13.8 FURTHER DISCOVERY 682
13.9 PROJECTS 683
Project 13.1 Tracking GPS coordinates 683
Project 13.2 Economic mobility 687
Project 13.3 Slime mold aggregation 690
Project 13.4 Boids in space 692

Appendix A  Installing Python 697


A.1 AN INTEGRATED DISTRIBUTION 697
A.2 MANUAL INSTALLATION 697

Appendix B  Python library reference 701


B.1 MATH MODULE 701
B.2 TURTLE METHODS 702
B.3 SCREEN METHODS 703
B.4 MATPLOTLIB.PYPLOT MODULE 704
B.5 RANDOM MODULE 704
B.6 STRING METHODS 705
B.7 LIST METHODS 706
B.8 IMAGE MODULE 706
B.9 SPECIAL METHODS 707

Bibliography 709

Index 713
This page intentionally left blank
Preface

n my view, an introductory computer science course should strive to accomplish


I three things. First, it should demonstrate to students how computing has become
a powerful mode of inquiry, and a vehicle of discovery, in a wide variety of disciplines.
This orientation is also inviting to students of the natural and social sciences, who
increasingly benefit from an introduction to computational thinking, beyond the
limited “black box” recipes often found in manuals. Second, the course should engage
students in computational problem solving, and lead them to discover the power of
abstraction, efficiency, and data organization in the design of their solutions. Third,
the course should teach students how to implement their solutions as computer
programs. In learning how to program, students more deeply learn the core principles,
and experience the thrill of seeing their solutions come to life.
Unlike most introductory computer science textbooks, which are organized
around programming language constructs, I deliberately lead with interdisciplinary
problems and techniques. This orientation is more interesting to a more diverse
audience, and more accurately reflects the role of programming in problem solv-
ing and discovery. A computational discovery does not, of course, originate in a
programming language feature in search of an application. Rather, it starts with
a compelling problem which is modeled and solved algorithmically, by leveraging
abstraction and prior experience with similar problems. Only then is the solution
implemented as a program.
Like most introductory computer science textbooks, I introduce programming
skills in an incremental fashion, and include many opportunities for students to prac-
tice them. The topics in this book are arranged to ease students into computational
thinking, and encourage them to incrementally build on prior knowledge. Each
chapter focuses on a general class of problems that is tackled by new algorithmic
techniques and programming language features. My hope is that students will leave
the course, not only with strong programming skills, but with a set of problem
solving strategies and simulation techniques that they can apply in their future
work, whether or not they take another computer science course.
I use Python to introduce computer programming for two reasons. First, Python’s
intuitive syntax allows students to focus on interesting problems and powerful
principles, without unnecessary distractions. Learning how to think algorithmically
is hard enough without also having to struggle with a non-intuitive syntax. Second,
the expressiveness of Python (in particular, low-overhead lists and dictionaries)
expands tremendously the range of accessible problems in the introductory course.
Teaching with Python over the last ten years has been a revelation; introductory
computer science has become fun again.

xv
xvi  Preface

Web resources
The text, exercises, and projects often refer to files on the book’s accompanying
web site, which can be found at

http://discoverCS.denison.edu .

This web site also includes pointers for further exploration, links to additional
documentation, and errata.

To students
Learning how to solve computational problems and implement them as computer
programs requires daily practice. Like an athlete, you will get out of shape and fall
behind quickly if you skip it. There are no shortcuts. Your instructor is there to
help, but he or she cannot do the work for you.
With this in mind, it is important that you type in and try the examples
throughout the text, and then go beyond them. Be curious! There are numbered
“Reflection” questions throughout the book that ask you to stop and think about, or
apply, something that you just read. Often, the question is answered in the book
immediately thereafter, so that you can check your understanding, but peeking
ahead will rob you of an important opportunity.
There are many opportunities to delve into topics more deeply. Boxes scattered
throughout the text briefly introduce related, but more technical, topics. For the
most part, these are not strictly required to understand what comes next, but I
encourage you to read them anyway. In the “Further discovery” section of each
chapter, you can find additional pointers to explore chapter topics in more depth.
At the end of most sections are several programming exercises that ask you
to further apply concepts from that section. Often, the exercises assume that you
have already worked through all of the examples in that section. All later chapters
conclude with a selection of more involved interdisciplinary projects that you may
be asked by your instructor to tackle.
The book assumes no prior knowledge of computer science. However, it does
assume a modest comfort with high school algebra and mathematical functions.
Occasionally, trigonometry is mentioned, as is the idea of convergence to a limit,
but these are not crucial to an understanding of the main topics in this book.

To instructors
This book may be appropriate for a traditional CS1 course for majors, a CS0 course
for non-majors (at a slower pace and omitting more material), or an introductory
computing course for students in the natural and/or social sciences.
As suggested above, I emphasize computer science principles and the role of
abstraction, both functional and data, throughout the book. I motivate functions
as implementations of functional abstractions, and point out that strings, lists,
and dictionaries are all abstract data types that allow us to solve more interesting
problems than would otherwise be possible. I introduce the idea of time complexity
Preface  xvii

Chapter 1 Chapter 2 Chapter 3


Chapter 4
What is Elementary Visualizing
Growth and decay
computation? computations abstraction

Chapter 7 Chapter 6
Chapter 8 Chapter 5
Designing Text, documents,
Data analysis Forks in the road
programs and DNA

Chapter 10
Chapter 9 Chapter 11
Self-similarity and
Flatland Organizing data
recursion

Chapter 13
Chapter 12
Abstract data
Networks
types

Figure 1 An overview of chapter dependencies.

intuitively, without formal definitions, in the first chapter and return to it several
times as more sophisticated algorithms are developed. The book uses a spiral
approach for many topics, returning to them repeatedly in increasingly complex
contexts. Where appropriate, I also weave into the book topics that are traditionally
left for later computer science courses. A few of these are presented in boxes that
may be covered at your discretion. None of these topics is introduced rigorously, as
they would be in a data structures course. Rather, I introduce them informally and
intuitively to give students a sense of the problems and techniques used in computer
science. I hope that the tables below will help you navigate the book, and see where
particular topics are covered.
This book contains over 600 end-of-section exercises and over 300 in-text reflection
questions that may be assigned as homework or discussed in class. At the end of
most chapters is a selection of projects (about 30 in all) that students may work on
independently or in pairs over a longer time frame. I believe that projects like these
are crucial for students to develop both problem solving skills and an appreciation
for the many fascinating applications of computer science.
Because this book is intended for a student who may take additional courses in
computer science and learn other programming languages, I intentionally omit some
features of Python that are not commonly found elsewhere (e.g., simultaneous swap,
chained comparisons, enumerate in for loops). You may, of course, supplement
with these additional syntactical features.
There is more in this book than can be covered in a single semester, giving an
instructor the opportunity to tailor the content to his or her particular situation and
interests. Generally speaking, as illustrated in Figure 1, Chapters 1–6 and 8 form the
core of the book, and should be covered sequentially. The remaining chapters can be
covered, partially or entirely, at your discretion, although I would expect that most
instructors will cover at least parts of Chapters 7, 10, 11, and 13. Chapter 7 contains
xviii  Preface

additional material on program design, including design by contract, assertions and


unit testing that may be skipped without consequences for later chapters. Chapters
9–13 are, more or less, independent of each other. Sections marked with an asterisk
are optional, in the sense that they are not assumed for future sections in that
chapter. When projects depend on optional sections, they are also marked with an
asterisk, and the dependency is stated at the beginning of the project.

Chapter outlines
The following tables provide brief overviews of each chapter. Each table’s three
columns, reflecting the three parts of the book’s subtitle, provide three lenses through
which to view the chapter. The first column lists a selection of representative problems
that are used to motivate the material. The second column lists computer science
principles that are introduced in that chapter. Finally, the third column lists Python
programming topics that are either introduced or reinforced in that chapter to
implement the principles and/or solve the problems.

Chaper 1. What is computation?


Sample problems Principles Programming
• digital music • problems, input/output —
• search engines • abstraction
• GPS devices • algorithms and programs
• smoothing data • computer architecture
• phone trees • binary representations
• time complexity
• Turing machine

Chapter 2. Elementary computations


Sample problems Principles Programming
• wind chill • finite precision • int and float numeric types
• geometry • names as references • arithmetic and the math module
• compounding • using functional • variable names and assignment
interest abstractions • calling built-in functions
• Mad Libs • binary addition • using strings, + and * operators
• print and input

Chapter 3. Visualizing abstraction


Sample problems Principles Programming
• visualizing an • using abstract data types • using classes and objects
archaeological dig • creating functional • turtle module
• random walks abstractions • basic for loops
• ideal gas • basic functional • writing functions
• groundwater flow decomposition • namespaces
• demand functions • docstrings and comments
Preface  xix

Chapter 4. Growth and decay


Sample problems Principles Programming
• network value • accumulators • for loops
• demand and profit • list accumulators • format strings
• loans and investing • difference equations • range
• bacterial growth • approximating continuous • matplotlib
• radiocarbon dating models • appending to lists
• diffusion models • accuracy vs. time • while loops
– SIR, SIS, Bass • error propagation
• competition models • numerical approximation
– Nicholson-Bailey • classes of growth
– Lotka-Volterra
– indirect

Chapter 5. Forks in the road


Sample problems Principles Programming
• random walks • Monte Carlo simulation • random module
• guessing games • pseudorandom number • if/elif/else
• polling and generators • comparison operators
sampling • simulating probabilities • Boolean operators
• particle escape • flag variables • matplotlib histograms
• using uniform and normal • while loops
distributions
• DeMorgan’s laws

Chapter 6. Text, documents, and DNA


Sample problems Principles Programming
• word count • ASCII, Unicode • str class and methods
• textual analysis • linear-time algorithms • iterating over strings
• parsing XML • asymptotic time complexity • indexing and slices
• checksums • linear search • iterating over indices
• concordances • dot plots • reading and writing text files
• detecting plagiarism • string accumulators • nested loops
• congressional votes
• genomics

Chapter 7. Designing programs


Sample problems Principles Programming
• word frequency • problem solving • assert statement
analysis • top-down design • conditional execution
• pre and postconditions of main
• assertions • writing modules
• unit testing
xx  Preface

Chapter 8. Data analysis


Sample problems Principles Programming
• 100-year floods • histograms • list class
• traveling salesman • hash tables • iterating over lists
• Mohs scale • tabular data files • indexing and slicing
• meteorite sites • efficient algorithms • list operators and methods
• zebra migration • linear regression • lists in memory; mutability
• tumor diagnosis • k-means clustering • list parameters
• education levels • heuristics • tuples
• supply and demand • list comprehensions
• voting methods • dictionaries

Chapter 9. Flatland
Sample problems Principles Programming
• earthquake data • 2-D data • 2-D data in list of lists
• Game of Life • cellular automata • nested loops
• image filters • digital images • 2-D data in a dictionary
• racial segregation • color models
• ferromagnetism
• dendrites

Chapter 10. Self-similarity and recursion


Sample problems Principles Programming
• fractals • self-similarity • writing recursive functions
• cracking passwords • recursion
• Tower of Hanoi • linear search
• maximizing profit • recurrence relations
• path through a maze • divide and conquer
• Lindenmayer system • depth-first search
• electoral districting • grammars
• percolation

Chapter 11. Organizing data


Sample problems Principles Programming
• spell check • binary search • nested loops
• querying data sets • recurrence relations • writing recursive functions
• basic sorting algorithms
• quadratic-time algorithms
• parallel lists
• merge sort
• intractability
• P=NP (intuition)
• Moore’s law
• binary search trees
Preface  xxi

Chapter 12. Networks


Sample problems Principles Programming
• Facebook, Twitter, • graphs • dictionaries
web graphs • adjacency list
• diffusion of ideas • adjacency matrix
• epidemics • breadth-first search
• Oracle of Bacon • distance and shortest paths
• depth-first search
• small-world networks
• scale-free networks
• clustering coefficient
• uniform random graphs

Chapter 13. Abstract data types


Sample problems Principles Programming
• data sets • abstract data types • writing classes
• genomic sequences • data structures • special methods
• rational numbers • stacks • overriding operators
• flocking behavior • hash tables • modules
• slime mold • agent-based simulation
aggregation • swarm intelligence

Software assumptions
To follow along in this book and complete the exercises, you will need to have installed
Python 3.4 (or later) on your computer, and have access to IDLE or another
programming environment. The book also assumes that you have installed the
matplotlib and numpy modules. Please refer to Appendix A for more information.

Errata
While I (and my students) have ferreted out many errors, readers will inevitably
find more. You can find an up-to-date list of errata on the book web site. If
you find an error in the text or have another suggestion, please let me know at
[email protected].
This page intentionally left blank
Acknowledgments

was extraordinarily naı̈ve when I embarked on this project two years ago. “How
I hard can it be to put these ideas into print?” Well, much harder than I thought,
as it turns out. I owe debts of gratitude to many who saw me through to the end.
First and foremost, my family not only tolerated me during this period, but
offered extraordinary support and encouragement. Thank you Beth, for your patience
and strength, and all of the time you have made available to me to work on the
book. I am grateful to my in-laws, Roger and Nancy Vincent, who offered me their
place in Wyoming for a month-long retreat in the final stretch. And, to my four
children, Nick, Amelia, Caroline, and Lillian, I promise to make up for lost time.
My colleagues Matt Kretchmar, Ashwin Lall, and David White used drafts in
their classes, and provided invaluable feedback. They have been fantastic sounding
boards, and have graciously provided many ideas for exercises and projects. Students
in Denison University’s CS 111 and 112 classes caught many typos, especially Gabe
Schenker, Christopher Castillo, Christine Schmittgen, Alivia Tacheny, Emily Lamm,
and Ryan Liedke. Dana Myers read much of the book and offered an abundance of
detailed suggestions. Joan Krone also read early chapters and offered constructive
feedback. I am grateful to Todd Feil for his support, and his frank advice after
reading the almost-final manuscript.
I have benefitted tremendously from many conversations about computational
science, geology, and life with my friend and colleague David Goodwin. Project 8.1
is based on an assignment that he has used in his classes. I have also learned a great
deal from collaborations with Jeff Thompson. Jeff also advised me on Section 6.7
and Project 6.2. Frank Hassebrock enthusiastically introduced me to theories of
problem solving in cognitive psychology. And Dee Ghiloni, the renowned cat herder,
has supported me and my work in more ways than I can count.
I am indebted to the following reviewers, who read early chapters and offered
expert critiques: Terry Andres (University of Manitoba), John Impagliazzo (Qatar
University), Daniel Kaplan (Macalester College), Nathaniel Kell (Duke University),
Andrew McGettrick (University of Strathclyde); Hamid Mokhtarzadeh (University
of Minnesota), George Novacky (University of Pittsburgh), and J. F. Nystrom (Ferris
State University).
I could not have completed this book without the Robert C. Good Fellowship
awarded to me by Denison University.
Finally, thank you to Randi Cohen, for believing in this project, and for her
advice and patience throughout.

xxiii
This page intentionally left blank
About the author

Jessen Havill is a Professor of Computer Science and the Benjamin Barney Chair
of Mathematics at Denison University, where he has been on the faculty since 1998.
Dr. Havill teaches courses across the computer science curriculum, as well as an
interdisciplinary elective in computational biology. He was awarded the college’s
highest teaching honor, the Charles A. Brickman Teaching Excellence Award, in
2013.
Dr. Havill is also an active researcher, with a primary interest in the development
and analysis of online algorithms. In addition, he has collaborated with colleagues
in biology and geosciences to develop computational tools to support research
and teaching in those fields. Dr. Havill earned his bachelor’s degree from Bucknell
University and his Ph.D. in computer science from The College of William and
Mary.

xxv
This page intentionally left blank
CHAPTER 1

What is computation?

We need to do away with the myth that computer science is about computers. Computer
science is no more about computers than astronomy is about telescopes, biology is about
microscopes or chemistry is about beakers and test tubes. Science is not about tools, it is
about how we use them and what we find out when we do.

Michael R. Fellows and Ian Parberry


Computing Research News (1993)

omputers are the most powerful tools ever invented, but not because of their
C versatility and speed, per se. Computers are powerful because they empower
us to innovate and make unprecedented discoveries.
A computer is a machine that carries out a computation, a sequence of simple
steps that transforms some initial information, an input, into some desired result,
the output. Computer scientists harness the power of computers to solve complex
problems by designing solutions that can be expressed as computations. The output
of a computation might be a more efficient route for a spacecraft, a more effective
protocol to control an epidemic, or a secret message hidden in a digital photograph.
Computer science has always been interdisciplinary, as computational problems
arise in virtually every domain imaginable. Social scientists use computational models
to better understand social networks, epidemics, population dynamics, markets,
and auctions. Scholars working in the digital humanities use computational tools to
curate and analyze classic literature. Artists are increasingly incorporating digital
technologies into their compositions and performances. Computational scientists
work in areas related to climate prediction, genomics, particle physics, neuroscience,
and drug discovery.
In this book, we will explore the fundamental problem solving techniques of
computer science, and discover how they can be used to model and solve a variety of
interdisciplinary problems. In this first chapter, we will provide an orientation and
lay out the context in which to place the rest of the book. We will further develop
all of these ideas throughout, so don’t worry if they are not all crystal clear at first.

1
2  What is computation?

mp3 music player

music recording sound

search engine
search terms
search results

Buxton Inn
313 E Broadway GPS device
Granville, OH 43023

address directions

Figure 1.1 Some examples of computational problems.

1.1 PROBLEMS AND ABSTRACTION


Every useful computation solves a problem of some sort. A problem is fundamentally
defined by the relationship between its input and its output, as illustrated in Fig-
ure 1.1. For each problem, we have an input entering on the left and a corresponding
output exiting on the right. In between, a computation transforms the input into a
correct output. When you listen to a song, the music player performs a computation
to convert the digital music file (input) into a sound pattern (output). When you
submit a web search request (input), your computer, and many others across the
Internet, perform computations to get you results (outputs). And when you use GPS
navigation, a device computes directions (output) based on your current position,
your destination, and its stored maps (inputs).
Inputs and outputs are probably also familiar to you from high school algebra.
When you were given an expression like

y = 18x + 31

or
f (x) = 18x + 31,
you may have thought about the variable x as a representation of the input and
y, or f (x), as a representation of the output. In this example, when the input is
x = 2, the output is y = 67, or f (x) = 67. The arithmetic that turns x into y is a
very simple (and boring) example of a computation.

Reflection 1.1 What kinds of problems are you interested in? What are their inputs
and outputs? Are the inputs and outputs, as you have defined them, sufficient to
define the problem completely?
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of The Egyptian
campaigns, 1882 to 1885
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The Egyptian campaigns, 1882 to 1885

Author: Charles Royle

Release date: December 31, 2012 [eBook #41744]


Most recently updated: October 23, 2024

Language: English

Credits: Produced by Adrian Mastronardi, Charlie Howard, and


the
Online Distributed Proofreading Team at
http://www.pgdp.net
(This file was produced from images generously made
available by The Internet Archive/American Libraries.)

*** START OF THE PROJECT GUTENBERG EBOOK THE EGYPTIAN


CAMPAIGNS, 1882 TO 1885 ***
Transcriber's note: On some devices, clicking on a map or
diagram will display it in more detail.
THE EGYPTIAN CAMPAIGNS.

THE EGYPTIAN CAMPAIGNS


1882 TO 1885.

NEW AND REVISED EDITION,


CONTINUED TO DECEMBER, 1899.

BY
CHARLES ROYLE,
Late of the Royal Navy,
Barrister-at-Law, Judge of the Egyptian Court of Appeal.

ILLUSTRATED BY MAPS AND PLANS.


LONDON
HURST AND BLACKETT, LIMITED
13, GREAT MARLBOROUGH STREET
1900.
ALL RIGHTS RESERVED
PREFACE.

In the new and revised Edition of "The Egyptian Campaigns," the


history of the military operations in Egypt has been brought down to
the present time, so as to include all the recent fighting in the
Soudan. This has been accompanied by a slight alteration in the title
of the Book, as well as by the elimination of such details contained
in the original work as are no longer of general interest. The space
thus gained has been utilized for the purpose of bringing before the
reader the chief events of a military character which have occurred
in the interval which has elapsed since the Book first appeared.
It has been the object of the Author to make the work in its
present form a complete narrative of the rise and fall of the Arabist
and Mahdist movements, as well as a history of England's
intervention in Egypt, this last a subject on which many persons
entertain somewhat vague and indistinct ideas.
C. R.
Cairo,
December, 1899.
CONTENTS.
CHAP. PAGE.
I. Egyptian Finance 1
II. Ismail Pasha 7
III. The Military Movement 12
IV. Triumph of the Army 17
V. Foreign Intervention 23
VI. Critical Position 32
VII. The Riots at Alexandria 44
VIII. The Alexandria Bombardment 60
IX. Observations on the Bombardment 75
X. The Day after the Bombardment 85
XI. Alexandria during the Bombardment 90
XII. Events on Shore 98
XIII. The Situation 106
XIV. Military Operations 114
XV. The Conference 120
XVI. The Porte and the Powers 127
XVII. Wolseley's Move to the Canal 131
XVIII. De Lesseps and the Canal 137
XIX. Seizure of the Suez Canal 144
XX. Tel-el-Mahuta to Mahsameh 153
XXI. Kassassin 159
XXII. Tel-el-Kebir 168
XXIII. Capture of Cairo and Collapse of the
Rebellion 180
XXIV. England and the Porte 193
XXV. Restoration of Tewfik and Exile of
Arabi 198
XXVI. The Soudan and the Mahdi 210
XXVII. Arrangements for the Future 220
XXVIII. Operations against the Mahdi 232
XXIX. The Destruction of Hicks' Army 243
XXX. Abandonment of the Soudan: Osman
Digna 250
XXXI. Baker's Defeat at El Teb 259
XXXII. Gordon's Mission 267
XXXIII. Souakim Expedition 272
XXXIV. Graham's Victory at El Teb 277
XXXV. Graham's Victory at Tamaai 290
XXXVI. The Gordon Relief Expedition 309
XXXVII. Progress to Dongola 315
XXXVIII. Advance to Korti 325
XXXIX. Stewart's Desert March 333
XL. The Battle of Abu Klea 341
XLI. The Advance on Metammeh 347
XLII. Gordon's Journals 355
XLIII. Wilson's Voyage to Khartoum 361
XLIV. The Fall of Khartoum 371
XLV. The Retreat from Gubat 386
XLVI. The Nile Column 393
XLVII. Wolseley and the Prosecution of the
Campaign 401
XLVIII. The Souakim Expedition of 1885 408
XLIX. The Attack on McNeill's Zeriba 416
L. Graham's Advance and Withdrawal from
the Eastern Soudan 430
LI. Evacuation 437
LII. Continuation 443
LIII. The Mahdist Invasion 447
LIV. Finance, the Suez Canal, and the Army
of Occupation 453
LV. The Eastern Soudan 459
LVI. The Nile Frontier 466
LVII. Wad-en-Nejumi and Collapse of the
Invasion 474
LVIII. The Eastern Soudan again 486
LIX. In Lower Egypt 494
LX. The Dongola Expedition 501
LXI. The Reconquest of Dongola 512
LXII. The Advance to Berber 519
LXIII. On the River—Kassala 524
LXIV. From the Nile to the Atbara 530
LXV. The Battle of the Atbara 541
LXVI. The Advance on Omdurman 551
LXVII. The Battle of Omdurman 559
LXVIII. The Capture of Omdurman 574
LXIX. Fashoda 584
LXX. Destruction of the Khalifa 590
Conclusion 595
THE EGYPTIAN CAMPAIGNS.
CHAPTER I.

EGYPTIAN FINANCE.

Towards the close of the year 1875, Ismail Pasha, then Khedive
of Egypt, had about got to the end of his resources. His liabilities on
loans, contracted either in his own name or in that of his
Government, amounted to £55,332,609; in addition to this there was
a "Floating Debt" of £21,334,960—and £1,000,000—due for the
expenses of the war with Abyssinia. The Treasury Bills were being
daily protested, the salaries of the Government officials were in
arrear, and everything pointed to impending bankruptcy.
This was the situation when Ismail sold to the British
Government the shares in the Suez Canal Company which he had
inherited from his predecessor, Said Pasha.1
By the transaction, which was due to the genius of the late Lord
Beaconsfield, England made an excellent investment of capital. She
also acquired an important interest in the great maritime highway to
India, and indirectly in Egypt herself.
Attentive observers regarded what had taken place as only a
prelude to a more intimate connection of England with Egyptian
affairs, and the financial mission of Mr. Cave, an important Treasury
official, undertaken about the same period, naturally strengthened
this impression, notwithstanding Lord Derby's declaration that
sending the mission to Egypt "was not to be taken to imply any
desire on the part of Her Majesty's Government to interfere in the
internal affairs of that country."
There is no reason to doubt the sincerity of the Foreign
Secretary in the matter. The policy of Lord Beaconsfield's Cabinet, as
well as that of Mr. Gladstone, which succeeded it, was originally one
of non-intervention, and it was only the force of circumstances which
led to its modification. England's first wish was that no Power should
interfere in Egypt; her second, that in the event of interference
becoming necessary, England should not be left out in the cold.
When this is borne in mind, the attitude which Her Majesty's
Ministers from time to time assumed in regard to Egyptian affairs
becomes comparatively intelligible.
In confirmation of the preceding, the reader will observe that,
although one of the causes which eventually led to England's action
in the valley of the Nile was her mixing herself up with questions of
Egyptian finance, all attempts to induce her to move in this direction
met for a long time with failure.
When Mr. Cave's report, and, later on, that of Messrs. Goschen
and Joubert, revealed the embarrassed condition of the country, and
the necessity for the adoption of the financial scheme set forth in
the Decrees of May and November, 1876, Her Majesty's Government
declined to take any part in the arrangement. They even refused to
nominate the Englishmen who were to fill the various posts created
by the Decrees.
The French, Italian and Austrian members of the Commission of
the Public Debt were nominated by their respective Governments as
early as May, 1876, but their British colleague up to the end of the
year remained unappointed. France, on the other hand, throughout
the whole of the negotiations, appears to have been singularly ready
to come to the front, and when in December, 1876, the Duke
Decazes, the French Minister of Foreign Affairs, was asked to
nominate one of the Controllers of Finance, he declared "that he felt
no difficulty whatever on the subject." Lord Derby, however,
persisted in his policy of abstention, and eventually the Khedive was
under the necessity of himself appointing the Englishmen required.
At last the financial scheme came into operation, and, combined
with other reforms, for some time seemed likely to secure to Egypt
and her creditors a fair share of the blessings intended. This,
however, was not destined to last. As early as June, 1877, it became
evident that the revenues set apart to meet the Interest and Sinking
Fund of the Public Debt were insufficient. In fact, the estimates on
which the Decrees were founded proved simply fallacious—a deficit
of no less than £820,000 appeared in the revenues assigned to the
service of the Unified Debt, and of £200,000 on those set apart for
the Privileged Debt. Moreover, there was strong reason to suppose
that considerable portions of the receipts were being secretly
diverted from their legitimate channel by Ismail and his agents.
At the same period serious difficulty arose in satisfying the
judgments obtained against the Government in the newly-
established Mixed Tribunals. These courts, having been instituted by
treaties with the Powers, partook largely of an international
character, and when the European creditors, on issuing execution,
found that it was resisted by force, they sought the aid of their
respective Consuls-General.
The Honourable H. C. Vivian, then British Consul-General in
Cairo, a diplomatist who took a prominent part in this stage of
Egypt's history, had, as England's representative, to remonstrate
with the Khedive. The advice which Mr. Vivian gave, that the
amounts of these judgments should be paid, was excellent, but,
under the circumstances, about as practical as if he had counselled
His Highness to take steps to secure an annual high Nile.
Early in 1878, when things were going from bad to worse, Mr.
Vivian wrote that the whole government of the country was thrown
out of gear by financial mismanagement, and that affairs were
becoming so entangled as to challenge the interference of foreign
Governments. This very sensible opinion was backed up by M.
Waddington, who had become French Minister of Foreign Affairs,
and who, addressing Lord Derby on the financial and political
situation, made the significant observation that if England and
France did not exert themselves at once, the matter would slip out
of their hands. This suggestion, pointing obviously to the probable
intervention of other Powers, was not without effect, and the British
Foreign Secretary in reply went a little further than he had yet done,
and stated that "Her Majesty's Government would be happy to co-
operate with that of France in any useful measure not inconsistent
with the Khedive's independent administration of Egypt."
This was followed by Mr. Vivian pressing upon the Khedive the
necessity for "a thorough and exhaustive inquiry into the finances of
the country."
This constituted a fresh departure in the policy of England with
regard to the Egyptian question, and, as will be seen, ultimately led
to that complete interference in Egyptian affairs which the British
Cabinet had so much desired to avoid.
Of course, Ismail had to yield, and the famous Commission of
Inquiry instituted by the Decree of 30th March, 1878, assembled in
Cairo under the presidency of Mr. (afterwards Sir C.) Rivers Wilson,
and revealed the most startling facts relating to the finances of
Egypt. The Commission had no easy task before it, and it only
attained its object through the dogged resolution of its chairman,
backed by the moral support of the representatives of the Powers.
At the outset, the late Cherif Pasha, the Khedive's Minister of
Foreign Affairs and of Justice, refused point-blank to obey the
Decree, and submit to be personally examined by the Commission.
As Cherif was a statesman who will be frequently referred to in
the following pages, it may be opportune to briefly describe him. He
was then about sixty years of age, and, like most of those who have
held the highest posts in Egypt, of Circassian origin. He was
amongst the favoured individuals who had been sent to France by
Mehemet Ali to be educated. He gradually passed through nearly
every post in the State with that facility which is so frequently seen
in Egypt, where a man is one day a station-master on the railway,
the next a Judge in the Tribunals, and eventually a Master of
Ceremonies, or a Cabinet Minister.
Cherif had pleasing manners, spoke French fluently, and was in
every respect a gentleman. A Mahomedan by religion, he was, from
an early period in Ismail's reign, a prominent character in Egyptian
history. He soon became a rival of Nubar Pasha (referred to further
on), and he and Nubar alternated as the Khedive's Prime Ministers
for many years.
Of a naturally indolent character, Cherif always represented the
laissez aller side of Egyptian politics. With an excellent temper, and a
supremely apathetic disposition, he was always willing to accept
almost any proposition, provided it did not entail upon him any
personal exertion, or interfere with his favourite pastime, a game of
billiards.
Cherif's notion in refusing to appear before the Commission was
of a two-fold character. Educated with Oriental ideas, and
accustomed to regard Europeans with suspicion, it is not unlikely
that he resented the appointment of the Commission as an
unwarrantable intrusion on the part of the Western Powers.
"Here," thought he, "were a number of people coming to make
disagreeable inquiries, and to ask indiscreet questions. Others might
answer them; he, for his part, could not, and for two reasons: first,
because he couldn't if he would; and second, because he wouldn't if
he could. Was he, at his time of life, to be asked to give reasons for
all he had done? It was ridiculous; all the world knew that he had no
reasons."2
Probably, also, Cherif had his own motives for not wishing to
afford too much information. Though enjoying a deservedly high
reputation for honesty, he belonged to what must be regarded as
the "privileged class" in the country. For years this class had
benefited by certain partial immunities from taxation, and these
advantages the work of the Commission threatened to do away with.
Further, Cherif's love of ease and comfort, and absence of energy,
indisposed him to give himself unnecessary trouble about anything
in particular. Be this as it may, Cherif, though expressing his
readiness to reply in writing to any communications which the
Commission might address to him, declined to do more.
The Decree, however, provided that every functionary of State
should be bound to appear before the Commission. This might have
placed a less astute Minister in a dilemma. Cherif at once evaded the
difficulty by resigning office, rightly calculating on again returning to
power when the Commission should have become a thing of the
past. Riaz Pasha, then second Vice-President of the Commission,
succeeded Cherif as Minister, and the inquiry proceeded without
him.3
It will not have escaped notice that in authorizing Rivers Wilson,
who held a high post in the Office of the National Debt, to sit on the
Commission, and in granting him leave of absence for the purpose,
the British Government had allowed itself to advance one stage
further in its Egyptian policy. The significance of the event was only
partially disguised by Lord Derby's cautious intimation that "the
employé of the British Government was not to be considered as
invested with any official character."
In April of the same year, whilst the Commission was still sitting,
it became evident that there would be a deficit of £1,200,000 in the
amount required to pay the May coupon of the Unified Debt. Further
influences were brought to bear, and Mr. Vivian was instructed to
join the French Consul-General in urging upon the Khedive the
necessity of finding the requisite funds at whatever cost to himself.
Ismail pointed out that this could only be done by ruinous sacrifices,
which he promised should nevertheless be made if it was insisted
on. The representatives of England and France remained firm, and
the bondholders got their money. By what means this was
accomplished it is needless to inquire. Rumours of frightful pressure
being put on the unfortunate fellaheen, of forced loans and other
desperate expedients, were prevalent in Cairo, and were probably
only too well founded. It is said that even the jewellery of the ladies
of Ismail's harem was requisitioned in order to make up the sum
required.
Meanwhile the inquiry proceeded.
It would require too much space to give at length the details of
the report which the Commission presented. Suffice it to say that it
showed confusion and irregularity everywhere. Taxes were collected
in the most arbitrary and oppressive manner, and at the most
unfavourable periods of the year. The land tenures were so arranged
that the wealthier proprietors evaded a great portion of the land tax,
and the corvée, or system of forced labour, was applied in a way
which was ruinous to the country. Further, the Khedive and his family
had amassed, at the expense of the State, colossal properties,
amounting, in fact, to as much as one-fifth of the whole cultivable
land of Egypt, and this property the Commission declared ought to
be given up. On every side the most flagrant abuses were shown to
prevail. In conclusion, it was found that the arrangements made by
the Financial Decrees of 1876 could not possibly be adhered to, and
that a fresh liquidation was inevitable.
Ismail, after every effort to make better terms for himself,
yielded to Rivers Wilson's requisitions, and accepted the conclusions
of the Commission. He acquiesced with as good grace as he could in
making over to the State the landed property of himself and family.
He went even further, and in August, 1878, approved the formation
of a Cabinet under the presidency of Nubar Pasha, with Rivers
Wilson as Minister of Finance and M. de Blignières (the French
member of the Commission of the Public Debt) as Minister of Public
Works. At the same time, as if to show Europe that he had seriously
entered on the path of reform, the Khedive proclaimed his intention
to renounce personal rule and become a Constitutional sovereign,
governing only through his Council of Ministers.
CHAPTER II.

ISMAIL PASHA.

Any history of Egyptian affairs at the time of the events referred


to in the present chapter would be incomplete without a sketch of
Ismail Pasha himself. He was then forty-six years of age, short in
stature, and heavily and squarely built. He was corpulent in figure,
of dark complexion, and wore a reddish brown beard closely clipped.
With one eye startlingly bright and the other habitually almost
closed, he gave one the idea of a man of more than ordinary
intelligence.
Speaking French fluently, and possessed of a peculiarly
fascinating manner, Ismail exercised an almost mesmeric influence
on those who came in contact with him. His business capacity was
unbounded, and not the smallest detail, from the purchase of a coal
cargo to the sale of a year's crop of sugar, was carried out without
his personal direction. He was entitled to the denomination of
Merchant Prince more than any one who ever bore the title,
combining the two characters profitably for a long time, but in
attempting to add to them that of a financier also he ended by
wrecking his country.
The three great passions of Ismail were, his ambition to render
Egypt independent of the Porte, his desire to accumulate landed
property, and his mania for building palaces. His prodigality was
unbounded, and as a result the indebtedness of Egypt was raised in
fifteen years from £3,292,000, at which his predecessor left it, to
over £90,000,000 at the time now referred to.
To do Ismail justice, it must be admitted that a large part of this
money was spent in the construction of railways, canals, and other
improvements, and in beautifying Cairo, which it was his aim to
convert into a sort of Oriental Paris. But after allowing for all this,
and for the two millions sterling spent in the fêtes which attended
the opening of the Suez Canal, there is still a large balance left
unaccounted for.
One of the great defects of Ismail's character was his absolute
insincerity. When his reckless administration had brought his country
to the brink of ruin, he instituted the system of financial control set
forth in the Decrees of 1876. It must not be supposed that he ever
meant that the system should be carried into effect, or at most that
it should be more than a temporary expedient. When he
promulgated reforms and enlisted a number of Europeans in his
service, did he intend that the reforms should become realities, or
that the European officials should exercise the functions nominally
intrusted to them? Not for an instant. All that he desired was to
throw dust in the eyes of Europe. For a while he succeeded, but it
was not to last. After a time it dawned on the Powers that they were
being played with, and from that moment Ismail's downfall was
assured.
In nominally transforming himself into a Constitutional ruler,
Ismail was only following out his habitual policy. The change, at any
rate, looked well on paper. It would, he expected, possess a further
advantage—Ismail, by his personal rule, had brought Egypt to the
brink of ruin, and by posing as a Constitutional Sovereign, he hoped
to transfer his responsibility to his ministers.
The nomination of Rivers Wilson to the post of Egyptian Minister
of Finance was so unprecedented an event that it required all the
care of the Marquis of Salisbury, who had now succeeded Lord
Derby, to attenuate its political importance. To save appearances it
was arranged that Her Majesty's Ministers should do nothing more
than give their consent to the appointment.
As a consequence of the installation of Constitutional
government, with European Ministers in the Cabinet, the English and
French Controllers were deemed unnecessary, and the Dual Control
was declared suspended. On the adoption of the new order of
things, a hint was given to the Khedive that Her Majesty's
Government relied on his steady support being given to the new
Cabinet, and that the position of himself and his Dynasty might
become seriously compromised in the event of a contrary course
being adopted.
It would have been well for the Khedive had he taken the advice
given. Unfortunately, he was too much steeped in Eastern intrigue,
and too fond of the authority which he had nominally surrendered,
to bend to the new order of things.4
The earliest symptom of this was the military outbreak which
took place in Cairo on the 18th February, 1879, when 400 officers
and 2,000 discharged soldiers mobbed Nubar Pasha and the
European members of his Cabinet at the Ministry of Finance. The
ostensible grievance was the non-payment of their salaries; the real
one was the reduction in the army, a measure which had been
forced on the Khedive by his new advisers. Both Nubar and Wilson
were actually assaulted, and the cry of "Death to the Christians" was
raised. What further events might have taken place it is hard to say,
but, all at once, Ismail personally appeared on the scene, and as if
by magic order was restored.
Everything tended to show that Ismail himself had arranged this
little comedy; but be this as it may, he speedily took advantage of it
to inform the Consuls-General that the new state of things was a
failure, and that he could no longer retain his position without either
power or authority. Finally he declared that unless a change were
made he would not be answerable for the consequences. This was
followed by the resignation of his Prime Minister, Nubar, and the
despatch of British and French vessels of war to Alexandria.
The progress made in the direction of British interference in
Egyptian affairs will not fail to strike the reader.
Ismail's motive in bringing about the military disturbance of the
18th February was to demonstrate, in the same manner as Arabi
Pasha did later on, that he was the only real power in the country. In
doing this, however, he played a dangerous game, and one which
shortly after cost him his vice-regal throne.
For the moment, a modus vivendi was found in the appointment
of his son Prince Tewfik (afterwards Khedive) as Prime Minister, vice
Nubar, and the Western Powers accepted the solution, at the same
time giving Ismail another warning, namely, that any further
disturbance would be regarded as the result of his action, and the
consequences to him would be very serious.
The financial difficulties of the country now became so grave,
that a Decree suspending payment of the interest of the Debt was
issued at the end of March, by the advice of the Ministers. Then
Ismail all at once turned round and declared that the measure was
unnecessary, and proposed a financial scheme of his own. How far
this could be reconciled with his declaration that he was a
Constitutional ruler is not clear. This event was followed by the
arbitrary dismissal of his Ministers and the formation of a purely
native Cabinet under Cherif Pasha. So secretly had the change been
brought about, that the former Ministers only discovered it when, on
going to their offices, they found their places already occupied by
their successors.
This veritable coup d'état placed the English and French
representatives in a position of some difficulty. On the one hand, the
right of the Khedive to change his Ministers, even under the
reformed regime, could not be contested; on the other, the change
was of so radical a nature, and so much opposed to the moral
obligations which he had contracted with the Western Powers, that it
could hardly be permitted. The two Consuls-General therefore waited
on the Khedive, and plainly told him that the precipitate dismissal of
Ministers whose services he had solicited from the Governments of
England and France constituted an act of grave discourtesy, and
warned him of the necessity of adopting the course which they
recommended to him. Ismail had by this time become so used to
warnings of this character, that the intimation produced but little
effect. On the contrary, he at once ordered the army to be increased
to 60,000 men, and followed this up by a Decree of the 22nd April,
1879, reducing the interest of the Debt, and otherwise modifying the
arrangements made by the Financial Decrees of 1876.
It was scarcely to be expected that Ismail's action, conceived in
defiance of all Europe, would be tolerated, but it might,
nevertheless, but for another circumstance, namely, the continued
non-payment of the sums due on the judgments of the Tribunals.
Both England and France addressed strong representations to the
Porte on the subject. Though anxious that Ismail should be taken to
task, neither Power was prepared to go so far as to demand his
deposition. At length the hands of both were forced by a statesman
who had more will and less hesitation, namely, Prince Bismarck. He
plainly intimated that if England and France did not demand Ismail's
removal, Germany would. This decided the matter, and the two
Powers, seeing the danger of the matter being taken out of their
hands, summoned up sufficient resolution to apply to the Sultan for
the removal of the man who had so long trifled with them.
Meanwhile intrigues of all kinds had been going on at
Constantinople. Ismail was privately sounded on the subject, and
was given his choice, either to abdicate or to be deposed. He was
reluctant to come to any decision, and in this he was strengthened
by the information which he received from his agent, Ibraim Pasha,
at Constantinople. The latter, from time to time, misled his
unfortunate principal. When things looked at their very worst, Ibraim
repeatedly assured Ismail that if only sufficient money were
transmitted to Stamboul, everything would yet be made right.
Animated by this hope, the deluded Khedive sent fabulous sums to
the Sultan, up to the moment when the latter threw him over. It is
not, therefore, to be wondered at, that, when the storm actually
burst, and the news of his deposition arrived, he was simply
thunderstruck. At four in the morning of the 25th June, 1879, the
English and French Consuls-General sought out Cherif Pasha, and
made him accompany them to the Palace, and after some difficulty
succeeded in finding Ismail. They then communicated to him
despatches from Constantinople, and insisted on his abdication as
the only means of saving his Dynasty. Ismail at first refused point-
blank, but later on, he qualified his refusal by stating that he would
only yield to a formal order from the Porte itself.
The dénouement was not far off, for, only a few hours later, a
telegram arrived, addressed to "Ismail Pasha, late Khedive of Egypt,"
informing him that the Sultan had deposed him, and nominated his
son Tewfik in his place.
There was nothing for the fallen ruler to do but to bow to the
inevitable, although he did not acquiesce with good grace. He
showed himself most exigeant as to the conditions on which he
would consent to leave Egypt. He wished for a large sum in ready
money. He wanted Smyrna selected as his place of residence. He
wished to take with him all his followers, including a harem of at
least three hundred women. He also demanded that an Egyptian
steamer should be placed at his disposal. In fact, he asked so many
things that the Consuls-General were at their wits' end to know what
to do. The great object was to get rid of him at any price, and he
was, in effect, told that he could have almost anything he wanted if
he would only go at once.
Eventually the parties came to terms, Ismail was given the
money he demanded, he was allowed to choose Naples in place of
Smyrna as a residence, and at the end of the month, accompanied
by seventy ladies of his harem, he quitted Alexandria in the Khedivial
yacht "Maharoussa" under a royal salute from the batteries and ships
of war.5
CHAPTER III.

THE MILITARY MOVEMENT.

No sooner was Egypt rid of Ismail Pasha, than the Firman of


investiture of Tewfik was solemnly read at the Citadel in Cairo with
great state and ceremony.
The Powers having insisted on the restoration of the Control,
Major Baring (afterwards Lord Cromer) and M. de Blignières were
appointed Controllers-General by the English and French
Governments respectively, on the 4th September. Riaz Pasha, on the
23rd, became Prime Minister.
Riaz is a statesman who has played an important part in Egypt
for many years, and is therefore deserving of a passing notice. He is
of Circassian family and of Hebrew extraction, possesses a strong
will, tenacious perseverance, and business-like habits, and he has
always been remarkable for his independence. Riaz is a master of
detail, and has all the ins and outs of Egyptian administration at his
fingers' ends, and he was, therefore, all the more fitted for taking
public affairs in hand at this period. His experience as President of
the Council of Ministers in past times rendered his services especially
valuable. Gifted with natural foresight, he was shrewd enough to see
that, when the Control was re-established, England and France
seriously intended to take Egyptian affairs in hand, and he accepted
the situation accordingly. This led him to work cordially with the
Controllers, with the happy result that, during the two years that his
Ministry lasted, Egypt attained an unprecedented degree of
prosperity.
In April, 1880, what was styled the Commission of Liquidation
was appointed, and under its advice the Public Debt was subjected
to various modifications, and other financial changes were made,
including a reduction of taxation and other reforms.
How long this pleasant state of things would have lasted it is
impossible to say, had not trouble arisen in another direction, and
the military revolt under Arabi supervened and upset all previous
calculations.
In order to understand the nature and causes of this movement,
it is necessary to know something of the Egyptian military
organization at the time referred to. The army, which had achieved
such great things under Mehemet Ali, had gradually declined under
his successors, and when Ismail came to power was represented by
a total force of 10,000 fighting men. Ismail raised the number to
45,000, but the Firman of Tewfik's investiture limiting the number to
18,000, the force had to be reduced to that number. The soldiers
were all brought into the ranks by the system of conscription. Those
recruited from the Soudan were men possessed of considerable
endurance and warlike qualities, but those taken from the other
districts, that is, the ordinary fellah or agricultural class, had no taste
for war. This is not to be wondered at when the character and habits
of the latter are considered. The Egyptian fellah is a type in himself.
Possessed of no national pride or patriotic aspirations, he cares
nothing about politics, and still less for fighting. All that he asks is to
be let alone, to till in peace and quietness his little plot of land on
the banks of his beloved Nile. Do not vex him too much with forced
labour, or tax him beyond his means, and he remains peaceful and
fairly law-abiding from the moment of his birth till the day comes for
him to be carried out to the little cemetery, the white tombs of which
brighten the borders of the desert.
In the preceding observations the Egyptian soldier is spoken of
as he was at the period under consideration. What he is capable of
becoming, when placed under English officers, and properly trained
under humane and just treatment, subsequent events will show.
Amongst the soldiers at the time of the occurrence of Arabi's
outbreak there was a fair amount of subordination, and but little
jealousy prevailed. Amongst the officers, however, the state of things
was entirely different. The majority of them were of Egyptian or
fellah origin, whilst the others were of Turkish or Circassian
extraction. The latter, as belonging to the same race as the reigning
family, naturally constituted the dominant caste; when there was a
campaign in the Soudan, or any other unpleasant duty to be taken in
hand, the fellah officers were selected for it. When, on the other
hand, it was a question of taking duty in Cairo or Alexandria, the
Circassians were employed. Naturally, a good deal of jealousy was
thus created, though, as long as Ismail was in power, it was not
openly manifested, and discipline was maintained, except where it
answered that ruler's purpose (as in the case of the demonstration
against Nubar and Rivers Wilson) that it should be otherwise. With
the young and inexperienced Tewfik, however, things were different
—a spirit of insubordination developed itself, and the two sets of
officers entered upon a struggle for the mastery.
Among the prominent fellah officers was a certain Ali Fehmi, who
was a favourite of the Khedive, and in command of the Guards at
the Palace. In this capacity he was frequently called on to convey
orders to Osman Pasha Rifki, the Minister of War. Osman was a
Circassian, and felt hurt at receiving orders from a fellah officer. By
what means the change was effected is uncertain, but eventually Ali
fell into disfavour, and became one of a group of discontented
officers belonging to the same class. There were two others, Abdel-
el-Al, and Ahmed Arabi, subsequently known as Arabi Pasha. These
three, afterwards known as "The Colonels," were joined by
Mahmoud Sami Pasha, a politician, and, thus associated, they
formed the leaders of what began to be known as "The National
Party."
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like