100% found this document useful (2 votes)
13 views

Download ebooks file Introduction to Computation and Programming Using Python Revised and Expanded Edition John V. Guttag all chapters

Using

Uploaded by

temixjora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
13 views

Download ebooks file Introduction to Computation and Programming Using Python Revised and Expanded Edition John V. Guttag all chapters

Using

Uploaded by

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

Download Full ebookname - Read Now at ebookname.

com

Introduction to Computation and Programming Using


Python Revised and Expanded Edition John V. Guttag

https://ebookname.com/product/introduction-to-computation-
and-programming-using-python-revised-and-expanded-edition-
john-v-guttag/

OR CLICK BUTTON

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Programming in Python 3 A Complete Introduction to the


Python Language 2nd Edition Summerfield

https://ebookname.com/product/programming-in-python-3-a-complete-
introduction-to-the-python-language-2nd-edition-summerfield/

ebookname.com

Intimate Matters Third Revised and Expanded Edition John


D’Emilio

https://ebookname.com/product/intimate-matters-third-revised-and-
expanded-edition-john-demilio/

ebookname.com

Beginning Python Using Python 2 6 and Python 3 1 Wrox


Programmer to Programmer James Payne

https://ebookname.com/product/beginning-python-using-python-2-6-and-
python-3-1-wrox-programmer-to-programmer-james-payne/

ebookname.com

Linked Courses for General Education and Integrative


Learning A Guide for Faculty and Administrators 1st
Edition Margot Soven
https://ebookname.com/product/linked-courses-for-general-education-
and-integrative-learning-a-guide-for-faculty-and-administrators-1st-
edition-margot-soven/
ebookname.com
Psychological aspects of cyberspace theory research
applications 1st Edition Azy Barak (Editor)

https://ebookname.com/product/psychological-aspects-of-cyberspace-
theory-research-applications-1st-edition-azy-barak-editor/

ebookname.com

Musicians as lifelong learners 32 Biographies 1st Edition


Rineke Smilde

https://ebookname.com/product/musicians-as-lifelong-
learners-32-biographies-1st-edition-rineke-smilde/

ebookname.com

Civilization and Disease Henry E. Sigerist

https://ebookname.com/product/civilization-and-disease-henry-e-
sigerist/

ebookname.com

Congo Solo Misadventures Two Degrees North 1933 restored


unadulterated ed 2011 Emily Hahn

https://ebookname.com/product/congo-solo-misadventures-two-degrees-
north-1933-restored-unadulterated-ed-2011-emily-hahn/

ebookname.com

Studies in the Meaning of Judaism 1st Edition Eugene B.


Borowitz

https://ebookname.com/product/studies-in-the-meaning-of-judaism-1st-
edition-eugene-b-borowitz/

ebookname.com
Encyclopedia Of Food And Culture 3 Volume Set 1st Edition
Solomon H. Katz (Editor In Chief)

https://ebookname.com/product/encyclopedia-of-food-and-
culture-3-volume-set-1st-edition-solomon-h-katz-editor-in-chief/

ebookname.com
Introduction to
Computation and
Programming Using Python
Introduction to
Computation and
Programming Using Python

Revised and Expanded Edition

John V. Guttag

The MIT Press


Cambridge, Massachusetts
London, England
©  2013  Massachusetts Institute of Technology  

All  rights  reserved.  No  part  of  this  book  may  be  reproduced  in  any  form  by  any  
electronic  or  mechanical  means  (including  photocopying,  recording,  or  information  
storage  and  retrieval)  without  permission  in  writing  from  the  publisher.  

MIT  Press  books  may  be  purchased  at  special  quantity  discounts  for  business  or  
sales  promotional  use.  For  information,  please  email  
special_sales@mitpress.mit.edu  or  write  to  Special  Sales  Department,  The  MIT  
Press,  55  Hayward  Street,  Cambridge,  MA  02142.  

Printed  and  bound  in  the  United  States  of  America.  

Library  of  Congress  Cataloging-­‐in-­‐Publication  Data  


 
Guttag,  John.  

Introduction  to  computation  and  programming  using  Python  /  John  V.  Guttag.  —  
Revised  and  expanded  edition.  

  pages   cm  

Includes  index.  

ISBN  978-­‐0-­‐262-­‐52500-­‐8  (pbk.  :  alk.  paper)    

1.    Python  (Computer  program  language)   2.    Computer  programming.   I.  Title.    

QA76.73.P48G88   2013  

005.13'3—dc23  

10   9   8   7   6   5   4   3   2   1  
To my family:

Olga
David
Andrea
Michael
Mark
Addie
CONTENTS

PREFACE .......................................................................................................xiii  
ACKNOWLEDGMENTS..................................................................................... xv  
1   GETTING STARTED .................................................................................... 1  
2   INTRODUCTION TO PYTHON ...................................................................... 7  
2.1   The Basic Elements of Python ............................................................... 8  
2.1.1   Objects, Expressions, and Numerical Types .................................... 9  
2.1.2   Variables and Assignment ............................................................ 11  
2.1.3   IDLE ............................................................................................ 13  
2.2   Branching Programs ........................................................................... 14  
2.3   Strings and Input ............................................................................... 16  
2.3.1   Input ............................................................................................ 18  
2.4   Iteration .............................................................................................. 18  
3   SOME SIMPLE NUMERICAL PROGRAMS .................................................. 21  
3.1   Exhaustive Enumeration .................................................................... 21  
3.2   For Loops............................................................................................ 23  
3.3   Approximate Solutions and Bisection Search ...................................... 25  
3.4   A Few Words About Using Floats ........................................................ 29  
3.5   Newton-Raphson ................................................................................ 32  
4   FUNCTIONS, SCOPING, and ABSTRACTION ............................................. 34  
4.1   Functions and Scoping ....................................................................... 35  
4.1.1   Function Definitions ..................................................................... 35  
4.1.2   Keyword Arguments and Default Values ....................................... 36  
4.1.3   Scoping ........................................................................................ 37  

4.2   Specifications ..................................................................................... 41  


4.3   Recursion ........................................................................................... 44  
4.3.1   Fibonacci Numbers ...................................................................... 45  
4.3.2   Palindromes ................................................................................. 48  

4.4   Global Variables ................................................................................. 50  


4.5   Modules .............................................................................................. 51  
4.6   Files ................................................................................................... 53  
viii

5 STRUCTURED TYPES, MUTABILITY, AND HIGHER-ORDER FUNCTIONS .. 56


5.1 Tuples ................................................................................................ 56
5.1.1 Sequences and Multiple Assignment............................................. 57

5.2 Lists and Mutability ............................................................................ 58


5.2.1 Cloning ........................................................................................ 63
5.2.2 List Comprehension ..................................................................... 63
5.3 Functions as Objects .......................................................................... 64

5.4 Strings, Tuples, and Lists ................................................................... 66


5.5 Dictionaries ........................................................................................ 67
6 TESTING AND DEBUGGING...................................................................... 70
6.1 Testing................................................................................................ 70
6.1.1 Black-Box Testing ........................................................................ 71
6.1.2 Glass-Box Testing ........................................................................ 73
6.1.3 Conducting Tests ......................................................................... 74
6.2 Debugging .......................................................................................... 76
6.2.1 Learning to Debug ........................................................................ 78
6.2.2 Designing the Experiment ............................................................ 79
6.2.3 When the Going Gets Tough ......................................................... 81
6.2.4 And When You Have Found “The” Bug .......................................... 82
7 EXCEPTIONS AND ASSERTIONS .............................................................. 84
7.1 Handling Exceptions ........................................................................... 84
7.2 Exceptions as a Control Flow Mechanism ........................................... 87
7.3 Assertions ........................................................................................... 90
8 CLASSES AND OBJECT-ORIENTED PROGRAMMING ............................... 91
8.1 Abstract Data Types and Classes ........................................................ 91
8.1.1 Designing Programs Using Abstract Data Types ............................ 96
8.1.2 Using Classes to Keep Track of Students and Faculty ................... 96
8.2 Inheritance ......................................................................................... 99
8.2.1 Multiple Levels of Inheritance ..................................................... 101
8.2.2 The Substitution Principle .......................................................... 102
8.3 Encapsulation and Information Hiding .............................................. 103
8.3.1 Generators ................................................................................. 106
8.4 Mortgages, an Extended Example ..................................................... 108
ix

9   A SIMPLISTIC INTRODUCTION TO ALGORITHMIC COMPLEXITY ............ 113  


9.1   Thinking About Computational Complexity ....................................... 113  
9.2   Asymptotic Notation .......................................................................... 116  

9.3   Some Important Complexity Classes ................................................. 118  


9.3.1   Constant Complexity .................................................................. 118  
9.3.2   Logarithmic Complexity .............................................................. 118  
9.3.3   Linear Complexity ...................................................................... 119  

9.3.4   Log-Linear Complexity ................................................................ 120  


