100% found this document useful (1 vote)
15 views

PDF Problems on Algorithms: A Comprehensive Exercise Book for Students in Software Engineering 1st Edition Habib Izadkhah download

The document promotes the ebook 'Problems on Algorithms: A Comprehensive Exercise Book for Students in Software Engineering' by Habib Izadkhah, which contains approximately 2500 problems to aid in learning algorithm design and analysis. It is intended for students, educators, and practicing programmers, providing problems across various difficulty levels and covering essential topics in algorithms. The ebook is available for download on ebookmeta.com, along with several other recommended digital products.

Uploaded by

hinsajunni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
15 views

PDF Problems on Algorithms: A Comprehensive Exercise Book for Students in Software Engineering 1st Edition Habib Izadkhah download

The document promotes the ebook 'Problems on Algorithms: A Comprehensive Exercise Book for Students in Software Engineering' by Habib Izadkhah, which contains approximately 2500 problems to aid in learning algorithm design and analysis. It is intended for students, educators, and practicing programmers, providing problems across various difficulty levels and covering essential topics in algorithms. The ebook is available for download on ebookmeta.com, along with several other recommended digital products.

Uploaded by

hinsajunni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Problems on Algorithms: A Comprehensive Exercise


Book for Students in Software Engineering 1st
Edition Habib Izadkhah

https://ebookmeta.com/product/problems-on-algorithms-a-
comprehensive-exercise-book-for-students-in-software-
engineering-1st-edition-habib-izadkhah/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Calculus for Engineering Students: Fundamentals, Real


Problems, and Computers Jesus Martin Vaquero

https://ebookmeta.com/product/calculus-for-engineering-students-
fundamentals-real-problems-and-computers-jesus-martin-vaquero/

ebookmeta.com

Tidy First?: A Personal Exercise in Empirical Software


Design 1st Edition Kent Beck

https://ebookmeta.com/product/tidy-first-a-personal-exercise-in-
empirical-software-design-1st-edition-kent-beck/

ebookmeta.com

Lab reports and projects in sport and exercise science a


guide for students Second Edition Mike Price

https://ebookmeta.com/product/lab-reports-and-projects-in-sport-and-
exercise-science-a-guide-for-students-second-edition-mike-price/

ebookmeta.com

Processing for Android: Create Mobile, Sensor-aware, and


XR Applications Using Processing, 2nd Edition Andrés
Colubri
https://ebookmeta.com/product/processing-for-android-create-mobile-
sensor-aware-and-xr-applications-using-processing-2nd-edition-andres-
colubri/
ebookmeta.com
The Invisible Hand of Cancer: The Complex Force of
Socioeconomic Factors in Oncology Today 1st Edition Carola
Schmidt
https://ebookmeta.com/product/the-invisible-hand-of-cancer-the-
complex-force-of-socioeconomic-factors-in-oncology-today-1st-edition-
carola-schmidt/
ebookmeta.com

Change 1st Edition Allie York

https://ebookmeta.com/product/change-1st-edition-allie-york/

ebookmeta.com

The Routledge Handbook of Philosophy of Agency 1st Edition


Luca Ferrero (Editor)

https://ebookmeta.com/product/the-routledge-handbook-of-philosophy-of-
agency-1st-edition-luca-ferrero-editor/

ebookmeta.com

Damage Modeling of Composite Structures: Strength,


Fracture, and Finite Element Analysis 1st Edition Pengfei
Liu
https://ebookmeta.com/product/damage-modeling-of-composite-structures-
strength-fracture-and-finite-element-analysis-1st-edition-pengfei-liu/

ebookmeta.com

The Cooking with Kids Cookbook 1st Edition Lynn Walters

https://ebookmeta.com/product/the-cooking-with-kids-cookbook-1st-
edition-lynn-walters/

ebookmeta.com
Rayner Hoff The Life of a Sculptor 1st Edition Deborah
Beck

https://ebookmeta.com/product/rayner-hoff-the-life-of-a-sculptor-1st-
edition-deborah-beck/

ebookmeta.com
Habib Izadkhah

Problems
on Algorithms
A Comprehensive Exercise Book
for Students in Software Engineering
Problems on Algorithms
Habib Izadkhah

Problems on Algorithms
A Comprehensive Exercise Book for Students
in Software Engineering
Habib Izadkhah
Faculty of Mathematics, Statistics,
and Computer Science
University of Tabriz
Tabriz, Iran

ISBN 978-3-031-17042-3 ISBN 978-3-031-17043-0 (eBook)


https://doi.org/10.1007/978-3-031-17043-0

© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature
Switzerland AG 2022
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether
the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse
of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and
transmission or information storage and retrieval, electronic adaptation, computer software, or by similar
or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

Learning is a mysterious process. No one can say what the precise rules of learning
are. However, it is an agreed upon fact that the study of good examples plays a
fundamental role in learning. In the short span of a semester, it is difficult to cover
enough material to give students the confidence that they have mastered some portion
of the subject. Consequently, it is well known that problem-solving helps one acquire
routine skills in designing and analyzing of algorithms. The salient features of the
theory are presented in class along with a few examples, and then the students are
expected to teach themselves the finer aspects of the theory through worked examples.
The book aims at presenting a lot of problems, aiming to improve the learning process
of students.
With approximately 2500 problems, this supplement provides a collection of
practical problems on the basic and advanced data structures, design, and analysis
of algorithms. To make this book suitable for self-instruction, about one-third of the
algorithms are supported by solutions, and some other are supported by hints and
comments. This book is intended for students wishing to deepen their knowledge
of algorithm design in an undergraduate or beginning graduate class on algorithms,
for those teaching courses in this area, for use by practicing programmers who wish
to hone and expand their skills, and as a self-study text for graduate students who
are preparing for the qualifying examination on algorithms for a Ph.D. program in
Computer Science or Computer Engineering. About all, it’s a good source for exam
problems for those who teach algorithms and data structure. The format of each
chapter is just a little bit of instruction followed by lots of problems.
This book is intended to augment the problem sets found in any standard algorithm
textbook. In this book, three levels of difficulty, simple or relatively simple, moderate
level or slightly difficult. This book, also, emphasizes the creative aspects of algorithm
design.
This book
• begins with four chapters on background material that most algorithm instructors
would like their students to have mastered before setting foot in an algorithm class.

v
vi Preface

The introductory chapters include mathematical induction, complexity notations,


recurrence relations, and basic algorithm analysis methods.
• provides many problems on basic and advanced data structures including basic
data structures (arrays, stack, queue, and linked list), hash, tree, search, and sorting
algorithms.
• provides many problems on algorithm design technique: divide and conquer,
dynamic programming, greedy algorithms, graph algorithms, and backtracking
algorithms.
• is rounded out with chapter on NP-completeness.

Tabriz, Iran Habib Izadkhah


Contents

1 Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Summations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Inequalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3 Floors and Ceilings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.4 Divisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.5 Postage Stamps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.6 Fibonacci Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.7 Binomial Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.8 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Growth of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1.1 Orders of Growth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.2 Useful Theorems Involving the Asymptotic
Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.1.3 Applying Limits for Analyzing Orders of Growth . . . . 44
2.1.4 Iterated Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.2.1 Size of Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.2.2 True or False? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.2.3 Rank the Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2.4 Prove Using the Definition of Notation . . . . . . . . . . . . . . 52
2.2.5 Find Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.2.6 Property of Notations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.2.7 More Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vii
viii Contents

3 Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.1.1 Catalog of Recurrence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.1.2 Solving Recurrence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.1.3 Linear Homogeneous Recurrences . . . . . . . . . . . . . . . . . 95
3.1.4 Nonhomogeneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.1.5 Recurrence Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.1.6 Master Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.2.1 The Iteration Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.2.2 Homogeneous Linear Recurrence Equation
with Constant Coefficients . . . . . . . . . . . . . . . . . . . . . . . . 110
3.2.3 Nonhomogeneous Recurrences Equation
with Constant Coefficients . . . . . . . . . . . . . . . . . . . . . . . . 112
3.2.4 General Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.2.5 Changing Variables in Recurrence Relations . . . . . . . . . 115
3.2.6 More Difficult Recurrences . . . . . . . . . . . . . . . . . . . . . . . 116
3.2.7 Recurrence with Full History . . . . . . . . . . . . . . . . . . . . . . 118
3.2.8 Recurrence with Floors and Ceilings . . . . . . . . . . . . . . . 119
3.2.9 The Master Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.2.10 Recursion Tree Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.2.11 Recurrence Relations with More Than One
Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.2.12 Generating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4 Algorithm Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
4.2.1 Iterative Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
4.2.2 What is Returned? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.2.3 Recursive Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.2.4 Recurrence Relations for Recursive Functions . . . . . . . 165
4.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5 Basic Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1.1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
5.1.2 Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.1.3 Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.1.4 Linked List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
5.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.2.1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
5.2.2 Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.2.3 Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.2.4 Linked List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
5.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Contents ix

