ebook img

Foundation mathematics for computer science. A visual approach PDF

416 Pages·2020·5.053 MB·English
by  Vince J
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 Foundation mathematics for computer science. A visual approach

John Vince Foundation Mathematics for Computer Science A Visual Approach Second Edition Foundation Mathematics for Computer Science John Vince Foundation Mathematics for Computer Science A Visual Approach Second Edition 123 JohnVince BournemouthUniversity Breinton, Hereford,UK ISBN978-3-030-42077-2 ISBN978-3-030-42078-9 (eBook) https://doi.org/10.1007/978-3-030-42078-9 1stedition:©SpringerInternationalPublishingSwitzerland2015 2ndedition:©SpringerNatureSwitzerlandAG2020 Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpart of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission orinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilar methodologynowknownorhereafterdeveloped. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfrom therelevantprotectivelawsandregulationsandthereforefreeforgeneraluse. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained hereinorforanyerrorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregard tojurisdictionalclaimsinpublishedmapsandinstitutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland This book is dedicated to my wife and best friend, Heidi. Preface Computer science is a very large subject, and graduates will pursue a wide variety of careers, including programming, systems design, cryptography, website design, real-time systems, computer animation, computer games, data visualisation, etc. Consequently, itisvirtually impossible towrite amathematicsbookthatcatersfor allofthesepotentialcareerpaths.Nevertheless,Ihaveattemptedtodescribearange of mathematical topics that I believe are relevant, and have helped me during my own career in computer science. The book’s subtitle “A Visual Approach” reflects theimportanceIplaceoncolouredillustrationsandfunctiongraphs,ofwhichthere are over 160. Each chapter contains a variety of worked examples. This second edition remains an introductory text, and is aimed at students studying for an undergraduate degree in computer science. There are four extra chapters on combinatorics, probability, modular arithmetic and complex numbers, whichtogetherwiththeoriginaltwelvechaptersshouldprovidereaderswithasolid foundation, upon which more advanced topics of mathematics can be studied. Throughout the book I have referenced the key people behind the various mathematical discoveries covered, which I hope adds a human dimension to the subject. I have found it very interesting and entertaining to discover how some mathematicians ridiculed their fellow peers, when they could not comprehend the significanceofanewinvention—Cantor’sSetTheory,beinganexcellentexample. There is no way I could have written this book without the assistance of the Internet and my books previously published by Springer Verlag. In particular, I would like to acknowledge Wikipedia and Richard Elwes’ excellent book Maths 1001. I prepared this book on an Apple iMac, using LATEX2e, Pages and the Grapher package, and would recommend this combination to anyone considering writingabookonmathematics.Idohopeyouenjoyreadingthisbook,andthatyou are tempted to study mathematics to a deeper level. Breinton, Herefordshire, UK John Vince March 2020 vii Contents 1 Visual Mathematics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Visual Brains Versus Analytic Brains. . . . . . . . . . . . . . . . . . . 1 1.2 Learning Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 What Makes Mathematics Difficult?. . . . . . . . . . . . . . . . . . . . 2 1.4 Does Mathematics Exist Outside Our Brains?. . . . . . . . . . . . . 3 1.5 Symbols and Notation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.3 Sets of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.4 Zero. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.5 Negative Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5.1 The Arithmetic of Positive and Negative Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.6 Observations and Axioms . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.6.1 Commutative Law. . . . . . . . . . . . . . . . . . . . . . . . . 10 2.6.2 Associative Law . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.6.3 Distributive Law. . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.7 The Base of a Number System . . . . . . . . . . . . . . . . . . . . . . . 11 2.7.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.7.2 Octal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.7.3 Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.7.4 Hexadecimal Numbers. . . . . . . . . . . . . . . . . . . . . . 13 2.7.5 Adding Binary Numbers . . . . . . . . . . . . . . . . . . . . 17 2.7.6 Subtracting Binary Numbers . . . . . . . . . . . . . . . . . 18 2.8 Types of Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.8.1 Natural Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.8.2 Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.8.3 Rational Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 20 ix x Contents 2.8.4 Irrational Numbers . . . . . . . . . . . . . . . . . . . . . . . . 20 2.8.5 Real Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.8.6 Algebraic and Transcendental Numbers . . . . . . . . . 20 2.8.7 Imaginary Numbers. . . . . . . . . . . . . . . . . . . . . . . . 21 2.8.8 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . 22 2.8.9 Quaternions and Octonions . . . . . . . . . . . . . . . . . . 23 2.8.10 Transcendental and Algebraic Numbers . . . . . . . . . 24 2.9 Prime Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.9.1 The Fundamental Theorem of Arithmetic . . . . . . . . 26 2.9.2 Is 1 a Prime? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.9.3 Prime Number Distribution . . . . . . . . . . . . . . . . . . 27 2.9.4 Infinity of Primes . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.9.5 Perfect Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.9.6 Mersenne Numbers . . . . . . . . . . . . . . . . . . . . . . . . 30 2.10 Infinity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 2.11 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.11.1 Algebraic Expansion . . . . . . . . . . . . . . . . . . . . . . . 31 2.11.2 Binary Subtraction . . . . . . . . . . . . . . . . . . . . . . . . 31 2.11.3 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . 32 2.11.4 Complex Rotation. . . . . . . . . . . . . . . . . . . . . . . . . 32 2.11.5 Quaternions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3 Algebra. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.1 Solving the Roots of a Quadratic Equation. . . . . . . 38 3.4 Indices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4.1 Laws of Indices . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.5 Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 3.6 Further Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.7 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.7.1 Explicit and Implicit Equations . . . . . . . . . . . . . . . 45 3.7.2 Function Notation. . . . . . . . . . . . . . . . . . . . . . . . . 45 3.7.3 Intervals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3.7.4 Function Domains and Ranges. . . . . . . . . . . . . . . . 47 3.7.5 Odd and Even Functions. . . . . . . . . . . . . . . . . . . . 48 3.7.6 Power Functions. . . . . . . . . . . . . . . . . . . . . . . . . . 49 3.8 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.8.1 Algebraic Manipulation. . . . . . . . . . . . . . . . . . . . . 50 3.8.2 Solving a Quadratic Equation . . . . . . . . . . . . . . . . 51 3.8.3 Factorising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Contents xi 4 Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4.3 Truth Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.3.1 Logical Connectives . . . . . . . . . . . . . . . . . . . . . . . 56 4.4 Logical Premises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.4.1 Material Equivalence. . . . . . . . . . . . . . . . . . . . . . . 57 4.4.2 Implication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.4.3 Negation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.4.4 Conjunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.4.5 Inclusive Disjunction. . . . . . . . . . . . . . . . . . . . . . . 59 4.4.6 Exclusive Disjunction . . . . . . . . . . . . . . . . . . . . . . 59 4.4.7 Idempotence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 4.4.8 Commutativity . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 4.4.9 Associativity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 4.4.10 Distributivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4.4.11 de Morgan’s Laws . . . . . . . . . . . . . . . . . . . . . . . . 63 4.4.12 Simplification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 4.4.13 Excluded Middle. . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.4.14 Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.4.15 Double Negation. . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.4.16 Implication and Equivalence . . . . . . . . . . . . . . . . . 66 4.4.17 Exportation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.4.18 Contrapositive. . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.4.19 Reductio Ad Absurdum. . . . . . . . . . . . . . . . . . . . . 67 4.4.20 Modus Ponens . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.4.21 Proof by Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4.5 Set Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.5.1 Empty Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.5.2 Membership and Cardinality of a Set . . . . . . . . . . . 71 4.5.3 Subsets, Supersets and the Universal Set . . . . . . . . 72 4.5.4 Set Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.5.5 Union. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.5.6 Intersection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.5.7 Relative Complement . . . . . . . . . . . . . . . . . . . . . . 74 4.5.8 Absolute Complement. . . . . . . . . . . . . . . . . . . . . . 75 4.5.9 Power Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.6 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.6.1 Truth Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.6.2 Set Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 4.6.3 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 4.6.4 Power Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 xii Contents 5 Combinatorics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.2 Permutations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.3 Permutations of Multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 5.4 Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5.5 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5.5.1 Eight-Permutations of a Multiset . . . . . . . . . . . . . . 85 5.5.2 Eight-Permutations of a Multiset . . . . . . . . . . . . . . 86 5.5.3 Number of Permutations . . . . . . . . . . . . . . . . . . . . 87 5.5.4 Number of Five-Card Hands . . . . . . . . . . . . . . . . . 87 5.5.5 Hand Shakes with 100 People . . . . . . . . . . . . . . . . 87 5.5.6 Permutations of MISSISSIPPI . . . . . . . . . . . . . . . . 88 6 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 6.2 Definition and Notation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 6.2.1 Independent Events. . . . . . . . . . . . . . . . . . . . . . . . 91 6.2.2 Dependent Events. . . . . . . . . . . . . . . . . . . . . . . . . 91 6.2.3 Mutually Exclusive Events . . . . . . . . . . . . . . . . . . 92 6.2.4 Inclusive Events . . . . . . . . . . . . . . . . . . . . . . . . . . 93 6.2.5 Probability Using Combinations. . . . . . . . . . . . . . . 93 6.3 Worked Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 6.3.1 Product of Probabilities. . . . . . . . . . . . . . . . . . . . . 95 6.3.2 Book Arrangements . . . . . . . . . . . . . . . . . . . . . . . 96 6.3.3 Winning a Lottery. . . . . . . . . . . . . . . . . . . . . . . . . 96 6.3.4 Rolling Two Dice. . . . . . . . . . . . . . . . . . . . . . . . . 96 6.3.5 Two Dice Sum to 7 . . . . . . . . . . . . . . . . . . . . . . . 96 6.3.6 Two Dice Sum to 4 . . . . . . . . . . . . . . . . . . . . . . . 97 6.3.7 Dealing a Red Ace . . . . . . . . . . . . . . . . . . . . . . . . 97 6.3.8 Selecting Four Aces in Succession. . . . . . . . . . . . . 97 6.3.9 Selecting Cards. . . . . . . . . . . . . . . . . . . . . . . . . . . 97 6.3.10 Selecting Four Balls from a Bag . . . . . . . . . . . . . . 98 6.3.11 Forming Teams. . . . . . . . . . . . . . . . . . . . . . . . . . . 98 6.3.12 Dealing Five Cards . . . . . . . . . . . . . . . . . . . . . . . . 99 7 Modular Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.2 Informal Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 7.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 7.4 Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 7.5 Negative Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.6 Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 7.6.1 Sums of Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 104 7.6.2 Products. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

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.