9.3.5   Polynomial Complexity ............................................................... 120  
9.3.6   Exponential Complexity .............................................................. 121  
9.3.7   Comparisons of Complexity Classes............................................ 123  
10   SOME SIMPLE ALGORITHMS AND DATA STRUCTURES ......................... 125  
10.1   Search Algorithms .......................................................................... 126  
10.1.1   Linear Search and Using Indirection to Access Elements .......... 126  
10.1.2   Binary Search and Exploiting Assumptions .............................. 128  
10.2   Sorting Algorithms .......................................................................... 131  
10.2.1   Merge Sort................................................................................ 132  
10.2.2   Exploiting Functions as Parameters.......................................... 135  
10.2.3   Sorting in Python ..................................................................... 136  
10.3   Hash Tables .................................................................................... 137  
11   PLOTTING AND MORE ABOUT CLASSES ................................................ 141  
11.1   Plotting Using PyLab ....................................................................... 141  
11.2   Plotting Mortgages, an Extended Example ....................................... 146  
12   STOCHASTIC PROGRAMS, PROBABILITY, AND STATISTICS ................... 152  
12.1   Stochastic Programs ....................................................................... 153  
12.2   Inferential Statistics and Simulation ............................................... 155  
12.3   Distributions .................................................................................. 166  
12.3.1   Normal Distributions and Confidence Levels ............................. 168  
12.3.2   Uniform Distributions .............................................................. 170  
12.3.3   Exponential and Geometric Distributions ................................. 171  
12.3.4   Benford’s Distribution .............................................................. 173  
12.4   How Often Does the Better Team Win? ............................................ 174  
12.5   Hashing and Collisions ................................................................... 177  
x

13 RANDOM WALKS AND MORE ABOUT DATA VISUALIZATION ................. 179
13.1 The Drunkard’s Walk ...................................................................... 179
13.2 Biased Random Walks .................................................................... 186

13.3 Treacherous Fields .......................................................................... 191


14 MONTE CARLO SIMULATION .................................................................. 193
14.1 Pascal’s Problem ............................................................................. 194
14.2 Pass or Don’t Pass? ......................................................................... 195

14.3 Using Table Lookup to Improve Performance ................................... 199

14.4 Finding π ........................................................................................ 200


14.5 Some Closing Remarks About Simulation Models ............................ 204
15 UNDERSTANDING EXPERIMENTAL DATA .............................................. 207
15.1 The Behavior of Springs .................................................................. 207
15.1.1 Using Linear Regression to Find a Fit ....................................... 210
15.2 The Behavior of Projectiles .............................................................. 214
15.2.1 Coefficient of Determination ..................................................... 216

15.2.2 Using a Computational Model ................................................... 217


15.3 Fitting Exponentially Distributed Data ............................................ 218
15.4 When Theory Is Missing .................................................................. 221
16 LIES, DAMNED LIES, AND STATISTICS .................................................. 222

16.1 Garbage In Garbage Out (GIGO) ...................................................... 222


16.2 Pictures Can Be Deceiving .............................................................. 223
16.3 Cum Hoc Ergo Propter Hoc ............................................................... 225
16.4 Statistical Measures Don’t Tell the Whole Story ............................... 226

16.5 Sampling Bias................................................................................. 228


16.6 Context Matters .............................................................................. 229
16.7 Beware of Extrapolation .................................................................. 229
16.8 The Texas Sharpshooter Fallacy ...................................................... 230

16.9 Percentages Can Confuse ................................................................ 232


16.10 Just Beware .................................................................................. 233
17 KNAPSACK AND GRAPH OPTIMIZATION PROBLEMS .............................. 234
17.1 Knapsack Problems ........................................................................ 234
17.1.1 Greedy Algorithms .................................................................... 235
17.1.2 An Optimal Solution to the 0/1 Knapsack Problem ................... 238
xi

17.2   Graph Optimization Problems ......................................................... 240  


17.2.1   Some Classic Graph-Theoretic Problems ................................... 244  
17.2.2   The Spread of Disease and Min Cut .......................................... 245  

17.2.3   Shortest Path: Depth-First Search and Breadth-First Search .... 246  
18   DYNAMIC PROGRAMMING ..................................................................... 252  
18.1   Fibonacci Sequences, Revisited ....................................................... 252  
18.2   Dynamic Programming and the 0/1 Knapsack Problem................... 254  

18.3   Dynamic Programming and Divide-and-Conquer ............................. 261  


19   A QUICK LOOK AT MACHINE LEARNING ................................................ 262  
19.1   Feature Vectors .............................................................................. 264  
19.2   Distance Metrics ............................................................................. 266  
19.3   Clustering ....................................................................................... 270  
19.4   Types Example and Cluster............................................................. 272  
19.5   K-means Clustering ........................................................................ 274  
19.6   A Contrived Example ...................................................................... 276  
19.7   A Less Contrived Example ............................................................... 280  
19.8   Wrapping Up................................................................................... 286  
PYTHON 2.7 QUICK REFERENCE ................................................................. 287  
INDEX .......................................................................................................... 289  
PREFACE

This book is based on an MIT course that has been offered twice a year since
2006. The course is aimed at students with little or no prior programming
experience who have desire to understand computational approaches to problem
solving. Each year, a few of the students in the class use the course as a
stepping stone to more advanced computer science courses. But for most of the
students it will be their only computer science course.
Because the course will be the only computer science course for most of the
students, we focus on breadth rather than depth. The goal is to provide
students with a brief introduction to many topics, so that they will have an idea
of what’s possible when the time comes to think about how to use computation
to accomplish a goal. That said, it is not a “computation appreciation” course.
It is a challenging and rigorous course in which the students spend a lot of time
and effort learning to bend the computer to their will.
The main goal of this book is to help you, the reader, become skillful at making
productive use of computational techniques. You should learn to apply
computational modes of thoughts to frame problems and to guide the process of
extracting information from data in a computational manner. The primary
knowledge you will take away from this book is the art of computational problem
solving.
The book is a bit eccentric. Part 1 (Chapters 1-8) is an unconventional
introduction to programming in Python. We braid together four strands of
material:

• The basics of programming,


• The Python programming language,
• Concepts central to understanding computation, and
• Computational problem solving techniques.
We cover most of Python’s features, but the emphasis is on what one can do
with a programming language, not on the language itself. For example, by the
end of Chapter 3 the book has covered only a small fraction of Python, but it has
already introduced the notions of exhaustive enumeration, guess-and-check
algorithms, bisection search, and efficient approximation algorithms. We
introduce features of Python throughout the book. Similarly, we introduce
aspects of programming methods throughout the book. The idea is to help you
learn Python and how to be a good programmer in the context of using
computation to solve interesting problems.
Part 2 (Chapters 9-16) is primarily about using computation to solve problems.
It assumes no knowledge of mathematics beyond high school algebra, but it
does assume that the reader is comfortable with rigorous thinking and not
intimidated by mathematical concepts. It covers some of the usual topics found
in an introductory text, e.g., computational complexity and simple algorithms.
xiv Preface

But the bulk of this part of the book is devoted to topics not found in most
introductory texts: data visualization, probabilistic and statistical thinking,
simulation models, and using computation to understand data.

Part 3 (Chapters 17-19) looks at three slightly advanced topics—optimization


problems, dynamic programming, and clustering.
Part 1 can form the basis of a self-contained course that can be taught in a
quarter or half a semester. Experience suggests that it is quite comfortable to fit
both Parts 1 and 2 of this book into a full-semester course. When the material
in Part 3 is included, the course becomes more demanding than is comfortable
for many students.
The book has two pervasive themes: systematic problem solving and the power
of abstraction. When you have finished this book you should have:

• Learned a language, Python, for expressing computations,


• Learned a systematic approach to organizing, writing and debugging
medium-sized programs,
• Developed an informal understanding of computational complexity,
• Developed some insight into the process of moving from an ambiguous
problem statement to a computational formulation of a method for
solving the problem,
• Learned a useful set of algorithmic and problem reduction techniques,
• Learned how to use randomness and simulations to shed light on
problems that don’t easily succumb to closed-form solutions, and
• Learned how to use computational tools, including simple statistical and
visualization tools, to model and understand data.
Programming is an intrinsically difficult activity. Just as “there is no royal road
to geometry,”1 there is no royal road to programming. It is possible to deceive
students into thinking that they have learned how to program by having them
complete a series of highly constrained “fill in the blank” programming
problems. However, this does not prepare students for figuring out how to
harness computational thinking to solve problems.
If you really want to learn the material, reading the book will not be enough. At
the very least you should try running some of the code in the book. All of the
code in the book can be found at http://mitpress.mit.edu/ICPPRE. Various
versions of the course have been available on MIT’s OpenCourseWare (OCW)
Web site since 2008. The site includes video recordings of lectures and a
complete set of problem sets and exams. Since the fall of 2012, edX and MITx,
have offered an online version of this course. We strongly recommend that you
do the problem sets associated with one of the OCW or edX offerings.

1 This was Euclid’s purported response, circa 300 BC, to King Ptolemy’s request for an

easier way to learn mathematics.


ACKNOWLEDGMENTS

This book grew out of a set of lecture notes that I prepared while teaching an
undergraduate course at MIT. The course, and therefore this book, benefited
from suggestions from faculty colleagues (especially Eric Grimson, Srinivas
Devadas, and Fredo Durand), teaching assistants, and the students who took
the course.
The process of transforming my lecture notes into a book proved far more
onerous than I had expected. Fortunately, this misguided optimism lasted long
enough to keep me from giving up. The encouragement of colleagues and family
also helped keep me going.

Eric Grimson, Chris Terman, and David Guttag provided vital help. Eric, who is
MIT’s Chancellor, managed to find the time to read almost the entire book with
great care. He found numerous errors (including an embarrassing, to me,
number of technical errors) and pointed out places where necessary
explanations were missing. Chris also read parts of the manuscript and
discovered errors. He also helped me battle Microsoft Word, which we
eventually persuaded to do most of what we wanted. David overcame his
aversion to computer science, and proofread multiple chapters.

