Lecture 1 CS 1813 Discrete Mathematics Learning Goals











- Slides: 11
Lecture 1 CS 1813 – Discrete Mathematics Learning Goals Lesson Plans and Logic Rex Page Professor of Computer Science University of Oklahoma EL 119 – Page@OU. edu CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1
CS 1813 Discrete Mathematics Learning Goals § Apply mathematical logic to prove properties of software ü Predicate calculus and natural deduction ü Boolean algebra and equational reasoning ü Mathematical induction § Understand fundamental data structures ü Sets ü Trees ü Functions and relations § Additional topics ü Graphs ü Counting ü Algorithm Complexity ! e r o l a g s f proo re! o l a g s f o o pr re! lo proofs gsagalore! proofs gal 2
100 s of inputs Why Proofs? input signals Key presses Mouse gestures Files Databases … software computation > 2100 s output of signals possibilities Images Sounds Files Databases … üSoftware translates input signals to output signals üA program is a constructive proof of a translation üBut what translation? üProofs can confirm that software works correctly üTesting cannot confirm software correctness üPractice with proofs improves software thinking 3
CS 1813 Discrete Mathematics Textbook and Tools q. Discrete Mathematics Using a Computer Cordelia Hall and John O’Donnell Springer-Verlag, January 2000 q Tools provided with textbook § Download from course website for CS 1813 q Hugs interpreter for Haskell § Download from course website § Haskell is a math notation (and a programming lang) q Reading assignments begin with Chapter 2 § Read Chapter 1 (Haskell) as needed, for reference § Haskell coverage JIT, like other math notations CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 4
Formal Mathematical Notations q. Notations introduced as needed (JIT) H as ke ll § Logic a b, x. P(x), x. Q(x), § Sets A B, {x | x S, P(x)}, § Sequences [x | x <- s, P(x)] [4, 7, 2] ++ [3, 7] == [4, 7, 2, 3, 7] s(a: xs) = s[x | x <- xs, x < a] ++ [a] ++ s[x | x <- xs, x >= a] §Structures Theorem [P, Q] (And P Q) CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 5
§ Reading assignments ce n a d n e t t A Class RED I U Q E R üSee syllabus on course website üStudy prior to class § Class Participation § Homework problem sets üApproximately weekly § Midterm Exam 1 § Midterm Exam 2 § Final Exam 10% 20% Contribution to grade Coursework 40% ce n a d n e t t A ab L A / Q Q/A Lab – Thursdays 8: 00 pm, CEC 439 IRED U Q E R T NO CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 6
Tiling with Dominos a mathematical proof – just for practice Problem § cover board with dominos § no overlapping dominos § no dominos outside board checkerboard with two missing corners üHow many squares on board? üSo, how many dominos will it take? üOne domino covers how many red squares? ü 31 dominos cover how many red squares? üHow many red squares are there? üYikes! What’s wrong here? LT I T CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 7 Adapted from Singh, Fermat’s Enigma, Walker & Co, 1997 Dominos – size matches board
Three Doors Where’s the jackpot? ü Behind one is a million dollars • Why not A? ü Behind another is a Palm Pilot • Why not B? ü Behind the other is a melting Popsicle • Must be C, eh? A B C Bonus question: Palm Popsicle Palm Where’s the Palm Pilot? Here Behind C Behind A • Door C speaks the truth – the Palm Pilot is behind A so palm here if $$$ here … popsicle here • Door B lies – it so C sign correct has a Popsicle, afterall LT TI Signs on Doors ü$$$ door: true statement ü Popsicle door: false statement If it was so, it might be; and if it were so, it would be: but as it isn’t, it ain’t. That’s logic. - Tweedledee CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page in Through the Looking Glass 8 Adapted from Smullyan, The Lady or the Tiger, Times Books, 1982 How To Find a Million Dollars using logic
Tracing a Square and Its Diagonals Problem Square + Diagonals §Start at any corner §Trace some line to another corner §Then trace from that corner to another § Keep going until all six lines are traced § Don’t trace any line more than once (crossing OK, but not retracing) Solution revealed in the next lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 9
Homework #1 q. Problem under “Assignments” tab in course website q. It’s a hard problem q. You don’t have much mathematical apparatus, yet, to attack it q. Grade based more on thoughtfulness and well-expressed ideas than on solutions CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10
End of Lecture CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 11