6 Hash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
6.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
6.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
6.2.1 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
6.2.2 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
6.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
7 Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.2.1 Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.2.2 Binary Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
7.2.3 Binary Search Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
7.2.4 Heap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
7.2.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
7.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
8 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.2.1 Preliminary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.2.2 Linear Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
8.2.3 Binary Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
8.2.4 Ternary Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
8.2.5 Binary Search Tree (BST) . . . . . . . . . . . . . . . . . . . . . . . . 275
8.2.6 Fibonacci Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
8.2.7 Exponential Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
8.2.8 Interpolation Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
8.2.9 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
8.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
9 Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
9.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
9.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
9.2.2 Selection Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
9.2.3 Bubble Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
9.2.4 Insertion Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
9.2.5 Heapsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
9.2.6 Shell Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
9.2.7 Introsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
9.2.8 Tim Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
9.2.9 Binary Tree Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
9.2.10 Counting Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
9.2.11 Radix Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
9.2.12 Mergesort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
x Contents

9.2.13 QuickSort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309


9.2.14 Shell Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
9.2.15 Cycle Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
9.2.16 Library Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
9.2.17 Strand Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
9.2.18 Cocktail Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
9.2.19 Comb Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
9.2.20 Gnome Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
9.2.21 Bogo Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
9.2.22 Sleep Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
9.2.23 Pigeonhole Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
9.2.24 Bucket Sort (Uniform Keys) . . . . . . . . . . . . . . . . . . . . . . . 322
9.2.25 Bead Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
9.2.26 Pancake Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
9.2.27 Odd-Even Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
9.2.28 Stooge Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
9.2.29 Permutation Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
9.2.30 Recursive Bubble Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
9.2.31 Binary Insertion Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
9.2.32 Recursive Insertion Sort . . . . . . . . . . . . . . . . . . . . . . . . . . 330
9.2.33 Tree Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
9.2.34 Cartesian Tree Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
9.2.35 3-Way Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
9.2.36 3-Way Mergesort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
9.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
10 Divide and Conquer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
10.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
10.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
10.2.1 Preliminary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
10.2.2 Binary Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
10.2.3 Finding Minimum and Maximum . . . . . . . . . . . . . . . . . . 358
10.2.4 Greatest Common Divisor (gcd) . . . . . . . . . . . . . . . . . . . 362
10.2.5 Mergesort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
10.2.6 Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
10.2.7 Finding the Median . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
10.2.8 Integer Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
10.2.9 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
10.2.10 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
10.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
11 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
11.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
11.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
11.2.1 Preliminary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
11.2.2 Mathematics Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Contents xi

11.2.3 All-Pairs Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . 406


11.2.4 Matrix Chain Multiplication . . . . . . . . . . . . . . . . . . . . . . . 410
11.2.5 The Knapsack Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
11.2.6 Optimal Binary Search Tree . . . . . . . . . . . . . . . . . . . . . . . 412
11.2.7 Longest Common Subsequence (LCS) . . . . . . . . . . . . . . 413
11.2.8 String Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
11.2.9 Traveling Salesman Problem (TSP) . . . . . . . . . . . . . . . . . 415
11.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
12 Greedy Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
12.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
12.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
12.2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
12.2.2 Activity Selection Problem . . . . . . . . . . . . . . . . . . . . . . . . 427
12.2.3 Minimum Spanning Tree . . . . . . . . . . . . . . . . . . . . . . . . . 429
12.2.4 Huffman Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
12.2.5 Dijkstra’s Shortest Path Algorithm . . . . . . . . . . . . . . . . . 446
12.2.6 Job Sequencing Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 450
12.2.7 Knapsack Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
12.2.8 Travelling Salesman Problem . . . . . . . . . . . . . . . . . . . . . . 453
12.2.9 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
12.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
13 Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
13.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
13.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
13.2.1 Preliminary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
13.2.2 Graph Traversal Techniques . . . . . . . . . . . . . . . . . . . . . . . 473
13.2.3 Applications of DFS/BFS . . . . . . . . . . . . . . . . . . . . . . . . . 474
13.2.4 Graph Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
13.2.5 Topological Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
13.2.6 Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
13.2.7 Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
13.2.8 Maximum Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
13.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
14 Backtracking Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
14.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
14.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
14.2.1 The Knight’s Tour Problem . . . . . . . . . . . . . . . . . . . . . . . 488
14.2.2 N-Queen Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
14.2.3 The Sum-of-Subsets Problem . . . . . . . . . . . . . . . . . . . . . . 489
14.2.4 M-Coloring Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
14.2.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
14.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
xii Contents

15 P, NP, NP-Complete, and NP-Hard Problems . . . . . . . . . . . . . . . . . . . . 497


15.1 Lecture Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
15.1.1 Polynomial Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
15.1.2 NP Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
15.1.3 NP-Complete Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
15.1.4 NP-Hard Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
15.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
15.2.1 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
15.2.2 Classification of Problems: Class P and NP . . . . . . . . . . 502
15.2.3 Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
15.3 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
Chapter 1
Mathematical Induction

Abstract Mathematical induction is a technique for proving results or establishing


statements for natural numbers. This chapter illustrates the method through a variety
of examples and provides 50 exercises on mathematical induction. To this end, this
chapter provides exercises on summations, inequalities, floors and ceilings, divisi-
bility, postage stamps, Fibonacci numbers, binomial coefficients, and several other
problems.

1.1 Lecture Notes

The principle of mathematical induction is used to prove that a given statement


(formula, equality, inequality, and more) is true for all positive integer numbers
greater than or equal to some integer N.
Let P(n) denotes the statement, where n is a positive integer. Proof consists of two
steps:
Step 1: We first prove that the statement P(n) is true for the smallest possible value
of the positive integer n.
Step 2: We assume that P(k) is true and prove that P(k+1) is also true.

Example 1 Using mathematical induction, prove that

1 + 2 + 3 + · · · + n = n(n + 1)/2

is true for all positive integers n.

Solution:
Let the statement P(n) be

1 + 2 + 3 + · · · + n = n(n + 1)/2

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 1


H. Izadkhah, Problems on Algorithms,
https://doi.org/10.1007/978-3-031-17043-0_1
2 1 Mathematical Induction

STEP 1: We first show that P(1) is true.


Left Side = 1
Right Side = 1(1 + 1) / 2 = 1
Both sides of the statement are equal hence P(1) is true.

STEP 2: We now assume that P(k) is true

1 + 2 + 3 + · · · + k = k(k + 1)/2

and show that P(k + 1) is true by adding k + 1 to both sides of the above statement

1 + 2 + 3 + · · · + k + (k + 1) = k(k + 1)/2 + (k + 1)

= (k + 1)(k/2 + 1)

= (k + 1)(k + 2)/2

The last statement may be written as

1 + 2 + 3 + · · · + k + (k + 1) = (k + 1)(k + 2)/2

which is the statement P(k + 1).

Example 2 Using mathematical induction, prove that

12 + 22 + 32 + · · · + n 2 = n(n + 1)(2n + 1)/6

is true for all positive integers n.

Solution:
Let the statement P(n) be

12 + 22 + 32 + · · · + n 2 = n(n + 1)(2n + 1)/6

STEP 1: We first show that P(1) is true. Left Side = 12 = 1


Right Side = 1(1 + 1) (2×1 + 1)/ 6 = 1
Both sides of the statement are equal hence P(1) is true.

STEP 2: We now assume that P(k) is true

12 + 22 + 32 + · · · + k 2 = k(k + 1)(2k + 1)/6

and show that P(k + 1) is true by adding (k + 1)2 to both sides of the above statement

12 + 22 + 32 + · · · + k 2 + (k + 1)2 = k(k + 1)(2k + 1)/6 + (k + 1)2


1.1 Lecture Notes 3

Set common denominator and factor k + 1 on the right side