Preliminary versions of this book were used in the MIT course 6.00 and the MITx
course 6.00x. A number of students in these courses pointed out errors. One
6.00x student, J.C. Cabrejas, was particularly helpful. He found a large number
of typos, and more than a few technical errors.

Like all successful professors, I owe a great deal to my graduate students. The
photo on the back cover of this book depicts me supporting some of my current
students. In the lab, however, it is they who support me. In addition to doing
great research (and letting me take some of the credit for it), Guha
Balakrishnan, Joel Brooks, Ganeshapillai Gartheeban, Jen Gong, Yun Liu,
Anima Singh, Jenna Wiens, and Amy Zhao all provided useful comments on this
manuscript.
I owe a special debt of gratitude to Julie Sussman, P.P.A. Until I started working
with Julie, I had no idea how much difference an editor could make. I had
worked with capable copy editors on previous books, and thought that was what
I needed for this book. I was wrong. I needed a collaborator who could read the
book with the eyes of a student, and tell me what needed to be done, what
should be done, and what could be done if I had the time and energy to do it.
Julie buried me in “suggestions” that were too good to ignore. Her combined
command of both the English language and programming is quite remarkable.
Finally, thanks to my wife, Olga, for pushing me to finish and for pitching in at
critical times.
1 GETTING STARTED

A computer does two things, and two things only: it performs calculations and it
remembers the results of those calculations. But it does those two things
extremely well. The typical computer that sits on a desk or in a briefcase
performs a billion or so calculations a second. It’s hard to image how truly fast
that is. Think about holding a ball a meter above the floor, and letting it go. By
the time it reaches the floor, your computer could have executed over a billion
instructions. As for memory, a typical computer might have hundreds of
gigabytes of storage. How big is that? If a byte (the number of bits, typically
eight, required to represent one character) weighed one ounce (which it doesn’t),
100 gigabytes would weigh more than 3,000,000 tons. For comparison, that’s
roughly the weight of all the coal produced in a year in the U.S.
For most of human history, computation was limited by the speed of calculation
of the human brain and the ability to record computational results with the
human hand. This meant that only the smallest problems could be attacked
computationally. Even with the speed of modern computers, there are still
problems that are beyond modern computational models (e.g., understanding
climate change), but more and more problems are proving amenable to
computational solution. It is our hope that by the time you finish this book, you
will feel comfortable bringing computational thinking to bear on solving many of
the problems you encounter during your studies, work, and even everyday life.
What do we mean by computational thinking?
All knowledge can be thought of as either declarative or imperative. Declarative
knowledge is composed of statements of fact. For example, “the square root of x
is a number y such that y*y = x.” This is a statement of fact. Unfortunately it
doesn’t tell us how to find a square root.
Imperative knowledge is “how to” knowledge, or recipes for deducing
information. Heron of Alexandria was the first to document a way to compute
the square root of a number.2 His method can be summarized as:

• Start with a guess, g.


• If g*g is close enough to x, stop and say that g is the answer.

• Otherwise create a new guess by averaging g and x/g, i.e., (g + x/g)/2.


• Using this new guess, which we again call g, repeat the process until g*g
is close enough to x.

2 Many believe that Heron was not the inventor of this method, and indeed there is some

evidence that it was well known to the ancient Babylonians.


2 Chapter 1. Getting Started

Consider, for example, finding the square root of 25.


1. Set g to some arbitrary value, e.g., 3.
2. We decide that 3*3 = 9 is not close enough to 25.
3. Set g to (3 + 25/3)/2 = 5.67.3
4. We decide that 5.67*5.67 = 32.15 is still not close enough to 25.
5. Set g to (5.67 + 25/5.67)/2 = 5.04
6. We decide that 5.04*5.04 = 25.4 is close enough, so we stop and declare 5.04
to be an adequate approximation to the square root of 25.
Note that the description of the method is a sequence of simple steps, together
with a flow of control that specifies when each step is to be executed. Such a
description is called an algorithm.4 This algorithm is an example of a guess-
and-check algorithm. It is based on the fact that it is easy to check whether or
not a guess is a good one.
A bit more formally, an algorithm is a finite list of instructions that describe a
computation that when executed on a provided set of inputs will proceed
through a set of well-defined states and eventually produce an output.
An algorithm is a bit like a recipe from a cookbook:
1. Put custard mixture over heat.
2. Stir.
3. Dip spoon in custard.
4. Remove spoon and run finger across back of spoon.
5. If clear path is left, remove custard from heat and let cool.
6. Otherwise repeat.
It includes some tests for deciding when the process is complete, as well as
instructions about the order in which to execute instructions, sometimes
jumping to some instruction based on a test.
So how does one capture this idea of a recipe in a mechanical process? One way
would be to design a machine specifically intended to compute square roots.
Odd as this may sound, the earliest computing machines were, in fact, fixed-
program computers, meaning they were designed to do very specific things, and
were mostly tools to solve a specific mathematical problem, e.g., to compute the
trajectory of an artillery shell. One of the first computers (built in 1941 by
Atanasoff and Berry) solved systems of linear equations, but could do nothing
else. Alan Turing’s bombe machine, developed during World War II, was
designed strictly for the purpose of breaking German Enigma codes. Some very
simple computers still use this approach. For example, a four-function
calculator is a fixed-program computer. It can do basic arithmetic, but it cannot

3 For simplicity, we are rounding results.


4 The word “algorithm” is derived from the name of the Persian mathematician

Muhammad ibn Musa al-Khwarizmi.


Chapter 1. Getting Started 3

be used as a word processor or to run video games. To change the program of


such a machine, one has to replace the circuitry.
The first truly modern computer was the Manchester Mark 1.5 It was
distinguished from its predecessors by the fact that it was a stored-program
computer. Such a computer stores (and manipulates) a sequence of
instructions, and has a set of elements that will execute any instruction in that
sequence. By creating an instruction-set architecture and detailing the
computation as a sequence of instructions (i.e., a program), we make a highly
flexible machine. By treating those instructions in the same way as data, a
stored-program machine can easily change the program, and can do so under
program control. Indeed, the heart of the computer then becomes a program
(called an interpreter) that can execute any legal set of instructions, and thus
can be used to compute anything that one can describe using some basic set of
instructions.
Both the program and the data it manipulates reside in memory. Typically there
is a program counter that points to a particular location in memory, and
computation starts by executing the instruction at that point. Most often, the
interpreter simply goes to the next instruction in the sequence, but not always.
In some cases, it performs a test, and on the basis of that test, execution may
jump to some other point in the sequence of instructions. This is called flow of
control, and is essential to allowing us to write programs that perform complex
tasks.
Returning to the recipe metaphor, given a fixed set of ingredients a good chef
can make an unbounded number of tasty dishes by combining them in different
ways. Similarly, given a small fixed set of primitive elements a good programmer
can produce an unbounded number of useful programs. This is what makes
programming such an amazing endeavor.
To create recipes, or sequences of instructions, we need a programming
language in which to describe these things, a way to give the computer its
marching orders.
In 1936, the British mathematician Alan Turing described a hypothetical
computing device that has come to be called a Universal Turing Machine. The
machine had an unbounded memory in the form of tape on which one could
write zeros and ones, and some very simple primitive instructions for moving,
reading, and writing to the tape. The Church-Turing thesis states that if a
function is computable, a Turing Machine can be programmed to compute it.
The “if” in the Church-Turing thesis is important. Not all problems have
computational solutions. For example, Turing showed that it is impossible to
write a program that given an arbitrary program, call it P, prints true if and only
if P will run forever. This is known as the halting problem.

5 This computer was built at the University of Manchester, and ran its first program in

1949. It implemented ideas previously described by John von Neumann and was
anticipated by the theoretical concept of the Universal Turing Machine described by Alan
Turing in 1936.
4 Chapter 1. Getting Started

The Church-Turing thesis leads directly to the notion of Turing completeness.


A programming language is said to be Turing complete if it can be used to
simulate a universal Turing Machine. All modern programming languages are
Turing complete. As a consequence, anything that can be programmed in one
programming language (e.g., Python) can be programmed in any other
programming language (e.g., Java). Of course, some things may be easier to
program in a particular language, but all languages are fundamentally equal
with respect to computational power.
Fortunately, no programmer has to build programs out of Turing’s primitive
instructions. Instead, modern programming languages offer a larger, more
convenient set of primitives. However, the fundamental idea of programming as
the process of assembling a sequence of operations remains central.
Whatever set of primitives one has, and whatever methods one has for using
them, the best thing and the worst thing about programming are the same: the
computer will do exactly what you tell it to do. This is a good thing because it
means that you can make it do all sorts of fun and useful things. It is a bad
thing because when it doesn’t do what you want it to do, you usually have
nobody to blame but yourself.
There are hundreds of programming languages in the world. There is no best
language (though one could nominate some candidates for worst). Different
languages are better or worse for different kinds of applications. MATLAB, for
example, is an excellent language for manipulating vectors and matrices. C is a
good language for writing the programs that control data networks. PHP is a
good language for building Web sites. And Python is a good general-purpose
language.
Each programming language has a set of primitive constructs, a syntax, a static
semantics, and a semantics. By analogy with a natural language, e.g., English,
the primitive constructs are words, the syntax describes which strings of words
constitute well-formed sentences, the static semantics defines which sentences
are meaningful, and the semantics defines the meaning of those sentences. The
primitive constructs in Python include literals (e.g., the number 3.2 and the
string 'abc') and infix operators (e.g., + and /).
The syntax of a language defines which strings of characters and symbols are
well formed. For example, in English the string “Cat dog boy.” is not a
syntactically valid sentence, because the syntax of English does not accept
sentences of the form <noun> <noun> <noun>. In Python, the sequence of
primitives 3.2 + 3.2 is syntactically well formed, but the sequence 3.2 3.2 is
not.
The static semantics defines which syntactically valid strings have a meaning.
In English, for example, the string “I are big,” is of the form <pronoun> <linking
verb> <adjective>, which is a syntactically acceptable sequence. Nevertheless, it
is not valid English, because the noun “I” is singular and the verb “are” is plural.
This is an example of a static semantic error. In Python, the sequence
3.2/'abc' is syntactically well formed (<literal> <operator> <literal>), but
Chapter 1. Getting Started 5

