Table Of ContentGood Math
A Geek’s Guide to the Beauty of Numbers, Logic,
and Computation
by Mark C. Chu-Carroll
Version: P1.0 (July 2013)
Copyright © 2013 The Pragmatic Programmers, LLC. This book is licensed to
the individual who purchased it. We don't copy-protect it because that would
limit your ability to use it for your own purposes. Please don't break this trust—
you can use this across all of your devices but please do not share this copy with
other members of your team, with friends, or via file sharing services. Thanks.
—Dave & Andy.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and The Pragmatic
Programmers, LLC
was aware of a trademark claim, the designations have been printed in initial
capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic
Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking
g device are trademarks of The Pragmatic Programmers,
LLC.
Every precaution was taken in the preparation of this
book. However, the publisher assumes no responsibility for errors or omissions,
or for damages that may result from the use of information (including program
listings) contained herein.
Our Pragmatic courses,
workshops, and other products can help you and your team create better software
and have more fun. For more information, as well as the latest Pragmatic titles,
please visit us at
http://pragprog.com.
This book is dedicated to the memory of my father, Irving Carroll (zt"l).
He set me on the road to becoming a math geek, which is why this book exists.
More importantly, he showed me, by example, how to be a mensch: by living
honestly, with compassion, humor, integrity, and hard work.
Table of Contents
Preface
Where’d This Book Come From?
Who This Book Is For
How to Read This Book
What Do You Need?
Acknowledgments
I. Numbers
1. Natural Numbers
1.1 The Naturals, Axiomatically Speaking
1.2 Using Peano Induction
2. Integers
2.1What’s an Integer?
2.2 Constructing the Integers—Naturally
3. Real Numbers
3.1 The Reals, Informally
3.2 The Reals, Axiomatically
3.3 The Reals, Constructively
4. Irrational and Transcendental Numbers
4.1What Are Irrational Numbers?
4.2 The Argh! Moments of Irrational Numbers
4.3What Does It Mean, and Why Does It Matter?
II. Funny Numbers
5. Zero
5.1 The History of Zero
5.2 An Annoyingly Difficult Number
6. e: The Unnatural Natural Number
6.1 The Number That’s Everywhere
6.2 History
6.3 Does e Have a Meaning?
7. φ: The Golden Ratio
7.1What Is the Golden Ratio?
7.2 Legendary Nonsense
7.3Where It Really Lives
8. i: The Imaginary Number
8.1 The Origin of i
8.2What i Does
8.3What i Means
III. Writing Numbers
9. Roman Numerals
9.1 A Positional System
9.2Where Did This Mess Come From?
9.3 Arithmetic Is Easy (But an Abacus Is Easier)
9.4 Blame Tradition
10. Egyptian Fractions
10.1 A 4000-Year-Old Math Exam
10.2 Fibonacci’s Greedy Algorithm
10.3 Sometimes Aesthetics Trumps Practicality
11. Continued Fractions
11.1 Continued Fractions
11.2 Cleaner, Clearer, and Just Plain Fun
11.3 Doing Arithmetic
IV. Logic
12. Mr. Spock Is Not Logical
12.1What Is Logic, Really?
12.2 FOPL, Logically
12.3 Show Me Something New!
13. Proofs, Truth, and Trees: Oh My!
13.1 Building a Simple Proof with a Tree
13.2 A Proof from Nothing
13.3 All in the Family
13.4 Branching Proofs
14. Programming with Logic
14.1 Computing Family Relationships
14.2 Computation with Logic
15. Temporal Reasoning
15.1 Statements That Change with Time
15.2What’s CTL Good For?
V. Sets
16. Cantor’s Diagonalization: Infinity Isn’t Just Infinity
16.1 Sets, Naively
16.2 Cantor’s Diagonalization
16.3 Don’t Keep It Simple, Stupid
17. Axiomatic Set Theory: Keep the Good, Dump the Bad
17.1 The Axioms of ZFC Set Theory
17.2 The Insanity of Choice
17.3Why?
18. Models: Using Sets as the LEGOs of the Math World
18.1 Building Natural Numbers
18.2Models from Models: From Naturals to Integers and Beyond!
19. Transfinite Numbers: Counting and Ordering Infinite Sets
19.1 Introducing the Transfinite Cardinals
19.2 The Continuum Hypothesis
19.3Where in Infinity?
20. Group Theory: Finding Symmetries with Sets
20.1 Puzzling Symmetry
20.2 Different Kinds of Symmetry
20.3 Stepping into History
20.4 The Roots of Symmetry
VI. Mechanical Math
21. Finite State Machines: Simplicity Goes Far
21.1 The Simplest Machine
21.2 Finite State Machines Get Real
21.3 Bridging the Gap: From Regular Expressions to Machines
22. The Turing Machine
22.1 Adding a Tape Makes All the Difference
22.2 Going Meta: The Machine That Imitates Machines
23. Pathology and the Heart of Computing
23.1 Introducing BF: The Great, the Glorious, and the Completely Silly
23.2 Turing Complete, or Completely Pointless?
23.3 From the Sublime to the Ridiculous
24. Calculus: No, Not That Calculus—λ Calculus
24.1Writing λ Calculus: It’s Almost Programming!
24.2 Evaluation: Run It!
24.3 Programming Languages and Lambda Strategies
25. Numbers, Booleans, and Recursion
25.1 But Is It Turing Complete?
25.2 Numbers That Compute Themselves
25.3 Decisions? Back to Church
25.4 Recursion: Y Oh Y Oh Y?
26. Types, Types, Types: Modeling λ Calculus
26.1 Playing to Type
26.2 Prove It!
26.3What’s It Good For?
27. The Halting Problem
27.1 A Brilliant Failure
27.2 To Halt or Not To Halt?
Bibliography
Copyright © 2013, The Pragmatic Bookshelf.
Early praise for Good Math
Mark Chu-Carroll is one of the premiere math bloggers in the world, able to
guide readers through complicated concepts with delightful casualness. In Good
Math he brings that same skill to a book-length journey through math, from the
basic notion of numbers through recent developments in computer programming.
If you have ever been curious about the golden ratio or Turing machines or why
pi never runs out of numbers, this is the book for you.
→ Carl Zimmer
author of “Matter,” a weekly column about science in The New York Times (
http://bit.ly/NYTZimmer ); and “The Loom,” a National Geographic
Magazine blog ( http://phenomena.nationalgeographic.com/blog/the-loom )
Fans of Mark Chu-Carroll’s lively and informative blog, Good Math/Bad Math,
will find much to savor in this mathematical guide for the “geekerati.” Chu-Carroll
covers it all, from the basics of natural, irrational, and imaginary numbers and
the golden ratio to Cantor sets, group theory, logic, proofs, programming, and
Turing machines. His love for his subject shines through every page. He’ll help
you love it, too.
→ Jennifer Ouellette
author of The Calculus Diaries
Preface