= (k + 1)[k(2k + 1) + 6(k + 1)]/6

Expand k(2k + 1) + 6(k + 1)

= (k + 1)[2k 2 + 7k + 6]/6

Now factor 2k2 + 7k + 6.

= (k + 1)[(k + 2)(2k + 3)]/6

We have started from the statement P(k) and have shown that

12 + 22 + 32 + · · · + k 2 + (k + 1)2 = (k + 1)[(k + 2)(2k + 3)]/6

which is the statement P(k + 1).

Example 3 Using mathematical induction, prove that for any positive integer num-
ber n
n 3 + 2n is divisible by 3

Solution:
Let the statement P(n) be

n 3 + 2n is divisible by 3

STEP 1: We first show that P(1) is true. Let n = 1 and calculate n 3 + 2n

13 + 2(1) = 3

3 is divisible by 3. Hence P(1) is true.

STEP 2: We now assume that P(k) is true k 3 + 2k is divisible by 3 is equivalent to


k 3 + 2k = 3M, where M is a positive integer.
We now consider the algebraic expression (k + 1)3 + 2(k + 1); expand it and group
like terms
(k + 1)3 + 2(k + 1) = k 3 + 3k 2 + 5k + 3

= [k 3 + 2k] + [3k 2 + 3k + 3]

= 3M + 3[k 2 + k + 1] = 3[M + k 2 + k + 1]

Hence (k + 1)3 + 2(k + 1) is also divisible by 3 and therefore statement P(k + 1) is


true.
Another Random Document on
Scribd Without Any Related Topics
with the Tilneys of Norfolk, or with the Nauntons shew where his
ancestors had seven hundred pounds a year before the conquest,”1
he was, and with as much, or perhaps more reason, contented with
his parentage. Indeed his family feeling was so strong, that, if he
had been of an illustrious race, pride, he acknowledged, was the sin
which would most easily have beset him; though on the other hand,
to correct this tendency, he thought there could be no such
persuasive preachers as old family portraits, and old monuments in
the family church.
1 FULLER.

He was far however from thinking that those who are born to all the
advantages, as they are commonly esteemed, of rank and fortune,
are better placed for the improvement of their moral and intellectual
nature, than those in a lower grade. “Fortunatos nimium sua si bona
nôrint,” he used to say of this class, but this is a knowledge that they
seldom possess; and it is rare indeed to find an instance in which
the high privileges which hereditary wealth conveys are understood
by the possessors, and rightly appreciated and put to their proper
use. The one, and the two talents are

Oh! bright occasions of dispensing good,


How seldom used, how little understood!2

in general more profitably occupied than the five; the five indeed are
not often tied up in a napkin, but still less often are they faithfully
employed in the service of that Lord from whom they are received in
trust, and to whom an account of them must be rendered.
2 COWPER.

“A man of family and estate,” said Johnson, “ought to consider


himself as having the charge of a district over which he is to diffuse
civility and happiness.”—Are there fifty men of family and estate in
the Three Kingdoms who feel and act as if this were their duty?—Are
there five and forty?—Forty?—Thirty?—Twenty?—Or can it be said
with any probability of belief that “peradventure Ten shall be found
there?”

—in sangue illustre e signorile,


In uom d'alti parenti al mondo nato,
La viltà si raddoppia, e più si scorge
Che in coloro il cui grado alto non sorge.3

3 TASSO RINALDO.

Here in England stood a village, within the memory of man,—no


matter where,—close by the Castle of a noble proprietor,—no matter
who:

il figlio
Del tale, ed il nipote del cotale,
Natò per madre della tale.4

It contained about threescore houses, and every cottager had


ground enough for keeping one or two cows. The noble proprietor
looked upon these humble tenements as an eye-sore; and one by
one as opportunity offered, he purchased them, till at length he
became owner of the whole, one field excepted, which belonged to
an old Quaker. The old man resisted many offers, but at last he was
induced to exchange it for a larger and better piece of land in
another place. No sooner had this transaction been completed, than
the other occupants who were now only tenants at will, received
notice to quit; the houses were demolished, the inclosures levelled,
hearthsteads and homesteads, the cottage garden and the cottage
field disappeared, and the site was in part planted, in part thrown
into the park. The Quaker, who unlike Naboth, had parted with the
inheritance of his fathers was a native of the village; but he knew
not how dearly he was attached to it, till he saw its demolition: it
was his fault, he said; and if he had not exchanged his piece of
ground, he should never have lived to see his native place
destroyed. He took it deeply to heart; it preyed upon his mind, and
he soon lost his senses and died.
4 CHIABRERA.

I tell the story as it was related, within sight of the spot, by a


husbandman who knew the place and the circumstances, and well
remembered that many people used to come every morning from
the adjacent parts to buy milk there,—“a quart of new milk for a
half-penny, and a quart of old, given with it.”

Naboth has been named in relating this, but the reader will not
suppose that I have any intention of comparing the great proprietor
to Ahab,—or to William the Conqueror. There was nothing unjust in
his proceedings, nothing iniquitous; and (though there may have
been a great want of proper feeling) nothing cruel. I am not aware
that any hardship was inflicted upon the families who were ejected,
farther than the inconvenience of a removal. He acted as most
persons in the same circumstances probably would have acted, and
no doubt he thought that his magnificent habitation was greatly
improved by the demolition of the poor dwellings which had
neighboured it so closely. Farther it may be said in his justification
(for which I would leave nothing unsaid) that very possibly the
houses had not sufficient appearance of neatness and comfort to
render them agreeable objects, that the people may have been in no
better state of manners and morals than villagers commonly are,
which is saying that they were bad enough; that the filth of their
houses was thrown into the road, and that their pigs, and their
children who were almost as unclean, ran loose there. Add to this if
you please that though they stood in fear of their great neighbour,
there may have been no attachment to him, and little feeling of
good will. But I will tell you how Dr. Dove would have proceeded if
he had been the hereditary Lord of that Castle and that domain.

He would have considered that this village was originally placed


there for the sake of the security which the Castle afforded. Times
had changed and with them the relative duties of the Peer and of
the Peasantry: he no longer required their feudal services, and they
no longer stood in need of his protection. The more therefore,
according to his “way of thinking,” was it to be desired, that other
relations should be strengthened and the bonds of mutual goodwill
be more closely intertwined. He would have looked upon these
villagers as neighbours, in whose welfare and good conduct he was
especially interested, and over whom it was in his power to exercise
a most salutary and beneficial influence; and having this power he
would have known, that it was his duty so to use it. He would have
established a school in the village, and have allowed no ale-house
there. He would have taken his domestics preferably from thence. If
there were a boy who by his gentle disposition, his diligence and his
aptitude for learning gave promise of those qualities which best
become the clerical profession, he would have sent that boy to a
grammar school, and afterwards to college, supporting him there in
part, or wholly, according to the parents' means, and placing him on
his list for preferment, according to his deserts.

If there were any others who discovered a remarkable fitness for


any other useful calling, in that calling he would have had them
instructed and given them his countenance and support, as long as
they continued to deserve it. The Archbishop of Braga, Fray
Bartolomen dos Martyres, added to his establishment a Physician for
the poor. Our friend would in like manner have fixed a medical
practitioner in the village,—one as like as he could find to a certain
Doctor at Doncaster; and have allowed him such a fixed stipend, as
might have made him reasonably contented and independent of the
little emolument which the practice of the place could afford, for he
would not have wished his services to be gratuitous where there was
no need. If the parish to which the village belonged was too
extensive, or the parochial Minister unwilling, or unable to look
carefully after this part of his flock, his Domestic Chaplain, (for he
would not have lived without one) should have taken care of their
religious instruction.
In his own family and in his own person he would have set his
neighbours an example of “whatsoever things are honest,
whatsoever things are just, whatsoever things are pure, whatsoever
things are lovely, whatsoever things are of good report.” And as this
example produced its sure effects, he would have left the Amateurs
of Agriculture to vie with each other in their breeds of sheep and
oxen, and in the costly cultivation of their farms. It would have been,
not his boast, for he boasted of nothing;—not his pride, for he had
none of

that poor vice which only empty men


Esteem a virtue—5