produces a static semantic error since it is not meaningful to divide a number by


a string of characters.
The semantics of a language associates a meaning with each syntactically
correct string of symbols that has no static semantic errors. In natural
languages, the semantics of a sentence can be ambiguous. For example, the
sentence “I cannot praise this student too highly,” can be either flattering or
damning. Programming languages are designed so that each legal program has
exactly one meaning.
Though syntax errors are the most common kind of error (especially for those
learning a new programming language), they are the least dangerous kind of
error. Every serious programming language does a complete job of detecting
syntactic errors, and will not allow users to execute a program with even one
syntactic error. Furthermore, in most cases the language system gives a
sufficiently clear indication of the location of the error that it is obvious what
needs to be done to fix it.
The situation with respect to static semantic errors is a bit more complex. Some
programming languages, e.g., Java, do a lot of static semantic checking before
allowing a program to be executed. Others, e.g., C and Python (alas), do
relatively less static semantic checking. Python does do a considerable amount
of static semantic checking while running a program. However, it does not
catch all static semantic errors. When these errors are not detected, the
behavior of a program is often unpredictable. We will see examples of this later
in the book.
One doesn’t usually speak of a program as having a semantic error. If a
program has no syntactic errors and no static semantic errors, it has a meaning,
i.e., it has semantics. Of course, that isn’t to say that it has the semantics that
its creator intended it to have. When a program means something other than
what its creator thinks it means, bad things can happen.
What might happen if the program has an error, and behaves in an unintended
way?

• It might crash, i.e., stop running and produce some sort of obvious
indication that it has done so. In a properly designed computing system,
when a program crashes it does not do damage to the overall system. Of
course, some very popular computer systems don’t have this nice
property. Almost everyone who uses a personal computer has run a
program that has managed to make it necessary to restart the whole
computer.

• Or it might keep running, and running, and running, and never stop. If
one has no idea of approximately how long the program is supposed to
take to do its job, this situation can be hard to recognize.

• Or it might run to completion and produce an answer that might, or


might not, be correct.
6 Chapter 1. Getting Started

Each of these is bad, but the last of them is certainly the worst, When a
program appears to be doing the right thing but isn’t, bad things can follow.
Fortunes can be lost, patients can receive fatal doses of radiation therapy,
airplanes can crash, etc.
Whenever possible, programs should be written in such a way that when they
don’t work properly, it is self-evident. We will discuss how to do this throughout
the book.

Finger Exercise: Computers can be annoyingly literal. If you don’t tell them
exactly what you want them to do, they are likely to do the wrong thing. Try
writing an algorithm for driving between two destinations. Write it the way you
would for a person, and then imagine what would happen if that person
executed the algorithm exactly as written. For example, how many traffic tickets
might they get?
2 INTRODUCTION TO PYTHON

Though each programming language is different (though not as different as their


designers would have us believe), there are some dimensions along which they
can be related.

• Low-level versus high-level refers to whether we program using


instructions and data objects at the level of the machine (e.g., move 64
bits of data from this location to that location) or whether we program
using more abstract operations (e.g., pop up a menu on the screen) that
have been provided by the language designer.
• General versus targeted to an application domain refers to whether
the primitive operations of the programming language are widely
applicable or are fine-tuned to a domain. For example Adobe Flash is
designed to facilitate adding animation and interactivity to Web pages,
but you wouldn’t want to use it build a stock portfolio analysis program.
• Interpreted versus compiled refers to whether the sequence of
instructions written by the programmer, called source code, is executed
directly (by an interpreter) or whether it is first converted (by a compiler)
into a sequence of machine-level primitive operations. (In the early days
of computers, people had to write source code in a language that was
very close to the machine code that could be directly interpreted by the
computer hardware.) There are advantages to both approaches. It is
often easier to debug programs written in languages that are designed to
be interpreted, because the interpreter can produce error messages that
are easy to correlate with the source code. Compiled languages usually
produce programs that run more quickly and use less space.
In this book, we use Python. However, this book is not about Python. It will
certainly help readers learn Python, and that’s a good thing. What is much
more important, however, is that careful readers will learn something about how
to write programs that solve problems. This skill can be transferred to any
programming language.
Python is a general-purpose programming language that can be used effectively
to build almost any kind of program that does not need direct access to the
computer’s hardware. Python is not optimal for programs that have high
reliability constraints (because of its weak static semantic checking) or that are
built and maintained by many people or over a long period of time (again
because of the weak static semantic checking).
However, Python does have several advantages over many other languages. It is
a relatively simple language that is easy to learn. Because Python is designed to
be interpreted, it can provide the kind of runtime feedback that is especially
helpful to novice programmers. There are also a large number of freely available
libraries that interface to Python and provide useful extended functionality.
Several of those are used in this book.
8 Chapter 2. Introduction to Python

Now we are ready to start learning some of the basic elements of Python. These
are common to almost all programming languages in concept, though not
necessarily in detail.

The reader should be forewarned that this book is by no means a comprehensive


introduction to Python. We use Python as a vehicle to present concepts related
to computational problem solving and thinking. The language is presented in
dribs and drabs, as needed for this ulterior purpose. Python features that we
don’t need for that purpose are not presented at all. We feel comfortable about
not covering the entire language because there are excellent online resources
describing almost every aspect of the language. When we teach the course on
which this book is based, we suggest to the students that they rely on these free
online resources for Python reference material.
Python is a living language. Since its introduction by Guido von Rossum in
1990, it has undergone many changes. For the first decade of its life, Python
was a little known and little used language. That changed with the arrival of
Python 2.0 in 2000. In addition to incorporating a number of important
improvements to the language itself, it marked a shift in the evolutionary path of
the language. A large number of people began developing libraries that
interfaced seamlessly with Python, and continuing support and development of
the Python ecosystem became a community-based activity. Python 3.0 was
released at the end of 2008. This version of Python cleaned up many of the
inconsistencies in the design of the various releases of Python 2 (often referred
to as Python 2.x). However, it was not backward compatible. That meant that
most programs written for earlier versions of Python could not be run using
implementations of Python 3.0.
The backward incompatibility presents a problem for this book. In our view,
Python 3.0 is clearly superior to Python 2.x. However, at the time of this
writing, some important Python libraries still do not work with Python 3. We
will, therefore, use Python 2.7 (into which many of the most important features
of Python 3 have been “back ported”) throughout this book.

2.1 The Basic Elements of Python


A Python program, sometimes called a script, is a sequence of definitions and
commands. These definitions are evaluated and the commands are executed by
the Python interpreter in something called the shell. Typically, a new shell is
created whenever execution of a program begins. In most cases, a window is
associated with the shell.
We recommend that you start a Python shell now, and use it to try the examples
contained in the remainder of the chapter. And, for that matter, later in the
book as well.
A command, often called a statement, instructs the interpreter to do
something. For example, the statement print 'Yankees rule!' instructs the
interpreter to output the string Yankees rule! to the window associated with the
shell.
Discovering Diverse Content Through
Random Scribd Documents
then, to this first Assembly, we shall present our materials in the
following order, viz.:—
I. The Acts of the Assembly, which were extracted by the Clerk,
and printed in the year 1639.
II. An Abstract of the Proceedings, and a List or Index of all the
Acts of the Assembly, authenticated by Archibald Johnston the Clerk,
copied from an extract thereof under his hand, which is deposited in
the Advocates’ Library.
III. Historical Documents relative to the events which occurred in
Scotland betwixt 1633, and the sitting of the Assembly in Nov. 1638.
IV. A Report of the Discussions in that Assembly, from an
unpublished contemporary M.S.
V. Notes and Illustrations of these proceedings, derived from
contemporary and collateral sources.
In closing these introductory remarks, we must guard ourselves
against the possible imputation of being blind and indiscriminate
admirers of the Covenanters. We are fully alive to all the
exceptionable points in their character and career; and we should
have studied our country’s history and human nature very
superficially indeed, if we had not, long ere now, discovered the
infirmities and obliquities which were mingled with their higher
attributes. It cannot be doubted by any man who has studied the
history of the period of which we have given a rapid sketch, that
they often swerved from what was the straight path of rectitude;
and it is impossible to peruse even the most partial narrative of their
consultations, without also discerning, in the policy and proceedings
of the Covenanters, the alloy of selfish interests and grovelling
passions—the fumes of fanaticism, the unrectified workings of a
semi-barbarous spirit, and much democratic insolence. There was
withal a tone of preternatural sanctity assumed, which savours
strongly of hypocrisy in many of the individuals who figured in their
counsels. But, after giving full effect to all these deductions from
their merits, we can never forget that these deformities were, in a
great measure, created and brought prominently into view by
circumstances which rendered it almost impossible that such
characteristics should not have been called into existence. We can
never forget that they were goaded into the courses which they
pursued by an unjustifiable series of aggressions on the dearest
interests of human beings—by an open and outrageous assumption
of arbitrary power over the lives, property, and liberties, civil and
religious, of the country; and that their numerous loyal and dutiful
supplications for redress and security, were treated with duplicity
and contempt. And above all, we can never forget that it is to the
noble stand which was made by the Covenanters of Scotland against
arbitrary power and Popish tyranny in disguise, two hundred years
ago, that we are, in a great measure, indebted for the enjoyment of
the invaluable Protestant Institutions in Church and State which we
now possess, and which, in the course of time, and from new
combinations of causes, seem, in the present day, to be once more
exposed to similar perils. May the present generation, in the
maintenance of these precious institutions, avoid those errors—the
simulation and the intolerance of former times—and may their
patriotism be elevated to purity by imitating only the virtues of the
Scottish Covenanters!
THE
PRINCIPALL ACTS
OF THE
SOLEMNE GENERALL ASSEMBLY
OF THE
KIRK OF SCOTLAND,
Indicted by the Kings Majestie, and conveened at Glasgow the XXI. of
Nov. 1638; Visied, Collected, and Extracted forth of the Register of
the Acts of the Assembly, by the Clerk thereof. Edinburgh, printed
by the Heirs of Andrew Hart. Anno Dom. 1639.
The King’s Commission to James Marquesse of
Hamiltoun.23

