Discrete_Mathematics_Chapter1_Part1.pptx

jannatuncse 22 views 20 slides Jun 13, 2024
Slide 1
Slide 1 of 20
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20

About This Presentation

This lecture introduces the subject of discrete mathematics to students.


Slide Content

Discrete Mathematics CSE 115

Introduction Discrete Mathematics is a study of discrete objects means distinct or not connected Discrete Continuous

Outline Chapter 1 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers 1.5 Rules of Inference

1.1 Propositional Logic Chapter 1 Proposition: A proposition is a declarative sentence (that is , a sentence that declares a fact ) that is either true or false , but not both. 1 + 1 = 2. What time is it? x + 1 = 2. Toronto is the capital of Canada. Read this carefully. The color of my dress is blue. Proposition Not Proposition

1.1 Propositional Logic Chapter 1 Proposition is denoted by propositional variables letters used p, q, r, s ….. Truth Value T (True) / F (False)

1.1 Propositional Logic Lecture 1 p  ¬ p T F F T p q p V q T T T T F T F T T F F F p q p /\ q T T T T F F F T F F F F Negation not p Disjunction p or q Conjunction p and q p: Today is Friday. ¬ p: Today is not Friday. q: It is raining today. p V q: Today is not Friday or it is raining today. p /\ q: (but) Today is not Friday and it is raining today.

1.1 Propositional Logic Chapter 1 p q p q T T F T F T F T T F F F Exclusive OR p xor q The exclusive or of p and q is the proposition that is true when exactly one of p and q are true , otherwise false. p: Student who have taken calculus can take this class. q: Student who have taken computer science can take this class. OR: Student who have taken calculus or computer science can take this class. Exclusive OR: Student who have taken calculus or computer science. but not both , can take this class.

1.1 Propositional Logic Chapter 1 The conditional statement p  q is the proposition "if p, then q ." The conditional statement p  q is false when p is true and q is false , and true otherwise. p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or consequence). p q p  q T T T T F F F T T F F T Conditional Statement p  q Example: If I am elected, then I will lower taxes. hypothesis conclusion

1.1 Propositional Logic Chapter 1 if p, then q f p, q p is sufficient for q q if p q when p a necessary condition for p is q 7. q unless ¬p 8. p implies q 9. p only if q 10. a sufficient condition for q is p 11. q whenever p 12. q is necessary for p 13. q follows from p Other ways to express conditional statements

1.1 Propositional Logic Chapter 1 Example 7: Let p be the statement "Maria learns discrete mathematics" and q the statement "Maria will find a good job." Express the statement p 🡪 q as a statement in English. If Maria learns discrete mathematics, then she will find a good job. Maria will find a good job when she learns discrete mathematics. For Maria to find a good job , it is sufficient for her to learn discrete mathematics. Maria will find a good job unless she does not learn discrete mathematics. if p, then q q when p a sufficient condition for q is p q unless ¬p

1.1 Propositional Logic Chapter 1 For the conditional statement p  q Inverse Contrapositive Converse q  p ¬ q  ¬ p ¬ p  ¬ q p: It is raining q: Home team wins. Only contrapositive has the same truth value as p  q, check it by constructing truth table! If home team wins, then it is raining. If home team does not win, then it is not raining. If it is not raining, then the home team does not win. "The home team wins whenever it is raining.”

1.1 Propositional Logic Chapter 1 Biconditionals The biconditional statement p ↔  q is the proposition "p if and only if q ." The biconditional statement p ↔  q is true when p and q have the same truth values , and is false otherwise. Biconditional statements are also called bi-implications. p q p ↔  q T T T T F F F T F F F T Its basically X-NOR!!

1.1 Propositional Logic Chapter 1 The statement p ↔  q is true when both the conditional statements p  q and q  p are true and is false otherwise. p ↔  q has the same truth value as (p  q) /\ ( q  p) Other ways to express biconditional statements p is necessary and sufficient for q if p then q, and conversely p iff q

1.1 Propositional Logic Chapter 1 Example 10: Let p be the statement “You can take the flight." and q the statement “You buy a ticket”. Express the statement p ↔  q as a statement in English. You can take the flight if and only if you buy a ticket. The statement is true if p and q are either both true or both false. You buy a ticket and you can take the flight You don’t buy a ticket and you cannot take the flight The statement is false when p and q have the opposite truth values You buy a ticket but you cannot take the flight ( you miss the flight ) You don’t buy a ticket but you can take the flight ( such as when you get a free ticket)

1.1 Propositional Logic Chapter 1 Example 11: Construct the truth table of the compound proposition (p V ¬ q)  (p /\ q) Operator Precedence ¬ 1 /\ \/ 2 3  ↔  4 5 Precedence of Logical Operators Precedence can be overridden by parantheses () p q ¬ q p V ¬ q p /\ q (p V ¬ q)  (p /\ q) T T F T T T T F T T F F F T F F F T F F T T F F The truth table of (p V ¬ q)  (p /\ q)

1.1 Propositional Logic Chapter 1 Translating English Sentences You can access the internet from the campus only if you are a computer science major or you are not a freshman. a: You can access the internet from the campus c: You are a computer science major f: You are a freshman. only if : condtional statement  or: disjunction \/ a  ( c \/ ¬ f )

1.1 Propositional Logic Chapter 1 Translating English Sentences You cannot ride a roller coaster if you are under 4 feet tall unless you are older than 16 years old. q: You can ride a roller coaster. r: You are under 4 feet tall s: You are older than 16 years old. ( r /\ ¬ s )  ¬ q Component of hypothesis Conclusion

1.1 Propositional Logic Chapter 1 Logic and Bit Operations A bit is a symbot with two possible values: 0 and 1 Truth Value Bit T 1 F Bit operation: OR, AND, XOR A bit string is sequence of zero or more bits. The length of this string is the number of bits in the string. Bitwise OR, Bitwise AND, and B itwise XOR of two strings of the same length are basically the OR, AND, and XOR of the corresponding bits in the two strings, respectively

1.1 Propositional Logic Chapter 1 EXAMPLE 21: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings 01 1011 0110 and 11 0001 1101. 01 1011 0110 11 0001 1101 ------------------ 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR

1.1 Propositional Logic Chapter 1 Exercises 4, 5, 6, 7, 8, 9, 10, 11, 23, 24, 27, 29, 31, 33, 35, 37
Tags