it was out of the root of Christian humility that all his virtues grew,—
but his consolation and his delight to know that nowhere in Great
Britain was there a neater, a more comfortable village than close to
his own mansion; no where a more orderly, a more moral, a more
cheerful, or a happier people. And if his castle had stood upon an
elevation commanding as rich a survey as Belvoir or Shobden, that
village when he looked from his windows, would still have been the
most delightful object in the prospect.
5 BEAUMONT AND FLETCHER.

I have not mentioned the name of the old Quaker in my story; but I
will preserve it in these pages because the story is to his honour. It
was Joshua Dickson. If Quakers have (and certainly they have) the
quality which is called modest assurance in a superlative degree that
distinguishes them from any other class of men, (it is of the men
only that I speak) they are the only sect, who as a sect, cultivate the
sense of conscience. This was not a case of conscience, but of
strong feeling assuming that character under a tendency to
madness.

When Lord Harcourt about the same time removed the village of
Nuneham, an old widow Barbara Wyat by name, earnestly intreated
that she might be allowed to remain in her old habitation. The
request which it would have been most unfeeling to refuse, was
granted; she ended her days there, and then the cottage was pulled
down: but a tree which grew beside it, and which she had planted in
her youth, is still shown on the terrace at Nuneham, and called by
her name. Near it is placed the following Inscription by that amiable
man the Laureate Whitehead. Like all his serious poems it may be
read with pleasure and profit,—though the affecting circumstance
which gives the anecdote its highest interest is related only in a
note.
This Tree was planted by a female hand,
In the gay dawn of rustic beauty's glow;
And fast beside it did her cottage stand,
When age had clothed the matron's head with snow.

To her long used to nature's simple ways,


This single spot was happiness compleat;
Her tree could shield her from the noontide blaze
And from the tempest screen her little seat.

Here with her Colin oft the faithful maid,


Had led the dance, the envious youths among,
Here when his aged bones in earth were laid,
The patient matron turned her wheel and sung.

She felt her loss, yet felt it as she ought,


Nor dared 'gainst Nature's general law exclaim,
But checkt her tears and to her children taught
That well known truth their lot would be the same.

The Thames before her flowed, his farther shores


She ne'er explored, contented with her own;
And distant Oxford, tho' she saw its towers,
To her ambition was a world unknown.

Did dreadful tales the clowns from market bear


Of kings and tumults and the courtier train,
She coldly listened with unheeding ear,
And good Queen Anne, for aught she cared, might reign.

The sun her day, the seasons marked her year,


She toiled, she slept, from care, from envy free;
For what had she to hope, or what to fear,
Blest with her cottage, and her favourite Tree.

Hear this ye Great, whose proud possessions spread


6 The Classical reader
O'er earth's
will berich
aware
surface
thatto
the
noAuthor
space of
confined!
these lines had Claudian's “Old
Man of Verona”
Ye learn'd
in his inmind's
arts, ineye,
men,asinClaudian
manners had
read,Virgil's “Corycian Old Man.”—
Georg. iv. 127. Who boast as wide an empire o'er the mind,

Mason wouldWithhave produced


reverence visit heraaugust
betterdomain;
inscription upon this subject, in
the same strain;
To herSouthey in a different
unlettered memory bow the knee; one, Crabbe would have
treated it with
She more strength,
found that happiness Bowles with
you seek in vain,a finer feeling, so would
his kinswomanBlest and
withnamesake
a cottage, andCaroline,
a single Tree.than
6 whom no author or
authoress has ever written more touchingly, either in prose or verse.
Wordsworth would have made a picture from it worthy of a place in
the great Gallery of his Recluse. But Whitehead's is a remarkable
poem, considering that it was produced during what has been not
unjustly called the neap tide of English poetry: and the reader who
should be less pleased with it than offended by its faults, may have
cause to suspect that his refinement has injured his feelings in a
greater degree than it has improved his taste.

CHAPTER CCXXXIII.

THE PETTY GERMAN PRINCES EXCELLENT PATRONS OF LITERATURE AND LEARNED


MEN.—THE DUKE OF SAXE WEIMAR.—QUOTATION FROM BP. HACKET.—AN OPINION
OF THE EXCELLENT MR. BOYLE.—A TENET OF THE DEAN OF CHALON, PIERRE DE
ST. JULIEN,—AND A VERITABLE PLANTAGENET.

Ita nati estis, ut bona malaque vestra ad Rempublicam pertineant.

TACITUS.
“We have long been accustomed to laugh at the pride and poverty of
petty German Princes,” says one of the most sensible and right
minded travellers that ever published the result of his observations
in Germany;1 “but nothing,” he proceeds, “can give a higher idea of
the respectability which so small a people may assume, and the
quantity of happiness which one of these insignificant monarchs may
diffuse around him, than the example of the little state of Weimar,
with a Prince like the present2 Grand Duke at its head. The mere
pride of sovereignty frequently most prominent where there is only
the title to justify it, is unknown to him; he is the most affable man
in his dominions, not simply with the condescension which any
prince can learn to practise as a useful quality, but from goodness of
heart.” The whole population of his state little if at all exceeds that of
Leicestershire; his capital is smaller than a third or fourth rate county
town; so in fact it scarcely deserves the name of a town; and the
inhabitants, vain as they are of its well earned reputation as the
German Athens, take a pride in having it considered merely a large
village: his revenue is less than that of many a British Peer, great
Commoner, or commercial Millionist. Yet “while the treasures of more
weighty potentates were insufficient to meet the necessities of their
political relations, his confined revenues could give independence
and careless leisure to the men who were gaining for Germany its
intellectual reputation.” It is not too much to say that for that
intellectual reputation, high as it is, and lasting as it will be,
Germany is little less beholden to the Duke of Weimar's well-
bestowed patronage, than to the genius of Wieland, and Schiller and
Goëthe. “In these little principalities, the same goodness of
disposition can work with more proportional effect than if it swayed
the sceptre of an empire; it comes more easily and directly into
contact with those towards whom it should be directed: the artificial
world of courtly rank and wealth has neither sufficient glare nor
body to shut out from the prince the more chequered world that lies
below.”
1 RUSSELL.
2 A. D. 1822.

Alas no Prince either petty or great has followed the Duke of Saxe
Weimar's example! “He dwells,” says Mr. Downes, “like an estated
gentleman, surrounded by his tenantry.” Alas no British Peer, great
Commoner, or commercial Millionist has given to any portion of his
ampler revenues a like beneficent direction.

A good old Bishop3 quoting the text “not many wise men after the
flesh, not many mighty, not many noble are called,” cautions us
against distorting the Scripture as if it pronounced nothing but
confusion to the rulers of the earth, “let not the honourable person,”
said he, “hang down his head, as if power and wisdom, and noble
blood, and dignity were causes of rejection before God: no beloved!
Isaiah foretold that Kings should be nursing fathers, and Queens
should be nursing mothers of the Church, but it is often seen that
the benignity of nature and the liberality of fortune are made
impediments to a better life; and therefore Nobles and Princes are
more frequently threatened with judgment. I adjoin moreover that
the Scriptures speak more flatly against illustrious Magistrates, than
the common sort; for if God had left it to men, whose tongues are
prostituted to flattery, they had scarce been told that their
abominable sins would bring damnation.”
3 BISHOP HACKET.

When our philosopher considered the manner in which large


incomes are expended, (one way he had opportunities enough of
observing at Doncaster) he thought that in these times high birth
brought with it dangers and evils which in many or most instances,
more than counterbalanced its advantages.

That excellent person Mr. Boyle had formed a different opinion. To


be the son of a Peer whose prosperity had found many admirers, but
few parallels, and not to be his eldest son, was a happiness that he
used to “mention with great expressions of gratitude; his birth, he
said, so suiting his inclinations and designs, that, had he been
permitted an election, his choice would scarce have altered God's
assignment. For as on the one side, a lower birth would have too
much exposed him to the inconveniences of a mean descent, which
are too notorious to need specifying; so on the other side, to a
person whose humour indisposes him to the distracting hurry of the
world, the being born heir to a great family is but a glittering kind of
slavery, whilst obliging him to a public entangled course of life, to
support the credit of his family, and tying him from satisfying his
dearest inclinations, it often forces him to build the advantages of
his house upon the ruins of his own contentment.”

“A man of mean extraction,” he continues, “is seldom admitted to