C
AROLUS Dei gratia, Magnæ Britanniæ, Franciæ, & Hiberniæ Rex,
fidcique Defensor, Omnibus probis hominibus suis ad quos
præsentes literæ pervenerint, Salutem. Sciatis nos considerantes
magnos in hoc regno nostro Scotiæ non ita pridem exortos tumultus,
ad quos quidem componendos multiplices regiæ nostræ voluntatis
declaretiones promulgavimus, quæ tamen minorem spe nostrâ
effectum hactenus sortitæ sunt: Et nunc statuentes ex pio erga
dictum antiquum regnum nostrum affectu, ut omnia gratiosè
stabiliantur & instaurentur, quod (per absentiam nostram) non aliâ
ratione melius effici potest quam fideli aliquo Delegato constituto, cui
potestatem credere possimus tumultus hujusmodi consopiendi,
aliaque officia præstandi, quæ in bonum & commodum dicti antiqui
regni nostri eidem Delegato nostro imperare nobis videbitur. Cumque
satis compertum habeamus obsequium, diligentiam, & fidem
prædilecti nostri consanguinei & consiliarii, Jacobi Marchionis
Hamiltonii, Comitis Arraniœ & Cantabrigiæ, Domini Aven & Innerdail,
&c. eundemque ad imperata nostra exequenda sufficienter
inatructum esse, Idcirco fecisse & constituisse, tenoreque
præsentium facere & constituere præfatum prædilectum nostrum
consanguineum & consiliarium Jacobum Marchionem de Hamiltoun
nostrum Commissionarium ad effectum subscriptum. Cum potestate
dicto Jacobo Marchioni de Hamiltoun, &c. dictum regnum nostrum
adeundi, ibidemque præfatos tumultus in dicto regno nostro
componendi, aliaque officia à nobis eidem committenda in dicti regni
nostri bonum & commodum ibi præstandi, eoque Concilium nostrum
quibus locis & temporibus ei visum fuerit convocandi, acrationem &
ordinem in præmissis exequendis servandum declarandi &
præscribendi; & quæcunque alia ad Commissionis hujus capita pro
commissâ sibi fide exequenda, eandemque ad absolutum finem
perducendam et prosequendam conferre possunt tam in Concilio
quam extra Concilium, nostro nomine efficiendi & præstandi; idque
similitèr & adeo liberè ac si nos in sacrosancta nostra persona ibidem
adessemus. Præterea cum plena potestate dicto Jacobo Marchioni de
Hamiltoun, prout sibi videbitur nostro servitio & bono dicti regni nostri
conducere, conventum omnium ordinum ejusdem regni nostri
indicendi, ac publica comitia & conventus eorundem ordinum
eorumve alterius vel utriusque quibus temporibus & locis sibi visum
fuerit statuendi, & ibidem nostram sacratissimam personam cum
omnibus honoribus & privilegiis supremo Commissionario nostri
Parliamenti & publici conventus incumben similiter adeoqae amplè
sicut quivis supremus Commissionarius quocunque tempore
retroacto gavisus est gerendi: Necnon cum potestate præfato Jacobo
Marchioni de Hamiltoun Synodos nationales ecclesiæ dicti regni nostri
tenendas temporibus & locis quibus sibi visum fuerit indicendi, &
ibidem seipsum tanquam nostrum Commissionarium gerendi,
omniaque eisdem tenendis inservientia secundum leges & praxin
prædictæ ecclesiæ & regni nostri præstandi: Et hac præsenti nostrâ
Commissione durante nostro beneplacito duratura, & semper donec
eadem per nos expressè inhibeatur. In cujus rei testimonium,
præsentibus magnum sigillum nostrum unà cum privato nostro sigillo
(quia præfatus Marchio de Hamiltoun impræsentiarum eat magni sigilli
custos) apponi præcepimus, Apud Oatlands vigesimo nono die
mensis Julii, Anno Domini millesimo sexcentesimo trigesimo octavo,
Et anno regni nostri decimo quarto.

Per signaturam manu S.D.N. Regis suprascriptam.


The King’s Letter to the Generall Assembly.

A
LTHOUGH We be not ignorant that the best of Our actions have
beene mistaken by many of Our subjects in that Our antient
Kingdome, as if We had intended innovation in Religion or Lawes;
yet considering nothing to be more incumbent to the duty of a
Christain King, then the advancement of God’s glory, and the true
religion; forgetting what is past, We have seriously taken to Our
Princely consideration such particulars as may settle and establish
the truth of Religion in that Our ancient Kingdome, and also to
satisfie all Our good people of the reality of Our intentions herein,
having indicted a free Generall Assembly to be kept at Glasgow the
21. of this instant; We have likewise appointed Our Commissioner to
attend the same, from whom you are to expect Our pleasure in
every thing, and to whom We require you to give that true and due
respect and obedience, as if We were personally present Ourselves.
And in full assurance of Our consent to what he shall in Our name
promise, We have signed these, and wills the same for a testimonie
to posterity to be registered in the Bookes of the Assembly. At
White-Hall the 29. of October 1638.
Act Sess. 6. November 27. 1638.

T
HE testimonie of the Committy, for tryall of the Registers,
subscribed with their hands, being produced, with some reasons
thereof in another paper, and publickly read; My Lord Commissioner
professed that it had resolved him of sundry doubts, but desired a
time to be more fully resolved.
The Moderatour desired that if any of the Assembly had anything
to say against the said testimonie for the books, that they would
declare it; and finding none to oppon, yet he appointed the day
following, to any to object anything they could say, and if then none
could object, the Assembly would hold the Registers as sufficiently
approven.
Act. Sess. 7. November 28.

Act. Approving the Registers.

