100% found this document useful (4 votes)
26 views

Get Math Adventures with Python An Illustrated Guide to Exploring Math with Code 1st Edition Peter Farrell free all chapters

Python

Uploaded by

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

Get Math Adventures with Python An Illustrated Guide to Exploring Math with Code 1st Edition Peter Farrell free all chapters

Python

Uploaded by

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

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Math Adventures with Python An Illustrated Guide


to Exploring Math with Code 1st Edition Peter
Farrell

https://textbookfull.com/product/math-adventures-with-
python-an-illustrated-guide-to-exploring-math-with-code-1st-
edition-peter-farrell/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


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

Practical Business Math Procedures [with Business Math


Handbook] Jeffrey Slater

https://textbookfull.com/product/practical-business-math-procedures-
with-business-math-handbook-jeffrey-slater/

textboxfull.com

Doing Math with Python Use Programming to Explore Algebra


Statistics Calculus and More 1st Edition Amit Saha

https://textbookfull.com/product/doing-math-with-python-use-
programming-to-explore-algebra-statistics-calculus-and-more-1st-
edition-amit-saha/
textboxfull.com

Math for Programmers: 3D Graphics, Machine Learning and


Simulations with Python 1st Edition Paul Orland

https://textbookfull.com/product/math-for-programmers-3d-graphics-
machine-learning-and-simulations-with-python-1st-edition-paul-orland/

textboxfull.com

Math for Programmers 3D graphics machine learning and


simulations with Python 1st Edition Paul Orland

https://textbookfull.com/product/math-for-programmers-3d-graphics-
machine-learning-and-simulations-with-python-1st-edition-paul-
orland-2/
textboxfull.com
Begin to Code with Python Rob Miles

https://textbookfull.com/product/begin-to-code-with-python-rob-miles/

textboxfull.com

Learn to program with Small Basic an introduction to


programming with games art science and math Early Access
1st Edition Marji
https://textbookfull.com/product/learn-to-program-with-small-basic-an-
introduction-to-programming-with-games-art-science-and-math-early-
access-1st-edition-marji/
textboxfull.com

Help Your Kids with Math revised edition Dk

https://textbookfull.com/product/help-your-kids-with-math-revised-
edition-dk/

textboxfull.com

Math for Programmers 3D graphics machine learning and


simulations with Python MEAP V10 1st Edition Paul Orland

https://textbookfull.com/product/math-for-programmers-3d-graphics-
machine-learning-and-simulations-with-python-meap-v10-1st-edition-
paul-orland/
textboxfull.com

Math smart the savvy student s guide to mastering basic


math Penguin Random House

https://textbookfull.com/product/math-smart-the-savvy-student-s-guide-
to-mastering-basic-math-penguin-random-house/

textboxfull.com
MAKE MATH

M AT H A D V E N T U R E S
COVERS
COME ALIVE
PYTHON 3
WITH PYTHON

WITH PY THON

M AT H A DV E N T UR E S W I T H PY T HON
A N I L L U S T R A T E D G U I D E T O
Math Adventures with Python will show you how to • Use recursion to create fractals like the Koch
harness the power of programming to keep math snowflake and the Sierpinski triangle E X P L O R I N G M A T H W I T H C O D E
relevant and fun. With the aid of the Python program-
• Generate virtual sheep that graze on grass and
ming language, you’ll learn how to visualize solutions
multiply autonomously
to a range of math problems as you use code to explore
key mathematical concepts like algebra, trigonometry, • Crack secret codes using genetic algorithms PETER FARRELL
matrices, and cellular automata.
As you work through the book’s numerous examples
Once you’ve learned programming basics like loops and increasingly challenging exercises, you’ll code
and variables, you’ll write your own programs to solve your own solutions, create beautiful visualizations,
equations quickly, make cool things like an interactive and see just how much more fun math can be!
rainbow grid, and automate tedious tasks like factoring
ABOUT THE AUTHOR
numbers and finding square roots. You’ll learn how to
write functions to draw and manipulate shapes, create Peter Farrell is a math and computer science teacher
oscillating sine waves, and solve equations graphically. with a passion for customizing (”hacking”) math
education and learning with technology. He lives in
You’ll also learn how to:
the San Francisco Bay Area with his wife and children.
• Draw and transform 2D and 3D graphics with
matrices

• Make colorful designs like the Mandelbrot and


Julia sets with complex numbers

T H E F I N E ST I N G E E K E N T E RTA I N M E N T ™
FARRELL

w w w.nostarch.com
$29.95 ($39.95 CDN)
LANGUAGES/PYTHON
SHELVE IN: PROGRAMMING

“ I L I E F L AT .”
This book uses a durable binding that won’t snap shut.
Math Adventures
with Python
Math
Adventu res
with Py thon
A n I llu s t r at e d G u i d e to
E x p l o r i n g M at h w it h C o d e

b y P e t e r Fa r r e ll

San Francisco
Math Adventures with Python. Copyright © 2019 by Peter Farrell.

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.

ISBN-10: 1-59327-867-5
ISBN-13: 978-1-59327-867-0

Publisher: William Pollock


Production Editor: Meg Sneeringer
Cover Illustration: Josh Ellingson
Developmental Editor: Annie Choi
Technical Reviewer: Patrick Gaunt
Copyeditor: Barton D. Reed
Compositors: David Van Ness and Meg Sneeringer
Proofreader: James Fraleigh

The following images are reproduced with permission:


Figure 10-2 by Acadac mixed from originals made by Avsa (https://commons.wikimedia.org/wiki/File:Britain-
fractal-coastline-100km.png#/media/File:Britain-fractalcoastline-combined.jpg; CC-BY-SA-3.0);
Figure 11-19 by Fabienne Serriere, https://knityak.com/.

For information on distribution, translations, or bulk sales, please contact No Starch Press, Inc. directly:
No Starch Press, Inc.
245 8th Street, San Francisco, CA 94103
phone: 1.415.863.9900; [email protected]
www.nostarch.com

A catalog record of this book is available from the Library of Congress.

No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other
product and company names mentioned herein may be the trademarks of their respective owners. Rather
than use a trademark symbol with every occurrence of a trademarked name, we are using the names only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.

The information in this book is distributed on an “As Is” basis, without warranty. While every precaution
has been taken in the preparation of this work, neither the authors nor No Starch Press, Inc. shall have
any liability to any person or entity with respect to any loss or damage caused or alleged to be caused
directly or indirectly by the information contained in it.
This book is dedicated to all my students,
from whom I’ve learned so much.
About the Author
Peter Farrell was a math teacher for eight years, starting first as
a Peace Corps volunteer in Kenya. He then worked as a computer
science teacher for three years. After reading Seymour Papert’s
Mindstorms and being introduced to Python by a student, he was
inspired to bring programming into math class. He is passionate
about using computers to make learning math more relevant, fun,
and challenging.

About the Technical Reviewer


Paddy Gaunt graduated in engineering within weeks of the birth
of the IBM PC and its associated MS DOS. Much of the rest of his
career has revolved around implementing mathematical or tech-
nical concepts in practical software. Recently, he reformed links
with Cambridge University (UK) when he became lead developer
of pi3d, a python module for 3D graphics initially designed to run
on the Raspberry Pi computer.
B ri e f Co nte nts

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Part I: Hitchin' Up Your Python Wagon


Chapter 1: Drawing Polygons with the Turtle Module . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Making Tedious Arithmetic Fun with Lists and Loops . . . . . . . . . . . . . . . . . . 19
Chapter 3: Guessing and Checking with Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . 37

Part 2: Riding into Math Territory


Chapter 4: Transforming and Storing Numbers with Algebra . . . . . . . . . . . . . . . . . . . . 53
Chapter 5: Transforming Shapes with Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Chapter 6: Creating Oscillations with Trigonometry . . . . . . . . . . . . . . . . . . . . . . . . . 103
Chapter 7: Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Chapter 8: Using Matrices for Computer Graphics and Systems of Equations . . . . . . . . 145

Part 3: Blazing Your Own Trail


Chapter 9: Building Objects with Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Chapter 10: Creating Fractals Using Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Chapter 11: Cellular Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Chapter 12: Solving Problems Using Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . 247

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Co nte nts i n Detai l

Acknowledgments xv

Introduction xvii
The Problem with School Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Who Should Use This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
What's in This Book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Downloading and Installing Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Starting IDLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Installing Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

Part I: Hitchin' Up Your Python Wagon

1
Drawing Polygons with the Turtle module 3
Python’s turtle Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Importing the turtle Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Moving Your Turtle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Changing Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Repeating Code with Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Using the for Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Using a for Loop to Draw a Square . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Creating Shortcuts with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Using Variables to Draw Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Using Variables in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Variable Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Equilateral Triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Writing the triangle() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Making Variables Vary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2
Making Tedious Arithmetic Fun
with Lists and Loops 19
Basic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Operating on Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Using Operators to Write the average() Function . . . . . . . . . . . . . . . . . . . . . . 21
Mind the Order of Operations! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Using Parentheses with Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Data Types in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Integers and Floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Checking Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Using Lists to Store Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Adding Items to a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Operating on Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Removing Items from a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Using Lists in Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Accessing Individual Items with List Indices . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Accessing Index and Value with enumerate() . . . . . . . . . . . . . . . . . . . . . . . . . 29
Indices Start at Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Accessing a Range of List Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Finding Out the Index of an Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Strings Use Indices, Too . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Creating the running_sum Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Writing the mySum() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Finding the Average of a List of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3
Guessing and Checking with Conditionals 37
Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Making Decisions with if and else Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Using Conditionals to Find Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Writing the factors.py Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
The Wandering Turtle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating a Number-Guessing Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Making a Random Number Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Taking User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Converting User Input to Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Using Conditionals to Check for a Correct Guess . . . . . . . . . . . . . . . . . . . . . . 45
Using a Loop to Guess Again! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Tips for Guessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Finding Square Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Applying the Number-Guessing Game Logic . . . . . . . . . . . . . . . . . . . . . . . . . 48
Writing the squareRoot() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

x   Contents in Detail
Part 2: Riding into Math Territory

4
Transforming and Storing Numbers
with Algebra 53
Solving First-Degree Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Finding the Formula for First-Degree Equations . . . . . . . . . . . . . . . . . . . . . . . . 55
Writing the equation() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Using print() Instead of return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Solving Higher-Degree Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Using quad() to Solve Quadratic Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Using plug() to Solve a Cubic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Solving Equations Graphically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Getting Started with Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Creating Your Own Graphing Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Graphing an Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Using Guess and Check to Find the Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Writing the guess() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

5
Transforming Shapes with Geometry 77
Drawing a Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Specifying Location Using Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Transformation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Translating Objects with translate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Rotating Objects with rotate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Drawing a Circle of Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Drawing a Circle of Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Animating Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Creating the t Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Rotating the Individual Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Saving Orientation with pushMatrix() and popMatrix() . . . . . . . . . . . . . . . . . . 88
Rotating Around the Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Creating an Interactive Rainbow Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Drawing a Grid of Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Adding the Rainbow Color to Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Drawing Complex Patterns Using Triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
A 30-60-90 Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Drawing an Equilateral Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Drawing Multiple Rotating Triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Phase-Shifting the Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Finalizing the Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

Contents in Detail   xi
6
Creating Oscillations with Trigonometry 103
Using Trigonometry for Rotations and Oscillations . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Writing Functions to Draw Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Drawing a Hexagon with Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Drawing an Equilateral Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Making Sine Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Leaving a Trail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Using Python’s Built-in enumerate() Function . . . . . . . . . . . . . . . . . . . . . . . . . 114
Creating a Spirograph Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Drawing the Smaller Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Rotating the Smaller Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Making Harmonographs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Writing the harmonograph Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Filling the List Instantly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Two Pendulums Are Better Than One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

7
Complex Numbers 127
The Complex Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Adding Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Multiplying a Complex Number by i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Multiplying Two Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Writing the magnitude() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Creating the Mandelbrot Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Writing the mandelbrot() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Adding Color to the Mandelbrot Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Creating the Julia Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Writing the julia() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

8
Using Matrices for Computer Graphics
and Systems of Equations 145
What Is a Matrix? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Adding Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Multiplying Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Order Matters in Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Drawing 2D Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Transforming Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Transposing Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Rotating Matrices in Real Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Creating 3D Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Creating the Rotation Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Solving Systems of Equations with Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Gaussian Elimination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Writing the gauss() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

xii   Contents in Detail
Part 3: Blazing Your Own Trail

9
Building Objects with Classes 175
Bouncing Ball Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Making the Ball Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Making the Ball Bounce Off the Wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Making Multiple Balls Without Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Creating Objects Using Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Grazing Sheep Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Writing the Class for the Sheep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Programming Sheep to Move Around . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Creating the energy Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Creating Grass Using Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Making the Grass Brown when Eaten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Giving Each Sheep a Random Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Programming Sheep to Reproduce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Letting the Grass Regrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Providing an Evolutionary Advantage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

10
Creating Fractals Using Recursion 201
The Length of a Coastline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
What Is Recursion? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Writing the factorial() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Building a Fractal Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Koch Snowflake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Writing the segment() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Sierpinski Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Square Fractal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Dragon Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

11
Cellular Automata 225
Creating a Cellular Automaton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Writing a Cell Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Resizing Each Cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Making a CA Grow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Putting the Cells into a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Creating the Cell List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Python Lists Are Strange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
List Index Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Letting Your CA Grow Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Playing the Game of Life . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
The Elementary Cellular Automaton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

Contents in Detail   xiii
12
Solving Problems Using Genetic Algorithms 247
Using a Genetic Algorithm to Guess Phrases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Writing the makeList() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Testing the makeList() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Writing the score() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Writing the mutate() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Generating a Random Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Solving the Traveling Salesperson Problem (TSP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Using Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Writing the calcLength() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Testing the calcLength() Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Random Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Applying the Phrase-Guessing Mutation Idea . . . . . . . . . . . . . . . . . . . . . . . . 265
Mutating Two Numbers in a List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Crossing Over to Improve Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

Index 273

xiv   Contents in Detail
Ackn owle dg m e nts

I’d like to thank Don “The Mathman” Cohen for showing me how fun and
challenging learning real math can be; Seymour Papert for proving that
coding belongs in math class; Mark Miller for giving me a chance to put
my ideas into action; Hansel Lynn and Wayne Teng of theCoderSchool,
who let me continue to have fun coding with students; and Ken Hawthorn
for sharing my projects at his school. Thank you to my No Starch editors,
Annie Choi, Liz Chadwick, and Meg Sneeringer, for all your help making
this a much better book, and to Paddy Gaunt, whose input is visible all
over this book. This book wouldn’t exist without you all. Thank you to
everybody who said no—you gave me the energy to keep going. Finally,
thank you to Lucy for always believing in me.
I ntro du ctio n

Which approach shown in Figure 1 would


you prefer? On the left, you see an example
of a traditional approach to teaching math,
involving definitions, propositions, and proofs.
This method requires a lot of reading and odd sym-
bols. You’d never guess this had anything to do with
geometric figures. In fact, this text explains how to
find the centroid, or the center, of a triangle. But tradi-
tional approaches like this don’t tell us why we should
be interested in finding the center of a t­ riangle in the
first place.
Figure 1: Two approaches to teaching about the centroid

Next to this text, you see a picture of a dynamic sketch with a hundred
or so rotating triangles. It’s a challenging programming project, and if
you want it to rotate the right way (and look cool), you have to find the
centroid of the triangle. In many situations, making cool graphics is nearly
impossible without knowing the math behind geometry, for example. As
you’ll see in this book, knowing a little of the math behind triangles, like
the centroid, will make it easy to create our artworks. A student who knows
math and can create cool designs is more likely to delve into a little geom-
etry and put up with a few square roots or a trig function or two. A student
who doesn’t see any outcome, and is only doing homework from a textbook,
probably doesn’t have much motivation to learn geometry.
In my eight years of experience as a math teacher and three years
of experience as a computer science teacher, I’ve met many more math
­learners who prefer the visual approach to the academic one. In the
process of creating something interesting, you come to understand that
math is not just following steps to solve an equation. You see that explor-
ing math with programming allows for many ways to solve interesting
problems, with many unforeseen mistakes and opportunities for improve-
ments along the way.
This is the difference between school math and real math.

The Problem with School Math


What do I mean by “school math” exactly? In the US in the 1860s, school
math was preparation for a job as a clerk, adding columns of numbers by
hand. Today, jobs are different, and the preparation for these jobs needs to
change, too.
People learn best by doing. This hasn’t been a daily practice in schools,
though, which tend to favor passive learning. “Doing” in English and his-
tory classes might mean students write papers or give presentations, and
science students perform experiments, but what do math students do? It

xviii   Introduction
used to be that all you could actively “do” in math class was solve equations,
factor polynomials, and graph functions. But now that computers can do
most of those calculations for us, these practices are no longer sufficient.
Simply learning how to automate solving, factoring, and graphing is not
the final goal. Once a student has learned to automate a process, they can
go further and deeper into a topic than was ever possible before.
Figure 2 shows a typical math problem you’d find in a textbook, asking
students to define a function, “f(x),” and evaluate it for a ton of values.

Figure 2: A traditional approach to teaching functions

This same format goes on for 18 more questions! This kind of exercise
is a trivial problem for a programming language like Python. We could sim-
ply define the function f(x) and then plug in the values by iterating over a
list, like this:

import math

def f(x):
return math.sqrt(x + 3) - x + 1

#list of values to plug in


for x in [0,1,math.sqrt(2),math.sqrt(2)-1]:
print("f({:.3f}) = {:.3f}".format(x,f(x)))

The last line just makes the output pretty while rounding all the solu-
tions to three decimal places, as shown here:

f(0.000) = 2.732
f(1.000) = 2.000
f(1.414) = 1.687
f(0.414) = 2.434

In programming languages like Python, JavaScript, Java, and so on,


functions are a vitally important tool for transforming numbers and other
objects—even other functions! Using Python, you can give a descriptive
name to a function, so it’s easier to understand what’s going on. For ­example,

Introduction   xix
you can name a function that calculates the area of a rectangle by calling it
calculateArea(), like this:

def calculateArea(width,height):

A math textbook published in the 21st century, decades after Benoit


Mandelbrot first generated his famous fractal on a computer when working
for IBM, shows a picture of the Mandelbrot set and gushes over the discov-
ery. The textbook describes the Mandelbrot set, which is shown in Figure 3,
as “a fascinating mathematical object derived from the complex numbers.
Its beautiful boundary illustrates chaotic behavior.”

Figure 3: The Mandelbrot set

The textbook then takes the reader through a painstaking “exploration”


to show how to transform a point in the complex plane. But the student is
only shown how to do this on a calculator, which means only two points can
be transformed (iterated seven times) in a reasonable amount of time. Two
points.
In this book, you’ll learn how to do this in Python, and you’ll make the
program transform hundreds of thousands of points automatically and
even create the Mandelbrot set you see above!

About This Book


This book is about using programming tools to make math fun and rel-
evant, while still being challenging. You’ll make graphs to show all the pos-
sible outputs of a function. You’ll make dynamic, interactive works of art.
You’ll even make an ecosystem with sheep that move around, eat grass, and
multiply, and you’ll create virtual organisms that try to find the shortest
route through a bunch of cities while you watch!

xx   Introduction
You’ll do this using Python and Processing in order to supercharge
what you can do in math class. This book is not about skipping the math;
it’s about using the newest, coolest tools out there to get creative and learn
real computer skills while discovering the connections between math,
art, science, and technology. Processing will provide the graphics, shapes,
motion, and colors, while Python does the calculating and follows your
instructions behind the scenes.
For each of the projects in this book, you’ll build the code up from
scratch, starting from a blank file, and checking your progress at every
step. Through making mistakes and debugging your own programs, you’ll
get a much deeper understanding of what each block of code does.

Who Should Use This Book


This book is for anyone who’s learning math or who wants to use the most
modern tools available to approach math topics like trigonometry and alge-
bra. If you’re learning Python, you can use this book to apply your growing
programming skills to nontrivial projects like cellular automata, genetic
algorithms, and computational art.
Teachers can use the projects in this book to challenge their students
or to make math more approachable and relevant. What better way to teach
matrices than to save a bunch of points to a matrix and use them to draw a
3D figure? When you know Python, you can do this and much more.

What's in This Book?


This book begins with three chapters that cover basic Python concepts
you'll build on to explore more complicated math. The next nine chapters
explore math concepts and problems that you can visualize and solve using
Python and Processing. You can try the exercises peppered throughout the
book to apply what you learned and challenge yourself.
Chapter 1: Drawing Polygons with Turtles teaches basic programming
concepts like loops, variables, and functions using Python’s built-in
turtle module.
Chapter 2: Making Tedious Arithmetic Fun with Lists and Loops goes
deeper into programming concepts like lists and Booleans.
Chapter 3: Guessing and Checking with Conditionals applies your
growing Python skills to problems like factoring numbers and making
an interactive number-guessing game.
Chapter 4: Transforming and Storing Numbers with Algebra ramps up
from solving simple equations to solving cubic equations numerically
and by graphing.
Chapter 5: Transforming Shapes with Geometry shows you how to
create shapes and then multiply, rotate, and spread them all over
the screen.

Introduction   xxi
Chapter 6: Creating Oscillations with Trigonometry goes beyond right
triangles and lets you create oscillating shapes and waves.
Chapter 7: Complex Numbers teaches you how to use complex num-
bers to move points around the screen, creating designs like the
Mandelbrot set.
Chapter 8: Using Matrices for Computer Graphics and Systems of
Equations takes you into the third dimension, where you’ll translate
and rotate 3D shapes and solve huge systems of equations with one
program.
Chapter 9: Building Objects with Classes covers how to create one
object, or as many as your computer can handle, with roaming sheep
and delicious grass locked in a battle for survival.
Chapter 10: Creating Fractals Using Recursion shows how recursion
can be used as a whole new way to measure distances and create wildly
unexpected designs.
Chapter 11: Cellular Automata teaches you how to generate and pro-
gram cellular automata to behave according to rules you make.
Chapter 12: Solving Problems Using Genetic Algorithms shows you
how to harness the theory of natural selection to solve problems we
couldn’t solve in a million years otherwise!

Downloading and Installing Python


The easiest way to get started is to use the Python 3 software distribution,
which is available for free at https://www.python.org/. Python has become
one of the most popular programming languages in the world. It’s used to
­create websites like Google, YouTube, and Instagram, and researchers at
universities all over the world use it to crunch numbers in various fields,
from astronomy to zoology. The latest version released to date is Python 3.7.
Go to https://www.python.org/downloads/ and choose the latest version of
Python 3, as shown in Figure 4.

Figure 4: The official website of the Python Software Foundation

xxii   Introduction
You can choose the version for your operating
system. The site detected that I was using Windows.
Click the file when the download is complete, as
Figure 5: Click the down­
shown in Figure 5.
loaded file to start the
Follow the directions, and always choose the install
default options. It might take a few minutes to
install. After that, search your system for “IDLE.”
That’s the Python IDE, or integrated development environment, which is what
you’ll need to write Python code. Why “IDLE”? The Python programming
language was named after the Monty Python comedy troupe, and one of
the members is Eric Idle.

Starting IDLE
Find IDLE on your system and open it.

Figure 6: Opening IDLE on Windows

A screen called a “shell” will appear. You can use this for the interactive
coding environment, but you’ll want to save your code. Click FileNew
File or press alt-N, and a file will appear (see Figure 7).

Figure 7: Python’s interactive shell (left) and a new module (file) window, ready for code!

This is where you’ll write your Python code. We will also use Processing,
so let’s go over how to download and install Processing next.

Installing Processing
There’s a lot you can do with Python, and we’ll use IDLE a lot. But when
we want to do some heavy-duty graphics, we’re going to use Processing.
Processing is a professional-level graphics library used by coders and artists
to make dynamic, interactive artwork and graphics.

Introduction   xxiii
Go to https://processing.org/download/ and choose your operating system,
as shown in Figure 8.

Figure 8: The Processing website

Download the installer for


your operating system by click-
ing it and following the instruc-
tions. Double-click the icon to
start Processing. This defaults
to Java mode. Click Java to open
the drop-down menu, as shown
in Figure 9, and then click
Add Mode.
Select Python ModeInstall.
It should take a minute or two,
but after this you’ll be able to
code in Python with Processing.
Now that you’ve set up Python
and Processing, you’re ready to
start exploring math!

Figure 9: Where to find other Processing


modes, like the Python mode we’ll be using

xxiv   Introduction
Part I
Hitchin' Up
Your Python
Wagon
Dr awi n g Po lyg o n s with
1
th e Tu rtle m o du le

Centuries ago a Westerner heard a Hindu say the Earth


rested on the back of a turtle. When asked what the turtle was
standing on, the Hindu explained, “It’s turtles all the way down.”

Before you can start using math to build


all the cool things you see in this book,
you’ll need to learn how to give instructions
to your computer using a programming language
called Python. In this chapter you’ll get familiar with
some basic programming concepts like loops, vari-
ables, and functions by using Python’s built-in turtle
tool to draw different shapes. As you’ll see, the turtle
module is a fun way to learn about Python’s basic fea-
tures and get a taste of what you’ll be able to create
with programming.
Other documents randomly have
different content
“But do you want me to take a cure like that, Sir?” came in a
frightened voice from my grandmother.
“It is not necessary, Madame. The symptoms which you describe
will vanish at my bidding. Besides, you have with you a very efficient
person whom I appoint as your doctor from now onwards. That is
your trouble itself, the super-activity of your nerves. Even if I knew
how to cure you of that, I should take good care not to. All I need do
is to control it. I see on your table there one of Bergotte’s books.
Cured of your neurosis you would no longer care for it. Well, I might
feel it my duty to substitute for the joys that it procures for you a
nervous stability which would be quite incapable of giving you those
joys. But those joys themselves are a strong remedy, the strongest
of all perhaps. No; I have nothing to say against your nervous
energy. All I ask is that it should listen to me; I leave you in its
charge. It must reverse its engines. The force which it is now using
to prevent you from getting up, from taking sufficient food, let it
employ in making you eat, in making you read, in making you go out,
and in distracting you in every possible way. You needn’t tell me that
you are fatigued. Fatigue is the organic realisation of a preconceived
idea. Begin by not thinking it. And if ever you have a slight
indisposition, which is a thing that may happen to anyone, it will be
just as if you hadn’t it, for your nervous energy will have endowed
you with what M. de Talleyrand, in an expression full of meaning,
called ‘imaginary health’. See, it has begun to cure you already, you
have been sitting up in bed listening to me without once leaning back
on your pillows; your eye is bright, your complexion is good, I have
been talking to you for half an hour by the clock and you have never
noticed the time. Well, Madame, I shall now bid you good-day.”
When, after seeing Dr. du Boulbon to the door, I returned to the
room in which my mother was by herself, the oppression that had
been weighing on me for the last few weeks lifted, I felt that my
mother was going to break out with a cry of joy and would see my
joy, I felt that inability to endure the suspense of the coming moment
at which a person is going to be overcome with emotion in our
presence, which in another category is a little like the thrill of fear
that goes through one when one knows that somebody is going to
come in and startle one by a door that is still closed; I tried to speak
to Mamma but my voice broke, and, bursting into tears, I stayed for a
long time, my head on her shoulder, crying, tasting, accepting,
relishing my grief, now that I knew that it had departed from my life,
as we like to exalt ourselves by forming virtuous plans which
circumstances do not permit us to put into execution. Françoise
annoyed me by her refusal to share in our joy. She was quite
overcome because there had just been a terrible scene between the
lovesick footman and the tale-bearing porter. It had required the
Duchess herself, in her unfailing benevolence, to intervene, restore
an apparent calm to the household and forgive the footman. For she
was a good mistress, and that would have been the ideal “place” if
only she didn’t listen to “stories”.
During the last few days people had begun to hear of my
grandmother’s illness and to inquire for news of her. Saint-Loup had
written to me: “I do not wish to take advantage of a time when your
dear grandmother is unwell to convey to you what is far more than
mere reproaches, on a matter with which she has no concern. But I
should not be speaking the truth were I to say to you, even out of
politeness, that I shall ever forget the perfidy of your conduct, or that
there can ever be any forgiveness for so scoundrelly a betrayal.” But
some other friends, supposing that my grandmother was not
seriously ill (they may not even have known that she was ill at all),
had asked me to meet them next day in the Champs-Elysées, to go
with them from there to pay a call together, ending up with a dinner
in the country, the thought of which appealed to me. I had no longer
any reason to forego these two pleasures. When my grandmother
had been told that it was now imperative, if she was to obey Dr. du
Boulbon’s orders, that she should go out as much as possible, she
had herself at once suggested the Champs-Elysées. It would be
easy for me to escort her there; and, while she sat reading, to
arrange with my friends where I should meet them later; and I should
still be in time, if I made haste, to take the train with them to Ville
d’Avray. When the time came, my grandmother did not want to go
out; she felt tired. But my mother, acting on du Boulbon’s
instructions, had the strength of mind to be firm and to insist on
obedience. She was almost in tears at the thought that my
grandmother was going to relapse again into her nervous weakness,
which she might never be able to shake off. Never again would there
be such a fine, warm day for an outing. The sun as it moved through
the sky interspersed here and there in the broken solidity of the
balcony its unsubstantial muslins, and gave to the freestone ledge a
warm epidermis, an indefinite halo of gold. As Françoise had not had
time to send a “tube” to her daughter, she left us immediately after
luncheon. She very kindly consented, however, to call first at
Jupien’s, to get a stitch put in the cloak which my grandmother was
going to wear. Returning at that moment from my morning walk I
accompanied her into the shop. “Is it your young master who brings
you here,” Jupien asked Françoise, “is it you who are bringing him to
see me, or is it some good wind and fortune that bring you both?”
For all his want of education, Jupien respected the laws of grammar
as instinctively as M. de Guermantes, in spite of every effort, broke
them. With Françoise gone and the cloak mended, it was time for my
grandmother to get ready. Having obstinately refused to let Mamma
stay in the room with her, she took, left to herself, an endless time
over her dressing, and now that I knew her to be quite well; with that
strange indifference which we feel towards our relatives so long as
they are alive, which makes us put everyone else before them, I felt
it to be very selfish of her to take so long, to risk making me late
when she knew that I had an appointment with my friends and was
dining at Ville d’Avray. In my impatience I finally went downstairs
without waiting for her, after I had twice been told that she was just
ready. At last she joined me, without apologising to me, as she
generally did, for having kept me waiting, flushed and bothered like a
person who has come to a place in a hurry and has forgotten half her
belongings, just as I was reaching the half-opened glass door which,
without warming them with it in the least, let in the liquid, throbbing,
tepid air from the street (as though the sluices of a reservoir had
been opened) between the frigid walls of the passage.
“Oh, dear, if you’re going to meet your friends I ought to have put
on another cloak. I look rather poverty-stricken in this one.”
I was startled to see her so flushed, and supposed that having
begun by making herself late she had had to hurry over her dressing.
When we left the cab at the end of the Avenue Gabriel, in the
Champs-Elysées, I saw my grandmother, without a word to me, turn
aside and make her way to the little old pavilion with its green trellis,
at the door of which I had once waited for Françoise. The same park-
keeper who had been standing there then was still talking to
Françoise’s “Marquise” when, following my grandmother who,
doubtless because she was feeling sick, had her hand in front of her
mouth, I climbed the steps of that little rustic theatre, erected there
among the gardens. At the entrance, as in those circus booths where
the clown, dressed for the ring and smothered in flour, stands at the
door and takes the money himself for the seats, the “Marquise”, at
the receipt of custom, was still there in her place with her huge,
uneven face smeared with a coarse plaster and her little bonnet of
red flowers and black lace surmounting her auburn wig. But I do not
suppose that she recognised me. The park-keeper, abandoning his
watch over the greenery, with the colour of which his uniform had
been designed to harmonise, was talking to her, on a chair by her
side.
“So you’re still here?” he was saying. “You don’t think of retiring?”
“And what have I to retire for, Sir? Will you kindly tell me where I
shall be better off than here, where I should live more at my ease,
and with every comfort? And then there’s all the coming and going,
plenty of distraction; my little Paris, I call it; my customers keep me in
touch with everything that’s going on. Just to give you an example,
there’s one of them who went out not more than five minutes ago;
he’s a magistrate, in the very highest position there is. Very well, Sir,”
she cried with ardour, as though prepared to maintain the truth of this
assertion by violence, should the agent of civic authority shew any
sign of challenging its accuracy, “for the last eight years, do you
follow me, every day God has made, regularly on the stroke of three
he’s been here, always polite, never saying one word louder than
another, never making any mess; and he stays half an hour and
more to read his papers and do his little jobs. There was one day he
didn’t come. I never noticed it at the time, but that evening, all of a
sudden I said to myself: ‘Why, that gentleman never came to-day;
perhaps he’s dead!’ And that gave me a regular turn, you know,
because, of course, I get quite fond of people when they behave
nicely. And so I was very glad when I saw him come in again next
day, and I said to him, I did: ‘I hope there was nothing wrong
yesterday, Sir?’ Then he told me that it was his wife that had died,
and he’d been so put out, poor gentleman, what with one thing and
another, he hadn’t been able to come. He had that really sad look,
you know, people have when they’ve been married five-and-twenty
years, and then the parting, but he seemed pleased, all the same, to
be back here. You could see that all his little habits had been quite
upset. I did what I could to make him feel at home. I said to him: ‘Y’
mustn’t let go of things, Sir. Just come here the same as before, it
will be a little distraction for you in your sorrow.’”
The “Marquise” resumed a gentler tone, for she had observed that
the guardian of groves and lawns was listening to her complacently
and with no thought of contradiction, keeping harmlessly in its
scabbard a sword which looked more like a horticultural implement
or some symbol of a garden-god.
“And besides,” she went on, “I choose my customers, I don’t let
everyone into my little parlours, as I call them. And doesn’t the place
just look like a parlour with all my flowers? Such friendly customers I
have; there’s always some one or other brings me a spray of nice
lilac, or jessamine or roses; my favourite flowers, roses are.”
The thought that we were perhaps despised by this lady because
we never brought any sprays of lilac or fine roses to her bower made
me redden, and in the hope of making a bodily escape—or of being
condemned only by default—from an adverse judgment, I moved
towards the exit. But it is not always in this world the people who
brings us fine roses to whom we are most friendly, for the
“Marquise”, thinking that I was bored, turned to me:
“You wouldn’t like me to open a little place for you?”
And, on my declining:
“No? You’re sure you won’t?” she persisted, smiling. “Well, just as
you please. You’re welcome to it, but I know quite well, not having to
pay for a thing won’t make you want to do it if you don’t want to.”
At this moment a shabbily dressed woman hurried into the place
who seemed to be feeling precisely the want in question. But she did
not belong to the “Marquise’s” world, for the latter, with the ferocity of
a snob, flung at her:
“I’ve nothing disengaged, Ma’am.”
“Will they be long?” asked the poor lady, reddening beneath the
yellow flowers in her hat.
“Well, Ma’am, if you’ll take my advice, you’ll try somewhere else;
you see, there are still these two gentlemen waiting, and I’ve only
one closet; the others are out of order.”
“Not much money there,” she explained when the other had gone.
“It’s not the sort we want here, either; they’re not clean, don’t treat
the place with respect, it would be your humble here that would have
to spend the next hour cleaning up after her ladyship. I’m not sorry to
lose her penny.”
Finally my grandmother emerged, and feeling that she probably
would not seek to atone by a lavish gratuity for the indiscretion that
she had shewn by remaining so long inside, I beat a retreat, so as
not to have to share in the scorn which the “Marquise” would no
doubt heap on her, and began strolling along a path, but slowly, so
that my grandmother should not have to hurry to overtake me; as
presently she did. I expected her to begin: “I am afraid I’ve kept you
waiting; I hope you’ll still be in time for your friends,” but she did not
utter a single word, so much so that, feeling a little hurt, I was
disinclined to speak first; until looking up at her I noticed that as she
walked beside me she kept her face turned the other way. I was
afraid that her heart might be troubling her again. I studied her more
carefully and was struck by the disjointedness of her gait. Her hat
was crooked, her cloak stained; she had the confused and worried
look, the flushed, slightly dazed face of a person who has just been
knocked down by a carriage or pulled out of a ditch.
“I was afraid you were feeling sick, Grandmamma; are you feeling
better now?” I asked her.
Probably she thought that it would be impossible for her, without
alarming me, not to make some answer.
“I heard the whole of her conversation with the keeper,” she told
me. “Could anything have been more typical of the Guermantes, or
the Verdurins and their little circle? Heavens, what fine language she
put it all in!” And she quoted, with deliberate application, this
sentence from her own special Marquise, Mme. de Sévigné: “As I
listened to them I thought that they were preparing for me the
pleasures of a farewell.”
Such was the speech that she made me, a speech into which she
had put all her critical delicacy, her love of quotations, her memory of
the classics, more thoroughly even than she would naturally have
done, and as though to prove that she retained possession of all
these faculties. But I guessed rather than heard what she said, so
inaudible was the voice in which she muttered her sentences,
clenching her teeth more than could be accounted for by the fear of
being sick again.
“Come!” I said lightly, so as not to seem to be taking her illness too
seriously, “since your heart is bothering you, shall we go home now?
I don’t want to trundle a grandmother with indigestion about the
Champs-Elysées.”
“I didn’t like to suggest it, because of your friends,” she replied.
“Poor boy! But if you don’t mind, I think it would be wiser.”
I was afraid of her noticing the strange way in which she uttered
these words.
“Come!” I said to her sharply, “you mustn’t tire yourself talking; if
your heart is bad, it’s silly; wait till we get home.”
She smiled at me sorrowfully and gripped my hand. She had
realised that there was no need to hide from me what I had at once
guessed, that she had had a slight stroke.
PART II
CHAPTER ONE

We made our way back along the Avenue Gabriel, through the
strolling crowd. I left my grandmother to rest on a seat and went in
search of a cab. She, in whose heart I always placed myself when I
had to form an opinion of the most unimportant person, she was now
closed to me, had become part of the world outside, and, more than
from any casual passer-by, I was obliged to keep from her what I
thought of her condition, to say no word of my uneasiness. I could
not have spoken of it to her in greater confidence than to a stranger.
She had suddenly handed back to me the thoughts, the griefs which,
from the days of my infancy, I had entrusted for all time to her
keeping. She was not yet dead. I was already alone. And even those
allusions which she had made to the Guermantes, to Mme. de
Sévigné, to our conversations about the little clan, assumed an air of
being without point or occasion, fantastic, because they sprang from
the nullity of this very being who to-morrow possibly would have
ceased to exist, for whom they would no longer have any meaning,
from that nullity, incapable of conceiving them, which my
grandmother would shortly be.
“Well, sir, I don’t like to say no, but you have not made an
appointment, you have no time fixed. Besides, this is not my day for
seeing patients. You surely have a doctor of your own. I cannot
interfere with his practice, unless he were to call me in for a
consultation. It’s a question of professional etiquette....”
Just as I was signalling to a cabman, I had caught sight of the
famous Professor E——, almost a friend of my father and
grandfather, acquainted at any rate with them both, who lived in the
Avenue Gabriel, and, with a sudden inspiration, had stopped him just
as he was entering his house, thinking that he would perhaps be the
very person to advise my grandmother. But he was evidently in a
hurry and, after calling for his letters, seemed anxious to get rid of
me, so that my only chance of speaking to him lay in going up with
him in the lift, of which he begged me to allow him to work the
switches himself, this being a mania with him.
“But, sir, I am not asking you to see my grandmother here; you will
realise from what I am trying to tell you that she is not in a fit state to
come; what I am asking is that you should call at our house in half an
hour’s time, when I have taken her home.”
“Call at your house! Really, sir, you must not expect me to do that.
I am dining with the Minister of Commerce. I have a call to pay first. I
must change at once, and to make matters worse I have torn my
coat and my other one has no buttonholes for my decorations. I beg
you, please, to oblige me by not touching the switches. You don’t
know how the lift works; one can’t be too careful. Getting that
buttonhole made means more delay. Well, as I am a friend of your
people, if your grandmother comes here at once I will see her. But I
warn you that I shall be able to give her exactly a quarter of an hour,
not a moment more.”
I had started off at once, without even getting out of the lift which
Professor E—— had himself set in motion to take me down again,
casting a suspicious glance at me as he did so.
We may, indeed, say that the hour of death is uncertain, but when
we say so we represent that hour to ourselves as situated in a vague
and remote expanse of time, it never occurs to us that it can have
any connexion with the day that has already dawned, or may signify
that death—or its first assault and partial possession of us, after
which it will never leave hold of us again—may occur this very
afternoon, so far from uncertain, this afternoon every hour of which
has already been allotted to some occupation. You make a point of
taking your drive every day so that in a month’s time you will have
had the full benefit of the fresh air; you have hesitated over which
cloak you will take, which cabman to call, you are in the cab, the
whole day lies before you, short because you have to be at home
early, as a friend is coming to see you; you hope that it will be as fine
again to-morrow; and you have no suspicion that death, which has
been making its way towards you along another plane, shrouded in
an impenetrable darkness, has chosen precisely this day of all days
to make its appearance, in a few minutes’ time, more or less, at the
moment when the carriage has reached the Champs-Elysées.
Perhaps those who are haunted as a rule by the fear of the utter
strangeness of death will find something reassuring in this kind of
death—in this kind of first contact with death—because death thus
assumes a known, familiar guise of everyday life. A good luncheon
has preceded it, and the same outing that people take who are in
perfect health. A drive home in an open carriage comes on top of its
first onslaught; ill as my grandmother was, there were, after all,
several people who could testify that at six o’clock, as we came
home from the Champs-Elysées, they had bowed to her as she
drove past in an open carriage, in perfect weather. Legrandin,
making his way towards the Place de la Concorde, raised his hat to
us, stopping to look after us with an air of surprise. I, who was not
yet detached from life, asked my grandmother if she had
acknowledged his greeting, reminding her of his readiness to take
offence. My grandmother, thinking me no doubt very frivolous, raised
her hand in the air as though to say: “What does it matter? It is not of
the least importance.”
Yes, one might have said that, a few minutes earlier, when I was
looking for a cab, my grandmother was resting on a seat in the
Avenue Gabriel, and that a little later she had driven past in an open
carriage. But would that have been really true? The seat, for
instance, to maintain its position at the side of an avenue—for all that
it may be subjected also to certain conditions of equilibrium—has no
need of energy. But in order that a living person may be stable, even
when supported by a seat or in a carriage, there is required a tension
of forces which we do not ordinarily perceive, any more than we
perceive (because its action is universal) atmospheric pressure.
Possibly if we were to be hollowed out and then left to support the
pressure of the air we might feel, in the moment that preceded our
extinction, that terrible weight which there was nothing left in us to
neutralise. Similarly when the abyss of sickness and death opens
within us, and we have no longer any resistance to offer to the tumult
with which the world and our own body rush upon us, then to endure
even the tension of our own muscles, the shudder that freezes us to
the marrow, then even to keep ourself motionless in what we
ordinarily regard as nothing but the simple negative position of a
lifeless thing requires, if we wish our head to remain erect and our
eyes calm, an expense of vital energy and becomes the object of an
exhausting struggle.
And if Legrandin had looked back at us with that astonished air, it
was because to him, as to the other people who passed us then, in
the cab in which my grandmother was apparently seated she had
seemed to De foundering, sliding into the abyss, clinging desperately
to the cushions which could barely arrest the downward plunge of
her body, her hair in disorder, her eye wild, unable any longer to face
the assault of the images which its pupil was not strong enough now
to bear. She had appeared to them, although I was still by her side,
submerged in that unknown world somewhere in which she had
already received the blows, traces of which she still bore when I
looked up at her a few minutes earlier in the Champs-Elysées, her
hat, her face, her cloak left in disorder by the hand of the invisible
angel with whom she had wrestled. I have thought, since, that this
moment of her stroke cannot have altogether surprised my
grandmother, that indeed she had perhaps foreseen it a long time
back, had lived in expectation of it. She had not known, naturally,
when this fatal moment would come, had never been certain, any
more than those lovers whom a similar doubt leads alternately to
found unreasonable hopes and unjustified suspicions on the fidelity
of their mistresses. But it is rarely that these grave maladies, like that
which now at last had struck her full in the face, do not take up their
abode in the sick man for a long time before killing him, during which
time they make haste, like a “sociable” neighbour or tenant, to
introduce themselves to him. A terrible acquaintance, not so much
from the sufferings that it causes as from the strange novelty of the
definite restriction which it imposes upon life. A woman sees herself
dying, in these cases not at the actual moment of death but months,
sometimes years before, when death has hideously come to dwell in
her. The sufferer makes the acquaintance of the stranger whom she
hears coming and going in her brain. She does not know him by
sight, it is true, but from the sounds which she hears him regularly
make she can form an idea of his habits. Is he a criminal? One
morning, she can no longer hear him. He has gone. Ah! If it were
only for ever! In the evening he has returned. What are his plans?
Her specialist, put to the question, like an adored mistress, replies
with avowals that one day are believed, another day fail to convince
her. Or rather it is not the mistress’s part but that of the servants one
interrogates that the doctor plays. They are only third parties. The
person whom we press for an answer, whom we suspect of being
about to play us false, is life itself, and although we feel her to be no
longer the same we believe in her still or at least remain undecided
until the day on which she finally abandons us.
I helped my grandmother into Professor E——’s lift and a moment
later he came to us and took us into his consulting room. But there,
busy as he was, his bombastic manner changed, such is the force of
habit; for his habit was to be friendly, that is to say lively with his
patients. Since he knew that my grandmother was a great reader,
and was himself one also, he devoted the first few minutes to
quoting various favourite passages of poetry appropriate to the
glorious summer weather. He had placed her in an armchair and
himself with his back to the light so as to have a good view of her.
His examination was minute and thorough, even obliging me at one
moment to leave the room. He continued it after my return, then,
having finished, went on, although the quarter of an hour was almost
at an end, repeating various quotations to my grandmother. He even
made a few jokes, which were witty enough, though I should have
preferred to hear them on some other occasion, but which
completely reassured me by the tone of amusement in which he
uttered them. I then remembered that M. Fallières, the President of
the Senate, had, many years earlier, had a false seizure, and that to
the consternation of his political rivals he had returned a few days
later to his duties and had begun, it was said, his preparations for a
more or less remote succession to the Presidency of the Republic.
My confidence in my grandmother’s prompt recovery was all the
more complete in that, just as I was recalling the example of M.
Fallières, I was distracted from following up the similarity by a shout
of laughter, which served as conclusion to one of the Professor’s
jokes. After which he took out his watch, wrinkled his brows
petulantly on seeing that he was five minutes late, and while he bade
us good-bye rang for his other coat to be brought to him at once. I
waited until my grandmother had left the room, closed the door and
asked him to tell me the truth.
“There is not the slightest hope,” he informed me. “It is a stroke
brought on by uraemia. In itself, uraemia is not necessarily fatal, but
this case seems to me desperate. I need not tell you that I hope I am
mistaken. Anyhow, you have Cottard, you’re in excellent hands.
Excuse me,” he broke off as a maid came into the room with his coat
over her arm. “I told you, I’m dining with the Minister of Commerce,
and I have a call to pay first. Ah! Life is not all a bed of roses, as one
is apt to think at your age.”
And he graciously offered me his hand. I had shut the door behind
me, and a footman was shewing us into the hall when we heard a
loud shout of rage. The maid had forgotten to cut and hem the
buttonhole for the decorations. This would take another ten minutes.
The Professor continued to storm while I stood on the landing gazing
at a grandmother for whom there was not the slightest hope. Each of
us is indeed alone. We started for home.
The sun was sinking, it burnished an interminable wall along which
our cab had to pass before reaching the street in which we lived, a
wall against which the shadow cast by the setting sun of horse and
carriage stood out in black on a ruddy background, like a funeral car
on some Pompeian terra-cotta. At length we arrived at the house. I
made the invalid sit at the foot of the staircase in the hall, and went
up to warn my mother. I told her that my grandmother had come
home feeling slightly unwell, after an attack of giddiness. As soon as
I began to speak, my mother’s face was convulsed by the paroxysm
of a despair which was yet already so resigned that I realised that for
many years she had been holding herself quietly in readiness for an
uncalendared but final day. She asked me no question; it seemed
that, just as malevolence likes to exaggerate the sufferings of other
people, so in her devotion she would not admit that her mother was
seriously ill, especially with a disease which might affect the brain.
Mamma shuddered, her eyes wept without tears, she ran to give
orders for the doctor to be fetched at once; but when Françoise
asked who was ill she could not reply, her voice stuck in her throat.
She came running downstairs with me, struggling to banish from her
face the sob that contracted it. My grandmother was waiting below
on the sofa in the hall, but, as soon as she heard us coming, drew
herself together, stood up, and waved her hand cheerfully at
Mamma. I had partially wrapped her head in a white lace shawl,
telling her that it was so that she should not catch cold on the stairs. I
had hoped that my mother would not notice the change in her face,
the distortion of her mouth; my precaution proved unnecessary; my
mother went up to my grandmother, kissed her hand as though it
were that of her God, raised her up, carried her to the lift with infinite
precautions in which there was, with the fear of hurting her by any
clumsy movement, the humility of one who felt herself unworthy to
touch the most precious thing, to her, in the world, but never once
did she raise her eyes, nor look at the sufferer’s face. Perhaps this
was in order that my grandmother might not be saddened by the
thought that the sight of her could alarm her daughter. Perhaps from
fear of a grief so piercing that she dared not face it. Perhaps from
reverence, because she did not feel it permissible to herself, without
impiety, to remark the trace of any mental weakening on those
venerated features. Perhaps to be better able to preserve intact in
her memory the image of the true face of my grandmother, radiant
with wisdom and goodness. So they went up side by side, my
grandmother half hidden by her shawl, my mother turning away her
eyes.
Meanwhile there was one person who never took hers from what
could be made out of my grandmother’s altered features, at which
her daughter dared not look, a person who fastened on them a gaze
wondering, indiscreet and of evil omen: this was Françoise. Not that
she was not sincerely attached to my grandmother (indeed she had
been disappointed and almost scandalised by the coldness shewn
by Mamma, whom she would have liked to see fling herself weeping
into her mother’s arms), but she had a certain tendency always to
look at the worse side of things, she had retained from her childhood
two peculiarities which would seem to be mutually exclusive, but
which when combined strengthened one another: the want of
restraint common among people of humble origin who make no
attempt to conceal the impression, in other words the painful alarm
aroused in them by the sight of a physical change which it would be
in better taste to appear not to notice, and the unfeeling coarseness
of the peasant who begins by tearing the wings off dragonflies until
she is allowed to wring the necks of chickens, and lacks that
modesty which would make her conceal the interest that she feels in
the sight of suffering flesh.
When, thanks to the faultless ministrations of Françoise, my
grandmother had been put to bed, she discovered that she could
speak much more easily, the little rupture or obstruction of a blood-
vessel which had produced the uraemia having apparently been
quite slight. And at once she was anxious not to fail Mamma in her
hour of need, to assist her in the most cruel moments through which
she had yet had to pass.
“Well, my child,” she began, taking my mother’s hand in one of her
own, and keeping the other in front of her lips, so as to account for
the slight difficulty which she still found in uttering certain words. “So
this is all the pity you shew your mother! You look as if you thought
that indigestion was quite a pleasant thing!”
Then for the first time my mother’s eyes gazed passionately into
those of my grandmother, not wishing to see the rest of her face, and
she replied, beginning the list of those false promises which we
swear but are unable to fulfil:
“Mamma, you will soon be quite well again, your daughter will see
to that.”
And embodying all her dearest love, all her determination that her
mother should recover, in a kiss to which she entrusted them, and
which she followed with her mind, with her whole being until it
flowered upon her lips, she bent down to lay it humbly, reverently
upon the precious brow. My grandmother complained of a sort of
alluvial deposit of bedclothes which kept gathering all the time in the
same place, over her left leg, and from which she could never
manage to free herself. But she did not realise that she was herself
the cause of this (so that day after day she accused Françoise
unjustly of not “doing” her bed properly). By a convulsive movement
she kept flinging to that side the whole flood of those billowing
blankets of fine wool, which gathered there like the sand in a bay
which is very soon transformed into a beach (unless the inhabitants
construct a breakwater) by the successive deposits of the tide.
My mother and I (whose falsehood was exposed before we spoke
by the obnoxious perspicacity of Françoise) would not even admit
that my grandmother was seriously ill, as though such an admission
might give pleasure to her enemies (not that she had any) and it was
more loving to feel that she was not so bad as all that, in short from
the same instinctive sentiment which had led me to suppose that
Andrée was too sorry for Albertine to be really fond of her. The same
individual phenomena are reproduced in the mass, in great crises. In
a war, the man who does not love his country says nothing against it,
but regards it as lost, commiserates it, sees everything in the darkest
colours.
Françoise was of infinite value to us owing to her faculty of doing
without sleep, of performing the most arduous tasks. And if, when
she had gone to bed after several nights spent in the sickroom, we
were obliged to call her a quarter of an hour after she had fallen
asleep, she was so happy to be able to do the most tiring duties as if
they had been the simplest things in the world that, so far from
looking cross, her face would light up with a satisfaction tinged with
modesty. Only when the time came for mass, or for breakfast, then,
had my grandmother been in her death agony, still Françoise would
have quietly slipped away so as not to make herself late. She neither
could nor would let her place be taken by her young footman. It was
true that she had brought from Combray an extremely exalted idea
of everyone’s duty towards ourselves; she would not have tolerated
that any of our servants should “fail” us. This doctrine had made her
so noble, so imperious, so efficient an instructor that there had never
come to our house any servants, however corrupted, who had not
speedily modified, purified their conception of life so far as to refuse
to touch the usual commissions from tradesmen and to come
rushing—however little they might previously have sought to oblige
—to take from my hands and not let me tire myself by carrying the
smallest package. But at Combray Françoise had contracted also—
and had brought with her to Paris—the habit of not being able to put
up with any assistance in her work. The sight of anyone coming to
help her seemed to her like receiving a deadly insult, and servants
had remained for weeks in the house without receiving from her any
response to their morning greeting, had even gone off on their
holidays without her bidding them good-bye or their guessing her
reason, which was simply and solely that they had offered to do a
share of her work on some day when she had not been well. And at
this moment when my grandmother was so ill Françoise’s duties
seemed to her peculiarly her own. She would not allow herself, she,
the official incumbent, to be done out of her part in the ritual of these
festal days. And so her young footman, sent packing by her, did not
know what to do with himself, and not content with having copied the
butler’s example and supplied himself with note-paper from my desk
had begun as well to borrow volumes of poetry from my
bookshelves. He sat reading them for a good half of the day, out of
admiration for the poets who had written them, but also so as, during
the rest of his time, to begem with quotations the letters which he
wrote to his friends in his native village. Naturally he expected these
to dazzle them. But as there was little sequence in his ideas he had
formed the notion that these poems, picked out at random from my
shelves, were matters of common knowledge, to which it was
customary to refer. So much so that in writing to these peasants,
whose stupefaction he discounted, he interspersed his own
reflexions with lines from Lamartine, just as he might have said “Who
laughs last, laughs longest!” or merely “How are you keeping?”
To ease her pain my grandmother was given morphine.
Unfortunately, if this relieved her in other ways, it increased the
quantity of albumen. The blows which we aimed at the wicked ogre
who had taken up his abode in my grandmother were always wide of
the mark, and it was she, her poor interposed body that had to bear
them, without her ever uttering more than a faint groan by way of
complaint. And the pain that we caused her found no compensation
in a benefit which we were unable to give her. The savage ogre
whom we were anxious to exterminate we barely succeeded in
touching, and all we did was to enrage him still further, and possibly
hasten the moment at which he would devour his luckless captive.
On certain days when the discharge of albumen had been excessive
Cottard, after some hesitation, stopped the morphine. In this man, so
insignificant, so common, there was, in these brief moments in which
he deliberated, in which the relative dangers of one and another
course of treatment presented themselves alternately to his mind
until he arrived at a decision, the same sort of greatness as in a
general who, vulgar in all the rest of his life, is a great strategist, and
in an hour of peril, after a moment’s reflexion, decides upon what is
from the military point of view the wisest course, and gives the order:
“Advance eastwards.” Medically, however little hope there might be
of setting any limit to this attack of uraemia, it did not do to tire the
kidneys. But, on the other hand, when my grandmother did not have
morphine, her pain became unbearable; she perpetually attempted a
certain movement which it was difficult for her to perform without
groaning. To a great extent, suffering is a sort of need felt by the
organism to make itself familiar with a new state, which makes it
uneasy, to adapt its sensibility to that state. We can discern this
origin of pain in the case of certain inconveniences which are not
such for everyone. Into a room filled with a pungent smoke two men
of a coarse fibre will come and attend to their business; a third, more
highly strung, will betray an incessant discomfort. His nostrils will
continue to sniff anxiously the odour he ought, one would say, to try
not to notice but will keep on attempting to attach, by a more exact
apprehension of it, to his troubled sense of smell. One consequence
of which may well be that his intense preoccupation will prevent him
from complaining of a toothache. When my grandmother was in pain
the sweat trickled over the pink expanse of her brow, glueing to it her
white locks, and if she thought that none of us was in the room she
would cry out: “Oh, it’s dreadful!” but if she caught sight of my
mother, at once she employed all her energy in banishing from her
face every sign of pain, or—an alternative stratagem—repeated the
same plaints, accompanying them with explanations which gave a
different sense, retrospectively, to those which my mother might
have overheard:
“Oh! My dear, it’s dreadful to have to stay in bed on a beautiful
sunny day like this when one wants to be out in the air; I am crying
with rage at your orders.”
But she could not get rid of the look of anguish in her eyes, the
sweat on her brow, the convulsive start, checked at once, of her
limbs.
“There is nothing wrong. I’m complaining because I’m not lying
very comfortably. I feel my hair is untidy, my heart is bad, I knocked
myself against the wall.”
And my mother, at the foot of the bed, rivetted to that suffering
form, as though, by dint of piercing with her gaze that pain-bedewed
brow, that body which hid the evil thing within it, she could have
succeeded in reaching that evil thing and carrying it away, my
mother said:
“No, no, Mamma dear, we won’t let you suffer like that, we will find
something to take it away, have patience just for a moment; let me
give you a kiss, darling—no, you’re not to move.”
And stooping over the bed, with bended knees, almost kneeling on
the ground, as though by an exercise of humility she would have a
better chance of making acceptable the impassioned gift of herself,
she lowered towards my grandmother her whole life contained in her
face as in a ciborium which she extended over her, adorned in relief
with dimples and folds so passionate, so sorrowful, so sweet that
one knew not whether they had been carved by the chisel of a kiss,
a sob or a smile. My grandmother, also, tried to lift up her face to
Mamma’s. It was so altered that probably, had she been strong
enough to go out, she would have been recognised only by the
feather in her hat. Her features, like the clay in a sculptor’s hands,
seemed to be straining, with an effort which distracted her from
everything else, to conform to some particular model which we failed
to identify. This business of modelling was now almost finished, and
if my grandmother’s face had shrunk in the process it had at the
same time hardened. The veins that ran beneath its surface seemed
those not of a piece of marble but of some more rugged stone.
Constantly thrust forwards by the difficulty that she found in
breathing and as constantly forced back on to her pillow by
exhaustion, her face, worn, diminished, terribly expressive, seemed
like, in a primitive, almost prehistoric carving, the rude, flushed,
purplish, desperate face of some savage guardian of a tomb. But the
whole task was not yet accomplished. Next, her resistance must be
overcome, and that tomb, the entrance to which she had so painfully
guarded, with that tense contraction, entered.
In one of those moments in which, as the saying goes, one does
not know what saint to invoke, as my grandmother was coughing
and sneezing a good deal, we took the advice of a relative who
assured us that if we sent for the specialist X—— he would get rid of
all that in a couple of days. People say that sort of thing about their
own doctors, and their friends believe them just as Françoise always
believed the advertisements in the newspapers. The specialist came
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like