Table of contents : Preface Contents 1 Primes 1.1 Introduction 1.2 Primes and Cryptography 1.3 Back to the Math 1.4 Algorithms for Testing Primality 1.5 e and the Prime Number Theorem 1.5.1 e 1.5.2 The Prime Number Theorem 1.6 Two Fascinating Questions 1.6.1 Goldbach's Conjecture 1.6.2 Twin Primes 1.7 Puzzle 1.8 Exercises 1.8.1 Hints 2 The Euclidean Algorithm 2.1 The Extended Euclidean Algorithm 2.2 Uniqueness of Factorization into Primes 2.3 Puzzle 2.4 Exercises 2.4.1 Hint 3 Modular Arithmetic 3.1 Modular Arithmetic 3.2 Discrete Logarithms 3.3 Fermat's Little Theorem 3.4 The Chinese Remainder Theorem 3.5 Puzzle 3.6 Exercises 3.6.1 Hints 4 Irrationals 4.1 Rationals and Irrationals 4.2 The Rationals Are the Reals with Repeating Decimal Representations 4.3 Square Roots 4.3.1 The Pythagorean Theorem 4.3.2 Square Roots 4.4 Puzzle 4.5 Exercises 4.5.1 Hints 5 i 5.1 Roots of Polynomials 5.2 The Geometric Representation and Normof a Complex Number 5.3 e to a Complex Power 5.4 Infinite Series 5.5 Puzzle 5.6 Exercises 5.6.1 Hint 6 Infinities and Diagonalization 6.1 Finite Sets 6.2 Infinite Sets 6.3 The Set of Rationals Is Countable 6.4 The Set of Reals Is Uncountable 6.5 The Halting Problem Is Undecidable 6.6 Puzzle 6.7 Exercises 6.7.1 Hints 7 Binary Search 7.1 Binary Search 7.2 Computers, Calculators, and Finite Precision 7.3 Square Roots via Binary Search 7.3.1 Time Analysis 7.3.2 But Floating-Point Calculations Are Inexact! 7.4 Puzzle 7.5 Exercises 7.5.1 Hints 8 Newton's Method 8.1 Introduction 8.2 How to Improve a Solution 8.3 Extension to Other Functions 8.4 Tangent Lines 8.5 How Good Is Newton's Method? 8.6 A Personal Note 8.7 Puzzle 8.8 Exercises 8.8.1 Hint 9 Graph Theory 9.1 Introduction 9.2 Planarity 9.3 Graph Coloring 9.3.1 Vertex Coloring 9.3.2 Edge Coloring 9.4 Eulerian Multigraphs 9.5 Minimum Spanning Trees 9.5.1 Basic Facts 9.5.2 The Minimum Spanning Tree Algorithm 9.6 Puzzle 9.7 Exercises 9.7.1 Hints 10 Probability 10.1 Examples 10.2 Independence 10.3 Birthday Parties 10.3.1 Hitting a Specific Date 10.3.2 Getting Two Identical Birthdays 10.4 Gambling 10.5 Let's Make a Deal 10.6 The (Magical) Probabilistic Method 10.7 The Central Limit Theorem 10.8 Puzzle 10.9 Exercises 10.9.1 Hints 11 Fractals 11.1 The Cantor Set and the Sierpiński Triangle 11.2 The Mandelbrot Set 11.2.1 Background 11.2.2 Definition of the Mandelbrot Set 11.2.3 Drawing the Mandelbrot Set 11.3 The Newton Fractal 11.4 Box-Counting Dimension 11.4.1 Introduction 11.4.2 The Cantor Set 11.4.3 The Sierpiński Triangle 11.5 Puzzle 11.6 Exercises 11.6.1 Hint 12 Solutions to Puzzles 12.1 Chapter 1: Light Bulb Switches 12.2 Chapter 2: Belt Around the Equator 12.3 Chapter 3: Two Trains and a Fly 12.4 Chapter 4: Writing the Year as a Sum of Positive Integers with Maximum Product 12.5 Chapter 5: Two Towers 12.6 Chapter 6: A 1010 Board 12.7 Chapter 7: Distribution of Genders 12.8 Chapter 8: A Hunter and a Bear 12.9 Chapter 9: A Mathematician's Children 12.10 Chapter 10: Cutting Up Chocolate 12.11 Chapter 11: Uptown and Downtown Girlfriends Acknowledgments References Index