A
NENT the report of the Assemblies judgment of the authority of
the books of Assembly; the Moderatour having desired that if any
of the Assembly had anything to say, they would now declare it,
otherwise they would hold all approven by the Assembly.
The Commissioner his Grace protested that the Assemblies
approving these books, or anything contained in them be no wayes
prejudiciall to his Majestie, nor to the Archbishops, and Bishops of
this Kingdome, or any of their adherents; because he had some
exceptions against these books. My Lord Rothes desired these
exceptions to be condescended on, and they should be presently
cleared, and protested that these books should be esteemed
authentick and obligaterie hereafter.
The whole Assembly all in one voice approved these books, and
ordained the same to make faith in judgment, and out-with, in all
time comming, as the true and authentick Registers of the Kirk of
Scotland, conform to the testimonie subscribed by the Committie, to
be insert with the reasons thereof in the books of Assembly:
Whereof the tenour followeth.
WE under-subscribers, having power and commission from the
generall Assembly now presently conveened, and sitting at Glasgow,
to peruse, examine, and cognosce upon the validity, faith and
strength of the books and registers of the Assembly, under-written,
to wit: A register beginning at the Assembly holden the twentie day
of December 1560, and ending at the fourth session of the Assembly
holden the 28 of December 1566.
Item, another register beginning at the generall Assembly, holden
the second day of June 1567, and ending at the fourth session of the
Assembly holden at Perth the ninth day of August 1572, which
register is imperfect, and mutilate in the end, and containeth no leaf
nor page after that page which containeth the said inscription of the
said fourth session; which two registers bears to be subscribed by
John Gray scribe.
Item, a register of the Assembly holden at Edinburgh the seventh
day of August 1574, and ending with the twelfth session, being the
last session of the Assembly 1579.
Item another register beginning at the Assembly holden at
Edinburgh the tenth of May 1586. and ending in the seventeenth
session of the Assembly holden in March. 1589.
Item another, register being the fifth book, and greatest volume,
beginning at the Assembly holden in Anno 1560. and ending in the
year 1590.
Having carefully viewed, perused and considered the said
registers, and every one of them, and being deeply and maturely
advised, as in a matter of greatest weight and consequence, do
attest before God, and upon our conscience declare to the world and
this present Assembly, that the saids foure registers above
expressed, and every one of them, are famous, authentick, and
good registers; which ought to be so reputed, and have public faith
in judgement and out-with, as valid and true records in all things;
and that the said fifth and greatest book, beginning at the Assembly
1560 and ending 1590. being margined by the hand-writs of the
Clerk, and reviser of the registers, cognosced, and tryed, and
agreeable to the other foure registers, in what is extant in them,
ought also to be free of all prejudice and suspicion, and received
with credit. And in testimonie of our solemne affirmation, we have
subscribed these presents with our hands.
Sic subscribitur,
Master Andrew Ramsay.
Master Iohn Adamson.
Master Iohn Row.
Master Robert Murray.
Master Alexander Gibson.
Master Iames Boner.
Master Alexander Peerson.
Master Alexander Wedderburn.
Reasons prooving the five Books and Registers produced before the
Assembly to be authentick.
The books now exhibited unto us under-subscribers, which we
have revised and perused by commission from the generall
Assembly, are true registers of the Kirk: to wit, Five Volumes,
whereof the first two contain the acts of the Assembly, from the year
of God 1560. to the year 1572. all subscribed by Iohn Gray; Clerk:
The third from the year of God 1574. to the year 1579: The fourth
from the year of God 1586. to the year 1589: At which time Master
Iames Ritchie was Clerk, who hath frequently written upon the
margine of the saids two last books, and subscribed the said
margine with his hand-writing. And the fifth book being the greatest
volume, containing the acts of the generall Assembly, from the year
of God 1560. to the year 1590. which agreeth with the foresaids
other foure books and registers, in so far as is extant in them, and
further recordeth, what is wanting by them, passing by what is
mutilate in them, and which with the two Volumes produced by
Master Thomas Sandilands from the year 1590. to this present,
maketh up a perfect register.
I. For the first two Volumes subscribed by John Gray, albeit it be
not necessar in such antiquietie to proove that he was Clerk, seeing
he designes himself so by his subscription, yet the same is made
manifest by an act mentioned in the third book, in the time of
Master Iames Richie, who succeeded him in the said office, and his
hand-writ was acknowledged by sundry old men in the ministery.
II. The uniformitie of his subscriptions through both Volumes,
evident by ocular inspection above the ordinarie custome of most
famous Notars, delivers the same from all suspicion in facto tam
antiquo.
III. There be many coppies, specially of general acts, yet extant,
which do not debord from the saids registers, but are altogether
agreeable thereto.
IIII. It is constant by the universal custome of this Kingdome, that
all registers are transmitted from one keeper to his successour, and
so comming by progresse and succession from the first incumbent to
the last possessour, are never doubted to be the registers of that
judicatorie, whereof the last haver was Clerk; and therefore it is
evident that these books comming successively from Iohn Gray,
Master Iames Richie, and Master Thomas Nicolson who were all
Clerks to the Assembly, into the hands of Master Robert Winrame,
who was constitute Clerk depute by the said Master Thomas
Nicolson, (as his deputation here present to show, will testifie,) are
the undoubted registers of the Assembly: like as Alexander Blair
succeeded the said Master Robert in his place of Clerkship to the
assignations and modifications of Ministers stipends; and during
Master Robert his life-time, was his actuall servant, and so had the
said books by progresse from him, which the said Alexander is
readie presently to testifie.
V. The two registers of Master Iames Richie, albeit not under his
own hand, yet are frequently margined with his own hand-writ, and
the same marginall additions subscribed by him; which hand-writ is
seen and cognosced by famous men, who knoweth the same; and is
evident, being compared with his several writings and subscriptions
yet extant.
VI. The saids registers are more perfect, lesse vitiated, scored,
and interlined, than any other authentic and famous registers of the
most prime judicatories within this Kingdome.
VII. Master Thomas Sandilands, in name of his father, who was
late Clerk by dimission of Master Thomas Nicolson, hath produced a
volume, which proveth the saids two registers of Master Iames
Richie to be sufficient records; because that same Volume is begun
by that same hand, whereby the said Master Iames Richie his
registers are written, and is subscribed once in the margine by
Master Iames Richie his hand, and is followed forth, and continued
in the same book by Master Thomas Nicolson, who succeeded him in
the place, and was known by most men here present to be of such
approven worth and credit, that he would never have accomplished
a register which had not been famous and true: and whereof the
hand-write, had not then been known to him sufficiently.
VIII. That register produced by Master Thomas Sandilands, and
prosecuted by Master Thomas Nicolson, proves the first part of that
register to be true and famous; and that first part being, by ocular
inspection, of the same hand-writ with Master Iames Richies
registers, and subscribed in the margine with the same hand-writ,
proveth Richies two books to be good records, and Richies registers
doth approve Grays books by the act of Assembly before written;
specially considering the same hath come by progresse and
succession of Clerks, in the hands of Alexander Blair, now living, and
here present.
IX. The compts anent the thirds of benefices between the Regent
for the time and the Assembly, in the second volume, pag. 147, are
subscribed by the Lord Regents own hand, as appeareth; for it is a
royall-like subscription, and there is no hand-writ in all the book like
unto it, and beareth not sic subscribitur, which undoubtedly it would
do, if it were a coppie.
X. Master Iames Carmichell was commanded by the generall
Assembly 1595, Sess. 9, in the book produced by Master Thomas
Sandilands, to extract the generall acts forth of their books; and it is
evident that these books are the same which he perused for that
effect, because he hath marked therein the generall acts with a
crosse, and hath designed the act by some short expression upon
the margine, which is cognosced and known to be his hand writ, by
famous and worthy persons; which is also manifest by the said
Master Iames his band and subscription, written with his own hand
in the last leafe of the said books; as also acknowledged in the said
book produced by Master Thomas Sandilands, wherein the said
Master Iames Carmichell granteth the receipt of these, with some
other books of the Assemblies.
XI. The registers produced, are the registers of the Assembly,
because in Anno 1586, the Assembly complaineth that their registers
are mutilate: which hath relation to Richies third book, which is
lacerat and mutilate in divers places, without any interveening of
blank paper, or any mention of hic deest.
XII. If these were not principall registers, the enemies of the
puritie of Gods worship, would never have laboured to destroy the
same: which notwithstanding they have done; as appeareth by the
affixing and battering of a piece of paper upon the margine, anent a
condition of the commission not to exceed the established discipline
of this Kirk, subscribed by the Clerk, book 3. pag. 147. And the
blotting out the certification of the excommunication against Bishop
Adamson, book 4. pag. 30. who in his Recantation generally
acknowledgeth the same: but which, without that recantation,
cannot be presupponed to have been done, but by corrupt men, of
intension to corrupt the books, which were not necessary, if they
were not principall registers.
XIII. In the Assembly 1586, The Church complained upon the
Chancelour his retention of their registers, & desired they might be
delivered to their Clerk, which accordingly was done; as a
memorandum before the beginning of the first book, bearing the
redeliverie of these foure books to Master Iames Richie, Clerk,
proporteth; which clearly evinceth that these foure books are the
registers of the Assembly.
XIV. The said fifth book and greatest Volume, is also marked on
the margine, with the hand writ of the said Master James Carmichell
(which is cognosced) who was appointed to peruse the books of the
Assembly as said is, and would not have margined the same by
vertue of that command, nor extracted the generall acts out of it, if
it were not an approbation thereof, as an authentick and famous
book.
XV. The said fifth volume doth agree with the other foure books, in
all which is extant in them, and marketh the blanks, which are
lacerate and riven out of the same; and compleateth all what is
lacking in them.
XVI. In the book of Discipline pertaining to Master Iames
Carmichel, subscribed by himself, and Master Iames Richie, there are
sundry acts and passages quotted out of the said fifth great Volume,
saying, It is written in such a page of the book of Assembly, which
agreeth in subject and quottations with the said fifth book, and
cannot agree with any other; so that Master Iames Carmichel reviser
of the Assembly books, by their command, would not alledge that
book, nor denominate the same a book of the Assembly, if it were
not an authentic famous book.
XVII. Though the corrupt nature of man hath been tempted to
falsifie particular evidents, yet it hath never been heard that any
whole register hath ever been counterfeited; neither can it bee
presupponed that any will attempt that high wickednesse, seeing the
inducements answerable to that crime, can hardly be presupposed.
XVIII. It is certain, and notour to all these who are intrusted with
the keeping of the publick records of the Kingdome, that the same
are never subscribed by the Clerk, but only written and filled up by
servants, and most frequently by unknown hands, yet they and the
extracts thereof make publick faith, and the same are
uncontrovertedly authentick registers: and when the most publick
registers of the Kingdome shall be seen, and compared with these
registers of the Assembly, it shall be found that these other registers
of the most soveraigne judicatories ever unsubscribed are more
incorrect, oftner margined, scored, and interlined, made up by
greater diversitie of unknown hand-writs, than these books of the
Assembly, which by speciall providence are preserved so intire, that
in the judgment of any man acquainted with registers, they will
manifestly appear at the very sight to be true, famous, and
authentick.
XIX. The fame and credit of ancient registers in this Kingdome, is
so much reverenced, that if any extract be different or disconforme
from the register, that extract albeit subscribed by the person who
for the time had been of greatest eminence in the trust of registers,
will be rectified, conforme to the register, and have no force, so far
as it debordeth there-from; although the registers be written with an
obscure, unknown hand, and unsubscribed.
Act Sess. 12. December fourth.

The six late pretended Assemblies condemned.