the privacy and secrets of great ones promiscuously, and scarce
dares pretend to it, for fear of being censured saucy, or an intruder.
And titular greatness is ever an impediment to the knowledge of
many retired truths, that cannot be attained without familiarity with
meaner persons, and such other condescensions, as fond opinion, in
great men, disapproves and makes disgraceful.” “But he himself,” Mr.
Boyle said, “was born in a condition that neither was high enough to
prove a temptation to laziness, nor low enough to discourage him
from aspiring.” And certainly to a person that affected so much an
universal knowledge, and arbitrary vicissitudes of quiet and
employments, it could not be unwelcome to be of a quality, that was
a handsome stirrup to preferment, without an obligation to court it,
and which might at once both protect his higher pretensions from
the guilt of ambition, and secure his retiredness from contempt.

There would be more and higher advantages in high birth than Mr.
Boyle apprehended, if the Dean of Chalon, Pierre de St. Julien, were
right when he maintained contre l'opinion des Philosophes, et
l'ordinaire des Predicamants,—que la vraye Noblesse a sa source du
sang, et est substancielle.

Ces mots Gentilhomme de sang, et d'armes, de race genereuse, de


bonne part, &c., says the well-born Dean, who in his title pages let
us know that he was de la maison de Balleurré,—sont termes non de
qualité, ny d'habitude; ains importants substance de vray, comme il
est bien dit,

veniunt cum sanguine mores;

et aillieurs,

Qui viret in foliis venit à radicibus humor;


Sic patrum in natos abeunt cum semine mores.

Et comme le sang est le vehicule, et porteur des esprits de vie,


