Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 1 CS 1813 – Discrete Mathematics

Similar presentations


Presentation on theme: "Lecture 1 CS 1813 – Discrete Mathematics"— Presentation transcript:

1 Lecture 1 CS 1813 – Discrete Mathematics
Learning Goals Lesson Plans and Logic Rex Page Professor of Computer Science University of Oklahoma EL 119 – CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

2 CS 1813 Discrete Mathematics Learning Goals
Lecture 1 - CS1813 Discrete Math, University of Oklahoma 12/10/2018 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 proofs galore! CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

3 Lecture 1 - CS1813 Discrete Math, University of Oklahoma
12/10/2018 Why Proofs? 100s of inputs > 2100s of possibilities input signals software output signals Key presses Mouse gestures Files Databases computation Images Sounds Software translates input signals to output signals A program is a constructive proof of a translation Responsible software developers are obligated specify what properties their software is guaranteed to have. Proofs play a big role in this. Other methods of confirming software properties, especially testing, leave software riddled with errors. Most systems have hundreds of input signals. Since each input signal must have at least two possible values, the number of different input states that must be checked to verify the operation of the software through testing is at least 2 to the power 100. If you can generate, run, and examine one test case every minute, round the clock, you will not finish testing before you die. Not even before the sun runs out of fuel. Not even if you do one test case every nanosecond. Forget it. Testing can work only on very small pieces of software. But what translation? Proofs can confirm that software works correctly Testing cannot confirm software correctness Practice with proofs improves software thinking CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

4 CS 1813 Discrete Mathematics Textbook and Tools
Discrete Mathematics Using a Computer Cordelia Hall and John O’Donnell Springer-Verlag, January 2000 Tools provided with textbook Download from course website for CS 1813 Hugs interpreter for Haskell Download from course website Haskell is a math notation (and a programming lang) Reading assignments begin with Chapter 2 Read Chapter 1 (Haskell) as needed, for reference Haskell coverage JIT, like other math notations CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

5 Formal Mathematical Notations
Lecture 1 - CS1813 Discrete Math, University of Oklahoma 12/10/2018 Formal Mathematical Notations Notations introduced as needed (JIT) Logic ab, ab, ab, x.P(x), x.Q(x),  Sets A  B, A  B, {x | xS, P(x)},  Sequences [x | x <- s, P(x)] [4, 7, 2] ++ [3, 7] == [4,7,2,3,7] Haskell s(a: xs) = s[x | x <- xs, x < a] ++ [a] ++ s[x | x <- xs, x >= a] The last one contains a sequence, but is not itself a sequence. It is an algebraic datatype using several constructors (Theorem, Imp, Not, etc.). Structures Theorem [P, Q] (And P Q) CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

6 Lecture 1 - CS1813 Discrete Math, University of Oklahoma
12/10/2018 Coursework Class Attendance REQUIRED Reading assignments 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 40% The Q/A Lab will be a lecture/workshop format. The instructor will not come with a prepared agenda. Students ask questions, and the instructor attempts to answer them. The instructor will bring a laptop computer for addressing problems with software. Students may also bring laptops. The Q/A session will go on as long as necessary, or until 10pm, whichever comes first. Q/A Lab Attendance NOT REQUIRED Q/A Lab – Thursdays 8:00pm, CEC 439 CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

7 Tiling with Dominos a mathematical proof – just for practice
Lecture 1 - CS1813 Discrete Math, University of Oklahoma 12/10/2018 Tiling with Dominos a mathematical proof – just for practice Dominos – size matches board checkerboard with two missing corners Problem cover board with dominos no overlapping dominos no dominos outside board How many squares on board? Adapted from Singh, Fermat’s Enigma, Walker & Co, 1997 So, how many dominos will it take? One domino covers how many red squares? Let’s do a little planning before we start laying dominos on the checkerboard. How many dominos is it going to take to do the job? When a domino is place on the board, how many red squares and how many black squares does it cover? How many red squares are covered when 30 dominos have been placed? How many black squares? How many red squares are left to be covered? There are only 30 red squares, so they’re all covered when 30 dominos have been placed. That leaves no red square for the last domino to cover. The last two squares are black. The last domino cannot cover them because no two black square are next to each other. 31 dominos cover how many red squares? How many red squares are there? Yikes! What’s wrong here? TILT CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

8 How To Find a Million Dollars using logic
Lecture 1 - CS1813 Discrete Math, University of Oklahoma 12/10/2018 How To Find a Million Dollars using logic Three Doors Behind one is a million dollars Behind another is a Palm Pilot Behind the other is a melting Popsicle Where’s the jackpot? Why not A? Why not B? Must be C, eh? Bonus question: Where’s the Palm Pilot? Door C speaks the truth – the Palm Pilot is behind A Door B lies – it has a Popsicle, afterall A Palm Here B Popsicle Behind C C Palm Behind A Adapted from Smullyan, The Lady or the Tiger, Times Books, 1982 so palm here if $$$ here … popsicle here so C sign correct It can’t be door A because the statement on the jackpot door is true, and door A says the Palm Pilot is behind it. So, the jackpot can’t be behind door A. It can’t be door B because if door B had the jackpot, it’s sign would be true, and the Popsicle would be behind C. But if the Popsicle were behind C, the statement on C would be false, but it can’t be because there’s nowhere else but door A for the Palm Pilot. So the jackpot can’t be behind door B. TILT 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 in Through the Looking Glass CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

9 Tracing a Square and Its Diagonals
Square + Diagonals Problem 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

10 CS 1813 Discrete Mathematics, Univ Oklahoma
Homework #1 Problem under “Assignments” tab in course website It’s a hard problem You don’t have much mathematical apparatus, yet, to attack it Grade based more on thoughtfulness and well-expressed ideas than on solutions CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

11 CS 1813 Discrete Mathematics, Univ Oklahoma
End of Lecture CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page


Download ppt "Lecture 1 CS 1813 – Discrete Mathematics"

Similar presentations


Ads by Google