A
NENT the report of the Committie, for trying the six last
pretended Assemblies: They produced in writ sundrie reasons,
clearing the unlawfulnesse and nullitie of these Assemblies: which
were confirmed by the registers of the Assembly, the books of
Presbyteries, the Kings Majesties own letters, and by the testimonie
of divers old reverend Ministers, standing up in the Assembly, and
verifying the truth thereof. The Assembly with the universall consent
of all, after the serious examination of the reasons against every one
of these six pretended Assemblies apart, being often urged by the
Moderatour, to informe themselves throughly, that without doubting,
and with a full perswasion of minde, they might give their voices,
declared all these six assemblies, of Linlithgow 1606. and 1608,
Glasgow 1610. Aberdeen 1616. St Andrews 1617. Perth 1618, And
every one of them to have been from the beginning unfree,
unlawfull, and null Assemblies, and never to have had, nor hereafter
to have, any Ecclesiasticall authoritie, and their conclusions to have
been, and to bee of no force, vigour, nor efficacie: Prohibited all
defence and observance of them, and ordained the reasons of their
nullitie to be insert in the books of the Assembly: Whereof the
tennour followeth:
Reasons annulling the pretended Assembly, holden at
Linlithgow, 1606.

I. From the indiction of it. It was indicted the third of December, to


bee kept the tenth of December. And so there was no time given to
the Presbyteries, far distant, neither for election of Commissioners,
nor for preparation to those who were to be sent in Commission.
The shortnesse of the time of the indiction is proved by the
Presbyterie books of Edinburgh, Perth, and Hadingtoun, &c.
II. From the want of a lawfull calling, to these who went to that
meeting, seeing they were not at all elected by their Presbyteries,
but were injoyned to come by the Kings letters. This also is proved
by the foresaids books of the Presbyteries, and by his Majesties
letters.
III. From the nature of that meeting, which was only a private
meeting, or convention, for consultation to be taken by some
persons of sundry estates written for, as the Kings letters and the
Presbyterie books do acknowledge.
IIII. From the power of these ministers who were present Their
Presbyteries did limitate them: First, That they should give no
suffrages in that meeting as a generall Assembly. Secondly, That
they agree to nothing that may any wayes be prejudiciall to the acts
of the generall Assemblies, or to the established discipline of the
Kirk. Thirdly, That they should not agree to resolve or conclude any
question, article, or matter whatsoever, the decision whereof is
pertinent, and proper to a free generall Assembly. Fourthly, If
anything be concluded contrary thereunto, that they protest against
it. These limitations are clear by the Presbyterie books.
V. The acts of this meeting were not insert in the book of
Assemblies, as is evident by the register.
VI. The next pretended Assembly at Linlithgow, 1608. doth
acknowledge the Assembly, Whereof Master Patrick Galloway was
Moderatour, to have been the last immediate Assembly, preceeding
itselfe: and that Assembly wherof he was moderatour, was the
Assembly holden at Halyroodhouse, 1602. So they did not
acknowledge that meeting at Linlithgow, 1606. for any Assembly at
all. This is clear by the registers of the Assembly, 1608. in the entrie
thereof.
Reasons for annulling the pretended Assembly at
Linlithgow, 1608.

I. Manie of the voters in that pretended Assembly had no lawfull


commission from the Kirk, to wit, 42. Noble men, officers of estate,
counsellours, and Barrons, also the Bishops, contrare to the act of
Dundie, 1597, and one of their caveats. The Noble men, were as
commissioners from the King; the Bishops had no commission at all
from the Presbyteries, for every Presbyterie out of which they came,
had their full number of Commissioners beside them, as the register
of the Assembly beareth.
II. In a lawfull Assembly there should be none but Commissioners
from Presbyteries, Burghs, and Universities, and but three ministers
at most, with one Elder, Commissioners from every Presbyterie,
according to the act made at Dundie, 1597. But in that pretended
Assembly, there were foure ministers from the severall Presbyteries
of Edinburgh, and Cowper, five from the Presbyterie of Arbroth, as
the roll of the said pretended Assembly beareth; whereas there were
no ruling Elders sent from Presbyteries, according to the book of
policie and act of Dundie.
Reasons for annulling the pretended Assembly at
Glasgow. 1610.

I. The Commission of the pretended Commissioners to that


meeting was null. 1. Because the election of them was not free,
seeing they were nominate by the Kings Letters, as the Presbyterie
books of Edinburgh, Perth, and Hadingtoun declare. And the Bishop
of St Andrews in his letter to some Presbyteries required them to
send such commissioners as the King had nominate: assuring them
that none other would be accepted. This the Bishops letter registrat
in the Presbyterie books of Hadingtoun doth cleare. 2. And whereas
there were no ruling elders sent from the Presbyteries to that
pretended Assembly, as the roll of Commissioners sheweth; yet
there were moe ministers from sundrie severall Presbyteries then
three, as five from Brechen, five from Arbroth, five from
Kirkcubright, seven from the Presbytery of Argyl, foure from the
Presbyterie of Cowper, foure from Linlithgow, foure from Pasley,
foure from Hammiltoun, foure from Drumfreis, foure from Dunkell:
as the register of that Assembly beareth.
II. There were thirtie voters of Noble men and Barrons, beside the
pretended Bishops, who had no commission from any Presbyterie. In
the fourth Session of this pretended Assembly it is plainly said, That
the Noble men and Barrons came to it by the Kings direction.
III. The voting of the commissioners was not free; for by the
Kings Letter to the Assembly they were threatned, and it was
declared that their consent was not needfull to any act to be made
there: The King might doe it by his own power, yet they were allured
to vote by a promise that their good service in so doing should be
remembred and rewarded thereafter.
IIII. The principall acts which were made, were set down verbatim
in the privie conference, which chiefly consisted of the Kings
Commissioners and pretended Bishops, and only read to be ratified
in the Assembly.
V. Sundrie ministers then present, doe now declare, that they
knew the ministers who voted the wrong way, to have received their
present reward, and that money was largely dealt unto them.
Reasons for annulling the pretended Assembly at
Aberdene, 1616.

I. There was no election of a Moderatour: but that place usurped


by the pretended Bishop of Saint Andrews, as the Register beareth.
II. The indiction of that pretended Assembly was but twentie
dayes before the holding of it: so that the Presbyteries and burghes
could not be prepared for sending their commissioners: which
caused the absence of many Presbyteries and fourtie foure Burghes.
III. There were twentie five noble-men, and gentlemen voters
without commission from the Kirk. Mr. William Struthers voted for
the Presbyterie of Edinburgh, yet had no commission there-from;
The commission being given by that Presbyterie to other three, as
the said Commission registrat in the books of the Presbytery
beareth. And whereas there should be but one Commissioner from
every burgh, except Edinburgh, to the Assembly, at this pretended
Assembly, there were two Commissioners from Glasgow, two from
Cowper, two from St. Andrews; whereas there wore no ruling Elders
having commission from their Presbyteries at that Assembly.
IIII. When the acts of that pretended assembly were written, the
Bishop of St. Andrews with his own hand did interline, adde, change,
vitiate, direct to be extracted or not extracted, as he pleased: as the
scrolls themselves seen, doe show; wherefore the Clerk did not
registrat the acts of that Assembly, in the books of Assemblies, as
may be easily seen by the blank in the register left for them
remaining unfilled.
The nullitie of the pretended Assembly at Saint
Andrews, 1617.

I. There is no mention of it in the register of the Assemblies, and


so no warrand for their commissions, their Moderatour or Clerk.
II. The indiction of it was so unformall, that as the scroll declareth,
a great part of the Commissioners from Synods, Burrows, and
gentle-men, would not be present.
III. The Kings Majestie in his letter to Perths Assembly,
acknowledgeth it was but a meeting, wherein disgrace was offered
to his Majestie.
IIII. The former corruptions of the foure preceding Assemblies had
their confluence in this and the subsequent Assembly.
Reasons for annulling the pretended Assembly
holden at Perth, 1618.

I. The Assembly was indicted but twentie dayes before the holding
of it: and all parties requisit received not advertisement, as
appeareth by their absence. The untimous indicting of it, is cleared
by Presbyterie books.
II. There was no election of the Moderatour, as was accustomed
to be in lawfull Assemblies; the register cleareth this.
III. No formall election of their new Clerk.
IIII. There were five whole Dyocies absent, viz. Orknay, Cathnes,
Rosse, Argyll, and Isles; and many Presbyteries had no
Commissioners there, as the register of that pretended Assembly
beareth.
V. There were nineteen noblemen and Barrons, eleven Bishops,
that had no Commission from the Kirk. Whereas the act for
constitution of Assemblies, ordaineth every Burgh to have but one
Commissioner, except Edinburgh, which may have two, (Act at
Dundie 1597) yet in that pretended Assembly, Perth had three
Commissioners, Dundie had two, Glasgow had two, and St. Andrews
had two: Of the Burghes there were thirtie six absent: and for ruling
Elders, there were none at all with commission from their
Presbyteries. All these things are cleared by the records of that
pretended Assemblie.
VI. The Commissioners from some Presbyteries exceeded their
number, prescribed in the act at Dundie, 1597: for the Presbyterie of
Arbroth were foure Commissioners, and foure for the Presbyterie of
Aughter-ardour: Beside these that were heard to vot, having no
commission at all, and some who had commission were rejected,
and were not enrolled, but others put in their place without
commission.
VII. The pretended Bishops did practise some of the articles to be
concluded there, before the pretended Assembly, in Edinburgh, St.
Andrews, and other cathedrall Churches, by keeping festivall dayes,
kneeling at ye Communion. Thus their voices were prejudged by
their practise of these articles before condemned by the Kirk, and
therefore they should have been secluded from voicing.
VIII. In all lawfull Assemblies, the voicing should be free: But in
this pretended Assembly there were no free voicing; for the voicers
were threatned to voice affirmativè, under no lesse pain nor the
wrath of authoritie, imprisonment, banishment, deprivation of
ministers, and utter subversion of the state: Yea, it was plainly
professed, that neither reasoning, nor the number of voices should
carie the matter away: Which is qualified by the declaration of many
honest old reverend Brethren of the ministery now present.
IX. In all lawfull Assemblies, the grounds of proceeding were, and
used to be, the word of God, the confession of Faith, and acts of
former generall Assemblies. But in this pretended Assembly, the
ground of their proceeding in voicing was the Kings commandment
only: For so the question was stated: Whether the five articles, in
respect of his Majesties commandement should passe in act, or not:
As the records of that pretended Assembly beareth, where it is
declared, that for the reverence and respect which they bear unto
his Majesties Royal commandements, they did agree to the foresaids
articles.
X. Many other reasons verifying the nullitie of all these Assemblies,
were showen and proven before the Assembly, which needeth not
here to be insert.
Act. Sess. 13. December 5. 1638.

