ebook img

Mathematics for Computer Science (MIT 6.042J) PDF

919 Pages·2017·5.924 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Mathematics for Computer Science (MIT 6.042J)

“mcs” — 2015/5/18 — 1:43 — page i — #1 Mathematics for Computer Science revised Monday 18th May, 2015, 01:43 Eric Lehman Google Inc. F Thomson Leighton Department of Mathematics and the Computer Science and AI Laboratory, Massachussetts Institute of Technology; Akamai Technologies Albert R Meyer Department of Electrical Engineering and Computer Science and the Computer Science and AI Laboratory, Massachussetts Institute of Technology 2015,EricLehman,FTomLeighton,AlbertRMeyer.ThisworkisavailableunderthetermsoftheCreativeCommons Attribution-NonCommercial-ShareAlike 3.0 license. “mcs” — 2015/5/18 — 1:43 — page ii — #2 “mcs” — 2015/5/18 — 1:43 — page iii — #3 Contents I Proofs Introduction 3 0.1 References 4 1 What is a Proof? 5 1.1 Propositions 5 1.2 Predicates 8 1.3 The Axiomatic Method 8 1.4 Our Axioms 9 1.5 Proving an Implication 11 1.6 Proving an “If and Only If” 13 1.7 Proof by Cases 15 1.8 Proof by Contradiction 16 1.9 Good Proofs in Practice 17 1.10 References 19 2 The Well Ordering Principle 27 2.1 Well Ordering Proofs 27 2.2 Template for Well Ordering Proofs 28 2.3 Factoring into Primes 30 2.4 Well Ordered Sets 31 3 Logical Formulas 41 3.1 Propositions from Propositions 42 3.2 Propositional Logic in Computer Programs 45 3.3 Equivalence and Validity 48 3.4 The Algebra of Propositions 50 3.5 The SAT Problem 55 3.6 Predicate Formulas 56 3.7 References 61 4 Mathematical Data Types 81 4.1 Sets 81 4.2 Sequences 86 4.3 Functions 87 4.4 Binary Relations 89 4.5 Finite Cardinality 93 “mcs” — 2015/5/18 — 1:43 — page iv — #4 iv Contents 5 Induction 115 5.1 Ordinary Induction 115 5.2 Strong Induction 124 5.3 Strong Induction vs. Induction vs. Well Ordering 129 5.4 State Machines 130 6 Recursive Data Types 173 6.1 Recursive Definitions and Structural Induction 173 6.2 Strings of Matched Brackets 177 6.3 Recursive Functions on Nonnegative Integers 180 6.4 Arithmetic Expressions 183 6.5 Induction in Computer Science 188 7 Infinite Sets 205 7.1 Infinite Cardinality 206 7.2 The Halting Problem 215 7.3 The Logic of Sets 219 7.4 Does All This Really Work? 222 II Structures Introduction 241 8 Number Theory 243 8.1 Divisibility 243 8.2 The Greatest Common Divisor 248 8.3 Prime Mysteries 254 8.4 The Fundamental Theorem of Arithmetic 257 8.5 Alan Turing 259 8.6 Modular Arithmetic 263 8.7 Remainder Arithmetic 265 8.8 Turing’s Code (Version 2.0) 268 8.9 Multiplicative Inverses and Cancelling 270 8.10 Euler’s Theorem 274 8.11 RSA Public Key Encryption 279 8.12 What has SAT got to do with it? 281 8.13 References 282 9 Directed graphs & Partial Orders 317 9.1 Vertex Degrees 319 9.2 Walks and Paths 320 “mcs” — 2015/5/18 — 1:43 — page v — #5 v Contents 9.3 Adjacency Matrices 323 9.4 Walk Relations 326 9.5 Directed Acyclic Graphs & Scheduling 327 9.6 Partial Orders 335 9.7 Representing Partial Orders by Set Containment 339 9.8 Linear Orders 340 9.9 Product Orders 340 9.10 Equivalence Relations 341 9.11 Summary of Relational Properties 343 10 Communication Networks 373 10.1 Complete Binary Tree 373 10.2 Routing Problems 373 10.3 Network Diameter 374 10.4 Switch Count 375 10.5 Network Latency 376 10.6 Congestion 376 10.7 2-D Array 377 10.8 Butterfly 379 10.9 Benesˇ Network 381 11 Simple Graphs 393 11.1 Vertex Adjacency and Degrees 393 11.2 Sexual Demographics in America 395 11.3 Some Common Graphs 397 11.4 Isomorphism 399 11.5 Bipartite Graphs & Matchings 401 11.6 The Stable Marriage Problem 406 11.7 Coloring 413 11.8 Simple Walks 417 11.9 Connectivity 419 11.10 Forests & Trees 424 11.11 References 433 12 Planar Graphs 473 12.1 Drawing Graphs in the Plane 473 12.2 Definitions of Planar Graphs 473 12.3 Euler’s Formula 484 12.4 Bounding the Number of Edges in a Planar Graph 485 12.5 Returning to K5 and K3;3 486 12.6 Coloring Planar Graphs 487 “mcs” — 2015/5/18 — 1:43 — page vi — #6 vi Contents 12.7 Classifying Polyhedra 489 12.8 Another Characterization for Planar Graphs 492 III Counting Introduction 501 12.9 References 502 13 Sums and Asymptotics 503 13.1 The Value of an Annuity 504 13.2 Sums of Powers 510 13.3 Approximating Sums 512 13.4 Hanging Out Over the Edge 516 13.5 Products 522 13.6 Double Trouble 525 13.7 Asymptotic Notation 528 14 Cardinality Rules 551 14.1 Counting One Thing by Counting Another 551 14.2 Counting Sequences 552 14.3 The Generalized Product Rule 555 14.4 The Division Rule 559 14.5 Counting Subsets 562 14.6 Sequences with Repetitions 564 14.7 Counting Practice: Poker Hands 567 14.8 The Pigeonhole Principle 572 14.9 Inclusion-Exclusion 581 14.10 Combinatorial Proofs 587 14.11 References 591 15 Generating Functions 627 15.1 Infinite Series 627 15.2 Counting with Generating Functions 629 15.3 Partial Fractions 635 15.4 Solving Linear Recurrences 638 15.5 Formal Power Series 643 15.6 References 646 “mcs” — 2015/5/18 — 1:43 — page vii — #7 vii Contents IV Probability Introduction 665 16 Events and Probability Spaces 667 16.1 Let’s Make a Deal 667 16.2 The Four Step Method 668 16.3 Strange Dice 677 16.4 The Birthday Principle 684 16.5 Set Theory and Probability 686 16.6 References 690 17 Conditional Probability 697 17.1 Monty Hall Confusion 697 17.2 Definition and Notation 698 17.3 The Four-Step Method for Conditional Probability 700 17.4 Why Tree Diagrams Work 702 17.5 The Law of Total Probability 710 17.6 Simpson’s Paradox 712 17.7 Independence 714 17.8 Mutual Independence 716 18 Random Variables 739 18.1 Random Variable Examples 739 18.2 Independence 741 18.3 Distribution Functions 742 18.4 Great Expectations 751 18.5 Linearity of Expectation 762 19 Deviation from the Mean 789 19.1 Markov’s Theorem 789 19.2 Chebyshev’s Theorem 792 19.3 Properties of Variance 796 19.4 Estimation by Random Sampling 800 19.5 Confidence versus Probability 806 19.6 Sums of Random Variables 807 19.7 Really Great Expectations 816 20 Random Walks 839 20.1 Gambler’s Ruin 839 20.2 Random Walks on Graphs 849 “mcs” — 2015/5/18 — 1:43 — page viii — #8 viii Contents V Recurrences Introduction 865 21 Recurrences 867 21.1 The Towers of Hanoi 867 21.2 Merge Sort 870 21.3 Linear Recurrences 874 21.4 Divide-and-Conquer Recurrences 881 21.5 A Feel for Recurrences 888 Bibliography 895 Glossary of Symbols 899 Index 902 “mcs” — 2015/5/18 — 1:43 — page 1 — #9 I Proofs “mcs” — 2015/5/18 — 1:43 — page 2 — #10

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.