esquels est enclose la substance de l'ame; aussi est il le comme
chariot, qui porte et soustient celle substance qui decoule des peres,
et des ayeulx, par long ordre de generation, et provient aux enfants,
qui, nez de bonne et gentille semence, sont (conformement à
l'opinion du divin Philosophe Platon) rendu tels que leurs
progeniteurs, par la vertu des esprits enclos en la semence.—
Tellement qu'on ne peut nyer, que comme d'une bonne Ayre sortent
de bons oyseaux, d'un bon Haras de bons chevaux, &c., aussi il
importe beaucoup aux hommes d'estre nez de bons et valeureux
parents; voire tant, que les mal nez, ennemys de ceste bien
naissance, ne sont suffisants pour en juger.

Sir Robert Cotton once met with a man driving the plough, who was
a true and undoubted Plantagenet. “That worthy Doctor,” (Dr.
Hervey) says that worthy Fuller (dignissimus of being so styled
himself,) “hath made many converts in physic to his seeming
paradox, maintaining the circulation of blood running round about
the body of man. Nor is it less true that gentle blood fetcheth a
circuit in the body of a nation, running from Yeomanry, through
Gentry to Nobility, and so retrograde, returning through Gentry to
Yeomanry again.”

“Plust à Dieu,” said Maistre François Rabelais, of facetious memory,


“qu'un chacun saust aussi certainement—(as Gargantua that is,) sa
genealogie, depuis l'Arche de Noé, jusqu'à cet âge! Je pense que
plusieurs sont aujourd'hui Empereurs, Roys, Ducs, Princes et Papes
en la terre, lesquels sont descendus de quelques Porteurs de
rogatons et de constrets. Comme au rebours plusieurs sont gueux
de l'hostiere, souffreteux et miserables, lesquels sont descendus de
sang et ligne de grands Roys et Empereurs; attends l'admirable
transport des Regnes et Empires,

Des Assyriens, és Medes;


Des Medes, és Perses;
Des Perses, és Macédoniens;
Des Macédoniens, és Grecs;
Des Grecs, és François.

Et pour vous donner à entendre de moy qui vous parle, je cuide que
suis descendu de quelque riche Roy, ou Prince, au temps jadis; car
oncques ne vistes homme qui eust plus grande affection d'estre Roy
ou riche que moy, afin de faire grand chere, pas ne travailler, point
ne me soucier et bien enrichir mes amis, et tous gens de bien et de
sçavoir.”

CHAPTER CCXXXIV.

OPINION OF A MODERN DIVINE UPON THE WHEREABOUT OF NEWLY DEPARTED


SPIRITS.—ST. JOHN'S BURIAL, ONE RELIC ONLY OF THAT SAINT, AND WHEREFORE.
—A TALE CONCERNING ABRAHAM, ADAM AND EVE.

Je sçay qu'il y a plusieurs qui diront que je fais beaucoup de petits fats contes, dont
je m'en passerois bien. Ouy, bien pour aucuns,—mais non pour moy, me contentant
de m'en renouveller le souvenance, et en tirer autant de plaisir.
BRANTÔME.

Watts who came to the odd conclusion in his Philosophical Essay,


that there may be Spirits which must be said, in strict philosophy to
be no where, endeavoured to explain what he called the ubi or
whereness of those spirits which are in a more imaginable situation.
While man is alive, the soul he thought might be said to be in his
brain, because the seat of consciousness seems to be there; but as
soon as it is dislodged from that local habitation by death, it finds
itself at once in a heaven or hell of its own, and this “without any
removal or relation to place, or change of distances.” The shell is
broken, the veil is withdrawn; it is where it was, but in a different
mode of existence, in the pure intellectual, or separate world. “It
reflects upon its own temper and actions in this life, it is conscious of
its virtues, or its vices,” and it has an endless spring of peace and joy
within, or is tormented with the anguish of self condemnation.

In his speculations the separation of soul from body is total, till their
re-union at the day of judgment; and this unquestionably is the
christian belief. The fablers of all religions have taken a different
view, because at all times and in all countries they have
accommodated their fictions to the notions of the people. The grave
is with them a place of rest, or of suffering. If Young had been a
Jew, a Mahommedan, or a Roman Catholic, he might be understood
as speaking literally when he says,

How populous, how vital is the grave.

St. Augustine had been assured by what he considered no light


testimony that St. John was not dead, but asleep in his sepulchre,
and that the motion of his breast as he breathed might be perceived
by a gentle movement of the earth. The words of our Lord after his
Resurrection, concerning the beloved disciple, “If I will that he tarry
till I come, what is that to thee,” gave scope to conjecture
concerning the fate of this Evangelist, and yet in some degree set
bounds to that spirit of lying invention which in process of time
annexed as many fables to corrupted Christianity as the Greek and
Roman poets had engrafted upon their heathenism, or the Rabbis
upon the Jewish faith. “Sinner that I am,” said a French prelate with
demure irony, when a head of St. John the Baptist was presented to
him to kiss in some Church of which it was the choicest treasure,
—“sinner that I am, this is the fourth head of the glorious Baptist
that I have had the happiness of holding in these unworthy hands!”
But while some half dozen or half score of these heads were
produced, because it was certain that the Saint had been beheaded,
no relic of St. John the Evangelist's person, nor of the Virgin Mary's,
was ever invented. The story of the Assumption precluded any such
invention in the one case,—and in St. John's the mysterious
uncertainty of his fate had the same effect as this received tradition.
The Benedictines of St. Claude's Monastery in the Jura exhibited his
own manuscript of the Apocalypse,—(the most learned of that order
in no unlearned age, believed or affected to believe that it was his
actual autograph,)—and they considered that it was greatly
enhanced in value by its being the only relic of that Saint in
existence.

The fable which St. Augustine seems to have believed, was either
parent or child of the story told under the name of Abdias, that
when the Beloved Disciple had attained the postdiluvian age of
ninety seven, our Lord appeared to him, said unto him, “come unto
me, that thou mayest partake at my feast with thy brethren,” and
fixed the next Sunday, being Easter, for his removal from this world.
On that Sunday accordingly, the Evangelist after having performed
service in his own temple at Ephesus, and exhorted the people, told
some of his chosen disciples to take with them two mattocks and
spade, and accompany him therewith. They went to a place near the
city, where he had been accustomed to pray, there he bade them dig
a grave, and when they would have ceased from the work, he bade
them dig it still deeper. Then taking off all his garments except a
linen vestment, he spread them in the grave, laid himself down upon
them, ordered his disciples to cover him up, and forthwith fell asleep
in the Lord. Abdias proceeds no farther with the story; but other
ecclesiastic romancers add that the evangelist enjoined them to
open the grave on the day following; they did so and found nothing
but his garments, for the blessed virgin in recompence for the filial
piety which he had manifested towards her in obedience to our
Lord's injunctions from the cross, had obtained for him the privilege
of an Assumption like her own. Baronius has no objection to believe
this, but that St. John actually died is, he says more than certain,—
certo certius; and that his grave at Ephesus was proof of it, for certe
non nisi mortuorum solent esse sepulchra.

Yet the Cardinal knew that the historian of his Church frequently
represented the dead as sentient in their graves. The Jews have
some remarkable legends founded upon the same notion. It is
written in the book of Zohar, say the Rabbis, how when Abraham
had made a covenant with the people of the land, and was about to
make a feast for them, a calf which was to be slaughtered on the
occasion, broke loose and ran into the cave of Machpelah. Abraham
followed, and having entered the cave in pursuit, there he
discovered the bodies of Adam and Eve, each on a bed, with lamps
burning between them. They were sleeping the sleep of death, and
there was a good odour around them, like the odour of repose. In
consequence of having made this discovery it was that he desired to
purchase the cave for his own burial place; and when the sons of
Jebus refused to sell it, he fell upon his knees, and bowed himself
before them, till they were entreated. When he came to deposit the
body of Sarah there, Adam and Eve rose up, and refused their
consent. The reason which they gave for this unexpected prohibition
was, that they were already in a state of reproach before the Lord,
because of their transgression, and a farther reproach would be
brought upon them by a comparison with his good deeds, if they
allowed such company to be introduced into their resting place. But
Abraham took upon himself to answer for that; upon this they were
satisfied with his assurances, and composed themselves again to
their long sleep.
The Rabbis may be left to contend for the authority of the book of
Zohar in this particular against the story of the Cabalists that Adam's
bones were taken into the Ark, and divided afterwards by Noah
among his sons. The skull fell to Shem's portion; he burnt it on the
mountain which for that reason obtained the name of Golgotha, or
Calvary,—being interpreted, the place of a skull, and on that spot,
for mystical signification the cross whereon our Saviour suffered was
erected;—a wild legend, on which as wild a fiction has been grafted,
that a branch from the Tree of Life had been planted on Adam's
grave, and from the wood which that branch had produced the cross
was made.

And against either of these the authority of Rabbi Judas Bar Simon is
to be opposed, for he affirms that the dust of Adam was washed
away by the Deluge, and utterly dispersed.

The Rabbis have also to establish the credit of their own tradition
against that of the Arabs who at this time shew Eve's grave near
Jeddah;—about three days journey east from that place, according
to Bruce. He says, it is covered with green sods, and about fifty
yards in length. The Cashmerian traveller Abdulkurreem who visited
it in 1742, says that it measured an hundred and ninety-seven of his
footsteps, which would make the mother of mankind much taller
than Bruce's measurement. He likens it to a flower-bed; on the
middle of the grave there was then a small dome, and the ends of it
were enclosed with wooden pales. Burckhardt did not visit it; he was
told that it was about two miles only, northward of the town, and
that it was a rude structure of stone, some four feet in length, two
or three in height and as many in breadth, thus resembling the tomb
of Noah, which is shewn in the valley of Bekaa, in Syria. Thus widely
do these modern travellers, on any one of whom reasonable reliance
might have been placed, differ in the account of the same thing.
CHAPTER CCXXXV.

THE SHORTEST AND PLEASANTEST WAY FROM DONCASTER TO JEDDAH, WITH


MANY MORE, TOO LONG.

Πόνος πόνῳ πόνον φέρει


Πᾶ πᾶ γὰρ οὐκ ἔβαν ἐγώ.
SOPHOCLES.

We have got from the West Riding of Yorkshire, to the Eastern shore
of the Red Sea, without the assistance of mail-coach, steam-packet,
or air-balloon, the magical carpet, the wishing-cap, the shoes of
swiftness, or the seven-leagued boots. From Mr. Bacon's vicarage we
have got to Eve's grave, not per saltum, by any sudden, or violent
transition; but by following the stream of thought. We shall get back
in the same easy manner to that vicarage, and to the quiet
churchyard wherein the remains of one of the sweetest and for the
few latter years of her short life, one of the happiest of Eve's
daughters, were deposited in sure and certain hope. If you are in
the mood for a Chapter upon Churchyards, go reader to those which
Caroline Bowles has written;—you will find in them every thing that
can touch the heart, every thing that can sanctify the affections,
unalloyed by anything that can offend a pure taste and a masculine
judgement.

But before we find our way back we must tarry awhile among the
tombs, and converse with the fablers of old.
A young and lovely Frenchwoman after visiting the Columbarium
near the Villa Albani, expressed her feeling strongly upon our custom
of interring the dead, as compared with the non-burial of the
ancients, usage odieux, said she, qui rend la mort horrible! Si les
anciens en avaient moins d'effroi, c'est que la coutume de brûler les
corps dérobait au trépas tout ce qu'il a de hideux. Qu'il était
consolant et doux de pouvoir pleurer sur des cendres chéries! Qu'il
est épouvantable et déchirant aujourd'hui de penser que celui qu'on
a tant aimé n'offre plus qu'une image affreuse et décharnée dont on
ne pourrait supporter la vue.

The lady in whose journal these lines were written lies buried in the
Campo Santo at Milan, with the following inscription on her tomb;
Priez pour une jeune Française que la mort a frappée à vingt ans,
comme elle allait, après un voyage de huit mois avec un epoux chéri,
revoir son enfant, son pere et sa mere, qui venaient joyeux au-
devant d'elle. Her husband wished to have her remains burnt, in
conformity to her own opinion respecting the disposal of the dead,
and to his own feelings at the time, that he might have carried her
ashes to his own country, and piously have preserved them there, to
weep over them, and bequeath them to his son; mais les amis qui
m'entouraient, he says, combatterent mon desir, comme une
inspiration insensée de la douleur.

There can be no doubt that our ghastly personification of Death has


been derived from the practice of interment; and that of all modes in
which the dead have ever been disposed of, cremation is in some
respects the best. But this mode, were it generally practicable,
would in common use be accompanied with more revolting
circumstances than that which has now become the Christian usage.
Some abominations however it would have prevented, and though in
place of those superstitions which it precluded others would
undoubtedly have arisen, they would have been of a less loathsome
character.
The Moors say that the dead are disturbed if their graves be trodden
on by Christian feet; the Rabbis that they feel the worms devouring
them.

On the south side of the city of Erzeroom is a mountain called Eyerli,


from the same likeness which has obtained for one of the English
mountains the unpoetical name of Saddleback. The Turkish traveller
Evlia Effendi saw on the top of this mountain a tomb eighty paces in
length, with two columns marking the place of the head and of the
feet. “I was looking on the tomb,” he says, “when a bad smell
occurred very hurtfully to my nose, and to that of my servant who
held the horses; and looking near, I then saw that the earth of the
grave, which was greasy and black, was boiling, like gruel in a pan. I
returned then, and having related my adventures in the evening in
company with the Pashaw, Djaafer Effendi of Erzeroom, a learned
man and an elegant writer, warned me not to visit the place again,
for it was the grave of Balaam the son of Beor, who died an infidel,
under the curse of Moses, and whose grave was kept always in this
state by subterraneous fires.”

When Wheler was at Constantinople, he noticed a monument in the


fairest and largest street of that city, the cupola of which was
covered with an iron grating. It was the tomb of Mahomet Cupriuli,
father to the then Grand Vizier. He had not been scrupulous as to
the means by which he settled the government during the Grand
Seignior's minority, and carried it on afterwards, quelling the
discontents and factions of the principal Agas, and the mutinies of
the Janizaries. Concerning him after his decease, says this traveller,
“being buried here, and having this stately monument of white
marble covered with lead erected over his body, the Grand Seigneur
and Vizier had this dream both in the same night, to wit, that he
came to them and earnestly begged of them a little water to refresh
him, being in a burning heat. Of this the Grand Seigneur and Vizier
told each other in the morning, and thereupon thought fit to consult
the Mufti what to do concerning it. The Mufti, according to their
gross superstition, advised that the roof of his sepulchre should be
uncovered, that the rain might descend on his body, thereby to
quench the flames which were tormenting his soul. And this remedy
the people who smarted under his oppression think he had great
need of, supposing him to be tormented in the other world for his
tyrannies and cruelties committed by him in this.”

If Cupriuli had been a Russian instead of a Turk, his body would


have been provided with a passport before it was committed to the
grave. Peter Henry Bruce in his curious memoirs gives the form of
one which in the reign of Peter the Great, always before the coffin of
a Russian was closed, was put between the fingers of the corpse:
—“We N. N. do certify by these presents that the bearer hereof hath
always lived among us as became a good Christian, professing the
Greek religion; and although he may have committed some sins, he
hath confessed the same, whereupon he hath received absolution,
and taken the communion for the remission of sins: That he hath
honoured God and his Saints, that he hath not neglected his
prayers; and hath fasted on the hours and days appointed by the
Church: That he hath always behaved himself towards me, his
Confessor, in such a manner that I have no reason to complain of
him, or to refuse him the absolution of his sins. In witness whereof I
have given him these testimonials, to the end that St. Peter upon
sight of them, may not deny him the opening of the gate to eternal
bliss!”

The custom evidently implies an opinion that though soul and body
were disunited by death, they kept close company together till after
the burial; otherwise a passport which the Soul was to present at
Heaven's gate, would not have been placed in the hands of the
corpse. In the superstitions of the Romish church a re-union is
frequently supposed, but that there is an immediate separation upon
death is an article of faith, and it is represented by Sir Thomas More
as one of the punishments for a sinful soul to be brought from
Purgatory and made to attend, an unseen spectator, at the funeral of
its own body, and feel the mockery of all the pomps and vanities
used upon that occasion. The passage is in his Supplycacyon of
Soulys. One of the Supplicants from Purgatory speaks:

“Some hath there of us, while we were in health, not so much


studied how we might die penitent, and in good christian plight, as
how we might solemnly be borne out to burying, have gay and
goodly funerals, with heralds at our herses, and offering up our
helmets, setting up our scutcheons and coat-armours on the wall,
though there never came harness on our backs, nor never ancestor
of ours ever bare arms before. Then devised we some Doctor to
make a sermon at our mass in our month's mind, and then preach to
our praise with some fond fantasy devised of our name; and after
mass, much feasting, riotous and costly; and finally, like madmen,
made men merry at our death, and take our burying for a brideale.
For special punishment whereof, some of us have been by our Evil
Angels brought forth full heavily, in full great despight to behold our
own burying, and so, stand in great pain, invisible among the press,
and made to look on our carrion corpse, carried out with great
pomp, whereof our Lord knoweth we have taken heavy pleasure!”

In opposition to this there is a Rabbinical story which shows that


though the Jews did not attribute so much importance to the rights
of sepulture as the ancient Greeks, they nevertheless thought that a
parsimonious interment occasioned some uncomfortable
consequences to the dead.

A pious descendant of Abraham, whom his wife requited with a


curtain lecture for having, as she thought improvidently, given alms
to a poor person in a time of dearth, left his house, and went out to
pass the remainder of the night among the tombs, that he might
escape from her objurgations. There he overheard a conversation
between the Spirits of two young women, not long deceased. The
one said, “come let us go through the world, and then listen behind
the curtain and hear what chastisements are decreed for it.” The
other made answer, “I cannot go, because I have been buried in a
mat made of reeds, but go you, and bring me account of what you
hear.” Away went the Ghost whose grave-clothes were fit to appear
in: and when she returned, “well friend, what have you heard behind
the curtain,” said the ghost in the reed-mat. “I heard,” replied the
gad-about, “that whatever shall be sown in the first rains, will be
stricken with hail.” Away went the alms-giver; and upon this
intelligence which was more certain than any prognostication in the
Almanack, he waited till the second rains before he sowed his field;
all other fields were struck with hail, but according as he had
expected his crop escaped.

Next year, on the anniversary of the night which had proved so


fortunate to him, he went again to the Tombs: and overheard
another conversation between the same ghosts to the same purport.
The well drest ghost went through the world, listened behind the
curtain, and brought back information that whatever should be sown
in the second rains would be smitten with rust. Away went the good
man, and sowed his field in the first rains; all other crops were spoilt
with the rust, and only his escaped. His wife then enquired of him
how it had happened that in two successive years he had sown his
fields at a different time from every body else, and on both
occasions his were the only crops that had been saved. He made no
secret to her of his adventures, but told her how he had come to the
knowledge which had proved so beneficial. Ere long his wife
happened to quarrel with the mother of the poor ghost who was
obliged to keep her sepulchre; and the woman of unruly tongue,
among other insults, bade her go and look at her daughter, whom
she had buried in a reed-mat! Another anniversary came round, and
the good man went again to the Tomb; but he went this time in
vain, for when the well-dressed Ghost repeated her invitation, the
other made answer, “let me alone, my friend, the words which have
past between you and me have been heard among the living.”

The learned Cistercian1 to whom I owe this legend, expresses his


contempt for it; nevertheless he infers from it that the spirits of the
dead know what passes in this world; and that the doctrine of the
Romish Church upon that point, is proved by this tradition to have
been that of the Synagogue also.
1 BERTOLACCI.

The Mahommedans who adopted so many of the Rabbinical fables,


dispensed in one case for reasons of obvious convenience, with all
ceremonies of sepulchral costume. For the funeral of their martyrs,
by which appellation all Musselmen who fell in battle against the
unbelievers were honoured, none of those preparations were
required, which were necessary for those who die a natural death. A
martyr needs not to be washed after his death, nor to be enveloped
in grave-clothes; his own blood with which he is besmeared serves
him for all legal purification, and he may be wrapt in his robe, and
buried immediately after the funeral prayer, conformably to the order
of the Prophet, who has said, “bury them as they are, in their
garments, and in their blood! Wash them not, for their wounds will
smell of musk on the Day of Judgement.”

A man of Medina, taking leave of his wife as he was about to go to


the wars commended to the Lord her unborn babe. She died
presently afterwards, and every night there appeared a brilliant light
upon the middle of her tomb. The husband hearing of this upon his
return, hastened to the place; the sepulchre opened of itself; the
wife sate up in her winding sheet, and holding out to him a boy in
her arms, said to him take “that which thou commendedst to the
Lord. Hadst thou commended us both, thou shouldest have found us
both alive.” So saying she delivered to him the living infant, and laid
herself down, and the sepulchre closed over her.

* * * * *

PARS IMPERFECTA MANEBAT.—VIRG. ÆN.

The following materials, printed verbatim from the MS. Collection,


were to have completed the Chapter. It has been thought advisable
in the present instance to shew how the lamented Southey worked
up the collection of years. Each extract is on a separate slip of paper,
and some of them appear to have been made from thirty to forty
years ago, more or less.

And so the virtue of his youth before


Was in his age the ground of his delight.
JAMES I.

Ἔνθεν δὲ Σθενέλον τάφον ἔδρακον Ἀκτορίδαο·


Ὅς ῥά τ Ἀμαζονίδων πολυθαρσέος ἐκ πολέμοιο
Ἄψ ἀνιὼν (δὴ γὰρ συνανήλυθεν Ἡρὰκλῆϊ)
Βλήμενος ἰῷ κεῖθεν ᾽επ᾽ ἀγχιάλον θάνεν ἀκτῆς.
Ὀυ μέν θην προτέρω ἀνεμέρεον· ἧκε γὰρ αὐτὴ
Φερσεφόνη ψυχὴν πολυδάκρυον Ἀκτορίδαο
Λισσομένην, τυτθόν περ ὁμήθεας ἄνδρας ἰδέσθαι.
Τύμβου δὲ στεφάνης ἐπιβὰς σκοπιάζετο νῆα,
Τοῖος ἐὼν οἷος πόλεμονδ᾽ ἴεν· ἀμφὶ δὲ καλὴ
Τετράφαλος φοίνικι λόφῳ ἐπελάμπετο πήληξ,
Καὶ ῥ᾽ ὁ μὲν αὖτις ἔδυνε μέγαν ζόφον· οἱ δ᾽ ἐσιδόντες
Θάμβησαν. τοὶς δ᾽ ὦρσε θεοπροπέων ἐπικελσαι
Αμπυκίδης Μόψος, λοιβῆσί τε μειλίξασθαι.
Ὃι δ᾽ ἀνὰ μὲν κραιπνῶς λαῖφος σπάσαν, ἐκ δὲ βαλόντες
Πείσματ᾽ ἐν αἰγιαλῷ Σθενέλου τάφον ἀμφεπένοντο,
Χύτλα τέ οἱχεύαντο, καὶ ἥγνισαν ἔντομα μήλων.
APOLLONIUS RHODIUS.

The Abaza (a Circassian tribe) have a strange way of burying their


Beys. They put the body in a coffin of wood, which they nail on the
branches of some high trees and made a hole in the coffin by the
head, that the Bey as they say, may look unto Heaven. Bees enter
the coffin, and make honey, and cover the body with their comb: If
the season comes they open the coffin, take out the honey and sell
it, therefore much caution is necessary against the honey of the
Abazas.

EVLIA EFFENDI.

Once in their life time, the Jews say, they are bound by the Law of
Moses to go to the Holy Land, if they can, or be able, and the bones
of many dead Jews are carried there, and there burnt. We were
fraughted with wools from Constantinople to Sidon, in which sacks,
as most certainly was told to me, were many Jew's bones put into
little chests, but unknown to any of the ship. The Jews our
Merchants told me of them at my return from Jerusalem to Saphet,
but earnestly intreated me not to tell it, for fear of preventing them
another time.

Going on, one of my companions said, if you will take the trouble of
going a little out of the way, you will see a most remarkable thing.
Well, said I, what should be the object of all pains taken in
travelling, if it were not to admire the works of God. So we went on
for an hour to the north, but not taking the great road leading to the
Plain of Moosh, we advanced to a high rock that is a quarter of an
hour out of the road. To this rock, high like a tower, a man was
formerly chained, whose bones are yet preserved in the chains. Both
bones and chains are in a high state of preservation. The bones of
the arms are from seven to eight cubits in length, of an astonishing
thickness. The skull is like the cupola of a bath, and a man may
creep in and out without pain through the eye-holes. Eagles nestle in
them. These bones are said to be those of a faithful man who in
Abraham's time was chained by Nimrod to this rock, in order to be
burnt by fire. The fire calcined part of his body, so that it melted in
one part with the rock; but the arms and legs are stretching forth to
the example of posterity. We have no doubt that they will rise again
into life at the sound of the trumpet on the day of judgement.
EVLIA EFFENDI.

The Magistrates of Leghorn have authority to issue out orders for


killing dogs if they abound too much in the streets, and molest the
inhabitants. The men entrusted with the execution of these orders
go through the city in the night, and drop small bits of poisoned
bread in the streets. These are eaten by the dogs and
instantaneously kill them. Before sunrise the same men go through
the streets with a cart, gather hundreds of the dead dogs, and carry
them to the Jew's burying ground without the town.

HASSELQUIST.

In the ROMANCE OF MERLIN it is said that before the time of Christ,


Adam and Eve and the whole ancient world were (not in Limbo) but
actually in Hell. And that when the Prophets comforted the souls
under their sufferings by telling them of the appointed Redeemer,
the Devils for that reason tormented these Prophets more than
others. The Devils themselves tell the story, et les tourmentions plus
que les autres. Et ilz faisoyent semblant que nostre tourment ne les
grevoit riens; ainçois comfortoyent les aultres pecheurs et disoyent.
Le Saulveur de tout le monde viendra qui tous nous delivrera.

At the time of the deluge the wife of Noah being pregnant, was
through the hardships of the voyage delivered of a dead child to
which the name of Tarh was given, because the letters of this word
form the number 217 which was the number of days he was carried
by his mother instead of the full time of 280 days, or nine months.
This child was buried in the district now called Djezere Ibn Omar, the
Island or Peninsula of the son of Omar, and this was the first burial
on earth after the deluge. And Noah prayed unto the Lord, saying,
Oh God thou hast given me a thousand years of life, and this child is
dead before it began to live on earth! And he begged of the Lord as
a blessing given to the burial-place of his child, that the women of
this town might never miscarry, which was granted; so that since
that time women, and female animals of every kind in this town are
all blessed with births in due time and long living. The length of the
grave of this untimely child of Noah is 40 feet and it is visited by
pilgrims.

EVLIA EFFENDI.

They suppose that a few souls are peculiarly gifted with the power
of quitting their bodies, of mounting into the skies, visiting distant
countries, and again returning and resuming them; they call the
mystery or prayer by which this power is obtained, the Mandiram.

CRAUFURD.

The plain of Kerbela is all desert, inhabited by none but by the dead,
and by roving wild hounds, the race of the dogs which licked the
blood of the martyrs, and which since are doomed to wander
through the wilderness.

EVLIA EFFENDI.

Shi whang, the K. of Tsin becoming Emperor, he chose for his


sepulchre the mountain Li, whose foundation he caused to dig, if we
may so speak, even to the centre of the earth. On its surface he
erected a mausoleum which might pass for a mountain. It was five
hundred feet high, and at least half a league in circumference. On
the outside was a vast tomb of stone, where one might walk as
easily as in the largest hall. In the middle was a sumptuous coffin,
and all around there were lamps and flambeaux, whose flames were
fed by human fat. Within this tomb, there was upon one side a pond
of quicksilver, upon which were scattered birds of gold and silver; on
the other a compleat magazine of moveables and arms; here and
there were the most precious jewels in thousands.

DU HALDE.

Emududakel, the Messenger of Death, receives the Soul as 'tis


breathed out of the body into a kind of a sack, and runs away with it
through briars and thorns and burning whirlwinds, which torment
the Soul very sensibly, till he arrives at the bank of a fiery current,
through which he is to pass to the other side in order to deliver the
soul to Emen, the God of the Dead.

LETTERS TO THE DANISH MISSIONARIES.

A curious story concerning the power which the Soul has been
supposed to possess of leaving the body, in a visible form, may be
found in the notes to the Vision of the Maid of Orleans. A more
extraordinary one occurs in the singularly curious work of Evlia
Effendi.

“Sultan Bajazet II. was a saint-monarch, like Sultan Orkhaun, or


Sultan Mustapha I. There exist different works relating his miracles
and deeds, but they are rare. The last seven years of his life he ate
nothing which had blood and life. One day longing much to eat calf's
or mutton's feet, he struggled long in that glorious contest with the
Soul, and as at last a well-seasoned dish of feet was put before him,
he said unto his Soul, ‘See my Soul, the feet are before thee, if thou
wantest to enjoy them, leave the body and feed on them.’ In the
same moment a living creature was seen to come out of his mouth,
which drank of the juice in the dish and having satisfied its appetite
endeavoured to return into the mouth from whence it came. But
Bajazet having prevented it with his hand to re-enter his mouth, it
fell on the ground, and the Sultan ordered it to be beaten. The
Pages arrived and kicked it dead on the ground. The Mufti of that
time decided that as the Soul was an essential part of man, this
dead Soul should be buried: prayers were performed over it, and the
dead Soul was interred in a small tomb near Bajazet's tomb. This is
the truth of the famous story of Bajazet II. having died twice and
having been twice buried. After this murder of his own soul, the
Sultan remained melancholy in the corner of retirement, taking no
part or interest in the affairs of government.”

The same anecdote of the Soul coming out of the mouth to relish a
most desired dish, had already happened to the Sheik Bajazet
Bostaumi, who had much longed to eat Mohallebi (a milk-dish) but
Bajazet Bostaumi permitted it to re-enter, and Sultan Bajazet killed
it; notwithstanding which he continued to live for some time longer.

See Josselyn for a similar tale.

When Mohammed took his journey upon Alborach, Gabriel (said he)
led me to the first Heaven, and the Angels in that Heaven graciously
received me, and they beheld me with smiles and with joy,
beseeching for me things prosperous and pleasant. One alone
among the Angels there sat, who neither prayed for my prosperity,
nor smiled; and Gabriel when I enquired of him who he was, replied,
never hath that Angel smiled, nor will smile, he is the Keeper of the
Fire, and I said to him is this the Angel who is called the well
beloved of God? and he replied, this is that Angel. Then said I bid
him that he show me the Fire, and Gabriel requesting him, he
removed the cover of the vessel of Fire, and the Fire ascending I
feared lest all things whatever that I saw should be consumed, and I
besought Gabriel that the Fire again might be covered. And so the
fire returned to its place, and it seemed then as when the Sun sinks
in the West, and the gloomy Angel, remaining the same, covered up
the Fire.

RODERICI XIMENES, ARC. TOL. HIST. ARAB.

You might also like