Against the unlawfull oathes of intrants.

T
HE six Assemblies immediately preceding, for most just and
weightie reasons above-specified, being found to be unlawfull,
and null from the beginning: The Assembly declareth the oathes and
subscriptions exacted by the Prelates of intrants in the ministerie all
this time by past (as without any pretext of warrand from the Kirk,
so for obedience of the acts of these null Assemblies, and contrare
to the ancient and laudable constitutions of this Kirk, which never
have been nor can be lawfully repealled, but must stand in force) to
be unlawfull and no way obligatorie. And in like manner declareth,
that the power of Presbyteries, and of provinciall and generall
Assemblies, hath been unjustly suppressed, but never lawfully
abrogate. And therefore that it hath been most lawfull unto them,
notwithstanding any point unjustly objected by the Prelats to the
contrare, to admit, suspend, or deprive ministers, respectivè within
their bounds, upon relevant complaints sufficiently proven, to choose
their own Moderatours, and to execute all the parts of ecclesiasticall
jurisdiction according to their own limits appointed them by the Kirk.
Act Sess. 14. December 6. 1638.

Condemning the Service-book, Book of Canons, Book


of Ordination, and the high Commission.
I.

T
HE Assembly having diligently considered the Book of common
prayer, lately obtruded upon the reformed Kirk within this
Realme, both in respect of the manner of the introducing thereof,
and in respect of the matter which it containeth, findeth that it hath
been devised and brought in by the pretended Prelats, without
direction from the Kirk, and pressed upon ministers without warrand
from the Kirk, to be universally received as the only forme of divine
service under all highest paines, both civill and ecclesiasticall, and
the book it self, beside the popish frame and forms in divine worship,
to containe many popish errours and ceremonies, and the seeds of
manifold and grosse superstition and idolatrie. The Assembly
therefore all in one voice, hath rejected, and condemned and by
these presents doth reject and condemne the said book, not only as
illegally introduced, but also as repugnant to the doctrine, discipline
and order of this reformed Kirk, to the Confession of Faith,
constitutions of generall Assemblies, and acts of Parliament
establishing the true Religion: and doth prohibite the use and
practise thereof: and ordaines Presbyteries to proceed with the
censure of the Kirk against all such as shall transgresse.
II. The Assembly also, taking to their consideration the book of
Cannons, and the manner how it hath been introduced, findeth that
it hath been devised by the pretended Prelats, without warrand or
direction from the generall Assembly; and to establish a tyrannicall
power in the persons of the pretended Bishops, over the worship of
God, mens consciences, liberties and goods, and to overthrow the
whole discipline and government of the generall and Synodall
Assemblies, Presbyteries, and Sessions formerly established in our
Kirk.
Therefore the Assembly all in one voice hath rejected and
condemned, and by these presents doth reject and condemne the
said book, as contrare to the confession of our Faith, and repugnant
to the established government, the book of Discipline, and the acts
and constitutions of our Kirk: prohibits the use and practise of the
same; and ordains Presbyteries to proceed with the censure of the
Kirk against all such as shall transgresse.
III. The Assembly having considered the book of consecration and
ordination, findeth it to have been framed by the Prelats, to have
been introduced and practised without warrand of authority, either
civill or ecclesiasticall: and that it establisheth offices in Gods house,
which are not warranded by the word of God, and are repugnant to
the Discipline, and constitutions of our Kirk, that it is an impediment
to the entrie of fit and worthie men to the ministery, and to the
discharge of their dutie after their entrie, conforme to the discipline
of our Kirk. Therefore the Assembly all in one voice hath rejected
and condemned, and by these presents doe reject and condemne
the said book; and prohibits the use and practise of the same; And
ordaines Presbyteries to proceed with the censure of the Kirk against
all such as shall trangresse.
IIII. The generall Assembly, after due tryall, having found that the
Court of high Commission, hath been erected without the consent or
procurement of the Kirk, or consent of the Estates in Parliament,
that it subverteth the jurisdiction and ordinarie judicatories and
Assemblies of the Kirk Sessions, Presbyteries, provinciall and
nationall Assemblies, that it is not regulate by lawes civill or
ecclesiasticall, but at the discretion and arbitrement of the
Commissioners; that it giveth to ecclesiasticall persons, the power of
both the swords, and to persons meerly civill, the power of the keys
and Kirk censures: Therefore the Assembly, all in one voice, hath
disallowed and condemned, and by these presents doth disallow and
condemne the said court, as unlawfull in it selfe, and prejudiciall to
the liberties of Christs Kirk and Kingdome, the Kings honour in
maintaining the established lawes and judicatories of the Kirk: and
prohibits the use and practise of the same: and ordaines Presbteries
to proceed with the censures of the Kirk, against all such as shall
transgresse.
After the serious discussing of the severall Processes, in many
Sessions, from Sess. 14. (which are in the Clerks hands and
needeth not here to be insert) the following sentences were
solemnly pronounced after Sermon by the Moderatour, in
the Assembly of Glasgow, Sess. 20. December 13. 1638.

Sentence of deposition and excommunication against Mr Iohn


Spottiswood, pretended Archbishop of St Andrews; Mr. Patrick
Lindsay, pretended Archbishop of Glasgow: Mr. David Lindsay,
pretended Bishop of Edinburgh: Mr. Thomas Sidserfe, pretended
Bishop of Galloway: Mr. Iohn Maxwell, pretended Bishop of Rosse:
Mr. Walter Whytefoord, pretended Bishop of Brechen.

T
HE generall Assembly, having heard the lybels and complaints,
given in against the foresaids pretended Bishops to the
Presbyterie of Edinburgh, and sundry other Presbyteries within their
pretended Dyocies, and by the saids Presbyteries referred to the
Assembly, to be tryed: The saids pretended Bishops being lawfully
cited, often-times called, and their Procutour Doctour Robert
Hammiltoun, and not compearing, but declining and protesting
against this Assembly, as is evident by their declinatour, and
protestation given in by the said Doctour Robert Hammiltoun
minister at Glasfoord, which by the acts of Assembly is censurable
with summar excommunication: Entered in consideration of the said
declinatour, and finding the same not to be relevant, but on the
contrare to be a displayed banner against the setled order and
government of this Kirk, to be fraughted with insolent and disdainfull
speeches, lies and calumnies against the lawfull members of this
Assembly, proceeded to the cognition of the saids complaints, and
lybels against them; and finding them guiltie of the breach of the
cautions, agreed upon in the Assembly holden at Montrose, Anno
1600. for restricting of the minister voter in Parliament, from
incroaching upon the liberties and jurisdiction of this Kirk, which was
set down with certification of deposition, infamie, and
excommunication, specially for receiving of consecration to the office
of Episcopacie, condemned by the confession of Faith, and acts of
this Kirk, as having no warrand, nor foundament in the word of God,
and by vertue of this usurped power, and power of the high
Commission, pressing the Kirk with novations in the worship of God,
and for sundrie other haynous offences, and enormities, at length
expressed, and clearly proven in their processe, and for their refusall
to underly the tryal of the reigning slander of sundrie other grosse
transgressions and crymes laid to their charge: Therefore the
Assembly moved with zeal to the glorie of God, and purging of his
Kirk, hath ordained the saids pretended Bishops to be deposed, and
by these presents doth depose them, not only of the office of
Commissionaire to vote in Parliament, Councell, or Convention in
name of the Kirk, but also of all functions whether of pretended
Episcopall or ministeriall calling, declareth them infamous. And
likewise ordaineth the saids pretended Bishops to be
excommunicate, and declared to be of these whom Christ
commandeth to be holden by all and every one of the faithfull as
ethnicks, and publicanes; and the sentence of excommunication to
be pronounced by Mr Alexander Henderson, Moderatour, in face of
the Assembly in the high Kirk of Glasgow, and the execution of the
sentence to bee intimat in all the Kirks of Scotland by the Pastours of
every particullar congregation, as they will be answerable to their
Presbyteries and Synods, or the next generall Assembly, in case of
the negligence of Presbyteries and Synods.

Sentence of deposition and excommunication against Mr. Adam


Ballantyne, pretended Bishop of Aberdeen, and Mr. Iames
Wedderburn pretended Bishop of Dumblane.
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!

ebookname.com

You might also like