1 / 31

Discrete Structures – CS2300

Discrete Structures – CS2300. Text Discrete Mathematics and Its Applications Kenneth H. Rosen (7 th Edition) Chapter 1 The Foundations: Logic and Proofs. About This Course. The Conceptual Foundation of Computer Science Prerequisite for CS 3240 (Theory of Computation)

Download Presentation

Discrete Structures – CS2300

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete Structures – CS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (7th Edition) Chapter 1 The Foundations: Logic and Proofs

  2. About This Course • The Conceptual Foundation of Computer Science • Prerequisite for CS 3240 (Theory of Computation) • Applied Mathematics Course

  3. Continuous vs. Discrete Math Continuous Discrete Sliding down a slide Climbing up stairs Pouring water Stacking ice cubes Length of rope Number of knots Crawling slug Hopping rabbit Adding milk Adding eggs Grade point average Calculus grade

  4. Discrete Solutions • How many ways are there to choose a valid password? • What is the probability of winning the lottery? • Is there a path linking two particular computers in a network? • What is the shortest path between two destinations using a transportation system? • How many valid Internet addresses are there?

  5. Chapter 1 Objective “In this chapter we will explain what makes up a correct mathematical [logical] argument and introduce tools to construct these arguments.”

  6. Sections 1.1, 1.2 Logic Propositional Logic

  7. Propositions A proposition is a statement that is either true or false, but not both. Today is Tuesday. Six is a prime number. Count is less than ten. 7<5 Consider this statement.

  8. Compound Propositions Compound propositions are formed from existing propositions using logical operators Today is Wednesday and it is snowing outside. 12 is not a prime number.

  9. ! Negation of a Proposition T F NOT F T

  10. Negation of a Proposition repeat{…}until(feof(my_file)); while (!feof(my_file)){…}

  11. T T T F F T F F || Disjunction of Two Propositions OR T T T F

  12. Disjunction of Two Propositions repeat{ …}until(count>10 || feof(myfile)); if(choice==PAUSE || choice ==STOP) ...

  13. T T T F F T F F && Conjunction of Two Propositions AND T F F F

  14. Conjunction of Two Propositions while(!feof(a_file) && index<SIZE){ …} if(!done && time_left) ...

  15. T T T F F T F F ^ Exclusive-OR of Two Propositions F Exactlyone ofthem istrue. T T F “but not both”

  16. T T T F F T F F Implication p is called thehypothesis and q is theconclusion T F T T

  17. T T T F F T F F T F T T Implication (“Conditional”) • “if p, then q” • “p implies q” • “if p,q” • “p only if q” • “p is sufficient for q” • “q if p” • “q whenever p” • “q is necessary for p” 17

  18. T T T F F T F F T F T T q whenever p Suppose that the proposition is true. Then, q is true whenever p is true. 18

  19. T T T F F T F F T F T T p is sufficient for q Suppose that the proposition is true. Then, to guarantee that q is true it is sufficient to say that p is true. 19

  20. AndConversely T T T F F T F F T F T T Converse of an Implication T T F T 20

  21. Example of Converse If it stays warm for a week, the apple trees will bloom. If the apple trees bloom, it will be warm for a week. If x is even then x2 is even. If x2 is even then x is even.

  22. T T T F F T F F F F F T T F T T T F T T Contrapositive of an Implication T F T T 22

  23. Examples of Contrapositive If it snows tonight, then I will stay at home. If I do not stay at home, then it didn’t snow tonight. If x is odd then x2 is odd. If x2 is not odd then x is not odd. If x2 is even then x is even.

  24. T T F T Biconditional T T T F F T F F T T F F T F T T

  25. Biconditional pif and only if q p iffq

  26. AND OR 1101 10011110 0100 1101 10011110 0100 1100 0000 1111 1101 XOR 1101 10011110 0100 0011 1101 Bitwise operators a|b a&b a^b

  27. t01_1_009.jpg

  28. Tautology Tautology - a compound proposition that is always true. T T T TT F F TF T T TF F T T

  29. Contradiction Contradiction - a compound proposition that is always false. T F F F T F

  30. T T T TT F F FF T F TF F F T Contingency A contingency is neither a tautology nor a contradiction.

More Related