Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University

Similar presentations


Presentation on theme: "Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University"— Presentation transcript:

1 Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University ahmad_tayyar@iu.edu.jo

2 1 July 2016 Propositional Logic (فرضيات المنطق) What’s a proposition? PropositionsNot Propositions 3 + 2 = 32Bring me coffee! CS173 is Leen’s favorite class.CS173 is her favorite class. Every cow has 4 legs.3 + 2 There is other life in the universe.Do you like Cake? A proposition is a declarative statement that’s either TRUE or FALSE (but not both). 2

3 1 July 2016 Propositional Logic Extra examples PropositionsNot Propositions Toronto is the capital of Canada.Sit down! The Moon is made of green cheese.What time is it? 1 + 0 = 1 x + 1 = 2 0 + 0 = 2 x + y = z 3

4 1 July 2016 Example: (Propositions)  13 is an odd number.  1 + 1 = 2.  8  square root of (8 + 8).  There is monkey in the moon.  Today is Wednesday.  For any integer n  0, there exists 2n which is an even number.  x + y = y + x for any real number x and y. 4

5 1 July 2016 Example: (Not Propositions)  What time does Argo Bromo train arrive at Gambir Station?  Do the quiz without cooperating!  x = 3 + 8.  x > 5.  I am heavy. Conclusion: Propositions are declarative sentences. Conclusion: If a proposition is made out of mathematical equations, then the equations must posses an answer so that its truth value can be evaluated. 5

6 1 July 2016 Proposition Propositions are denoted with lower case letters starting with p such as p, q, r, … Example:  p : 13 is an odd number.  q : Ir. Soekarno was graduated from UGM.  r : 2 + 2 = 4. 6

7 1 July 2016 Propositional Logic - negation Suppose p is a proposition. The negation of p is written  p and has meaning: “It is not the case that p.” Ex. CS107 is NOT Leen’s favorite class. Truth table for negation: p pp TFTF FTFT Notice that  p is a proposition! 7

8 1 July 2016 Propositional Logic - conjunction Conjunction corresponds to English “and.” p  q is true exactly when p and q are both true. Ex. Amy is curious AND clever. Truth table for conjunction: pqp  q TTFFTTFF TFTFTFTF TFFFTFFF 8

9 1 July 2016 Propositional Logic - disjunction Disjunction corresponds to English “or.” p  q is when p or q (or both) are true. Ex. Michael is brave OR nuts. Truth table for disjunction: pqp  q TTFFTTFF TFTFTFTF TTTFTTTF 9

10 1 July 2016 Combining Propositions Example: The following prepositions are known p : Today is rainy. q : The class is cancelled. p  q : Today is rainy and the class is cancelled. p  q : Today is rainy or the class is cancelled.  p : It is not true that today is rainy. (or: Today is not rainy) 10

11 Example: Given the following propositions, p : The girl is beautiful. q : The girl is smart. Express the following proposition combinations using symbolic notation. a) The girl is beautiful and smart. b) The girl is beautiful but not smart. c) The girl is neither beautiful nor smart. d) It is not true that the girl is ugly or not smart. e) The girl is beautiful, or ugly and smart. f) That the girl is ugly as well as smart, is not true. Combining Propositions p  qp  q p  qp  q p  qp  q (p  q)(p  q) p(p  q)p(p  q) (p  q)(p  q) 1 July 201611

12 Example: p : 17 is a prime number. q : Prime number is always odd. p  q : 17 is a prime number and prime number is always odd. Truth Table Negation Conjunction Disjunction T F F 1 July 201612

13 Compound Proposition Excercice: Build the truth table of the proposition (p  q)  (  q  r). 1 July 201613

14 1 July 2016 Propositional Logic - implication Implication: p  q corresponds to English “if p then q,” or “p implies q.” If it is raining then it is cloudy. If I pass the exams, then I will get presents from my parents. If p then 2+2=4. Truth table for implication: pqp  q TTFFTTFF TFTFTFTF TFTTTFTT 14

15 Case 1: Your final exam grade is higher than 80 (true hypothesis) and you get an A for the subject (true conclusion).  The lecturer tells the truth. TRUE Case 2: Your final exam grade is higher than 80 (true hypothesis) but you do not get an A (false conclusion).  The lecturer tells a lie. FALSE Case 3: Your final exam grade is lower than 80 (false hypothesis) and you get an A (true conclusion).  The lecturer cannot be said to be wrong or telling a lie. Maybe he/she see your extra efforts and high motivation and thus without any doubt to give you an A. TRUE Case 4: Your final exam grade is lower than 80 (false hypothesis) and you do not get an A (false conclusion).  The lecturer tells the truth. TRUE Conditional Proposition Lecturer: “If your final exam grade is 80 or more, then you will get an A for this subject.” 1 July 201615

16 Conditional Proposition Various ways to express implication p  q:  If p, then q.  If p, q.  p implies/causes q.  q if p.  p only if q.  p is the sufficient condition for q.  p is sufficient for q.  q is the necessary condition for p.  q is necessary for p.  q whenever p. 1 July 201616

17 Conditional Proposition Example: Show that p  q is logically equivalent with ~p  q. “If p, then q”  “Not p or q” Example: Determine the negation of p  q. ~(p  q)  ~(~p  q)  ~(~p)  ~q  p  ~q 1 July 201617

18 Biconditional If p and q are propositions, then we can form the biconditional proposition p ↔q, read as “ p if and only if q ” Example: If p denotes “You can take a flight” and q denotes “You buy a ticket” then p ↔q denotes “You can take a flight if and only if you buy a ticket” –True only if you do both or neither –Doing only one or the other makes the proposition false pqp ↔q TTT TFF FTF FFT 18

19 Expressing the Biconditional Alternative ways to say “p if and only if q”: –p is necessary and sufficient for q –if p then q, and conversely –p iff q 19

20 1 July 2016 p is logically equivalent to q if their truth tables are the same. We write p  q. Propositional Logic - logical equivalence 20

21 Equivalence of Compound Proposition Two compound proposition P(p,q,…) and Q(p,q,…) are said to be logically equivalent if they have identical truth table. Notation: P(p,q,…)  Q(p,q,…) Example: De Morgan’s Law  (p  q)   p   q 1 July 201621

22 Exercise: Show that p  ~(p  q) and p  ~q are logically equivalent. Logical Equivalence 1 July 201622

23 1 July 2016 Propositional Logic - logical equivalence Challenge: Try to find a proposition that is equivalent to p  q, but that uses only the connectives , , and . pqp  q TTFFTTFF TFTFTFTF TFTTTFTT pq  pq   p TTFFTTFF TFTFTFTF FFTTFFTT TFTTTFTT 23

24 1 July 2016 Propositional Logic - proof of 1 famous  Distributivity: p  (q  r)  (p  q)  (p  r) pqr q  rq  rp  (q  r)p  qp  qp  rp  r(p  q)  (p  r) TTTTTTTT TTFFTTTT TFTFTTTT TFFFTTTT FTTTTTTT FTFFFTFF FFTFFFTF FFFFFFFF All truth assignment s for p, q, and r. I could say “prove a law of distributivity.” 24

25 1 July 2016 Propositional Logic - special definitions Contrapositives: p  q and  q   p Ex. “If it is noon, then I am hungry.” “If I am not hungry, then it is not noon.” Converses: p  q and q  p Ex. “If it is noon, then I am hungry.” “If I am hungry, then it is noon.” Inverses: p  q and  p   q Ex. “If it is noon, then I am hungry.” “If it is not noon, then I am not hungry.” One of these things is not like the others. Hint: In one instance, the pair of propositions is equivalent. p  q   q   p 25

26 Exercise: Prove that p  ~q  q  ~p  p  ~q  q  ~p

27 Some Examples Example: Given a proposition “It is not true that he learns Technical Drawing but not State Philosophy.”, a)Express the proposition above in symbolic notation (logical expression). b)Write a logically equivalent proposition as the proposition above (Hint: Use De Morgan’s Law). Solution: Takingp: He learns Technical Drawing. q: He learns State Philosophy. then: a)~ (p  ~q) b) ~ (p  ~q)  ~ p  q “He does not learn Technical Drawing or indeed learns State Philosophy.”

28 Example: Three propositions are given to describe the quality of a hotel: p : The service is good. q : The room rate is low. r : The hotel is a three star hotel. Translate the following proposition into symbolic notation using p, q, and r : a) “The room rate is low but the service is bad.” b) “Either the room rate is high or the service is good, but not both.” c) “It is not true that if a hotel is a three star hotel, then the room rate is low and the service is bad.” Some Examples Solution: a)q  ~pb)~q  pc)~ (r  (q  ~p)) (~q  ~p )  (q  p)

29 Example: Express the following statement in symbolic notation: “If you are below 17 years old, then you may not vote in a general election, unless you are already married.” Some Examples Solution: Defining: p : You are below 17 years old. q : You are already married. r : You may vote in a general election. then the statement above can be express in symbolic notation as: (p  ~q)  ~r “If you are below 17 years old and are not already married, then you may not vote in a general election.”  r  (~p  q)

30 1 July 2016 Propositional Logic - 2 more defn… A tautology is a proposition that’s always TRUE. A contradiction is a proposition that’s always FALSE. p ppp  pp  pp  pp  p TF FT TTTT FFFF 30

31 Some Examples Example: Proof that [~p  (p  q)]  q is a tautology. Solution: To proof the tautology, we construct the truth table: True in all cases [~p  (p  q)]  q is a tautology.

32 Example: Express the following statement in symbolic notation: “If you are below 17 years old, then you may not vote in a general election, unless you are already married.” Some Examples Solution: Defining: p : You are below 17 years old. q : You are already married. r : You may vote in a general election. then the statement above can be express in symbolic notation as: (p  ~q)  ~r “If you are below 17 years old and are not already married, then you may not vote in a general election.”  r  (~p  q)

33 Argument Argument is a list of propositions written as: In this case, p 1, p 2, …, p n are denoted as hypothesis (premise) and q as conclusion (consequence) The value of an argument may be valid or invalid. It should be emphasized that valid does not necessarily means true.

34 Definition: An argument is valid if the conclusion is true, then all the hypotheses are true; otherwise the argument is invalid. Argument If an argument is true, then we can say “the conclusion logically follows the hypotheses; or equivalently showing that the implication: is true. An invalid argument shows false reasoning. (p 1  p 2    p n )  q

35 Argument Example: Show that the argument below is valid: “If the last digit of this number is a 0, then this number is divisible by 10.” “The last digit of this number is a 0.” “Therefore, this number is divisible by 10.” Solution: Assume: p : A last digit of this number is a 0. q : this number is divisible by 10. then the argument can be written as: p  qpqp  qpq There are two ways to proof the validity of the argument, both using the truth table, and will be discussed now.

36 Argument 1 st way: Constructing the truth table of p, q, and p  q, and analyzing case by case. :  If each case “If all hypotheses are true, then the conclusion is true” applies, then the argument is valid.  Let us check whether if hypotheses p  q and p are true, then the conclusion q is also true.  See line 1: p  q and p are true at the same time, and q in line 1 is also true.  The argument is v a l i d. p  qpqp  qpq

37 2 nd way: Showing that the truth table of [(p  q)  p]  q is a tautology. If the compound proposition is a tautology, then the argument is valid. p  qpqp  qpq  The argument is v a l i d. Argument

38 Show that the reasoning of the following argument is false, or the argument is invalid: “If the last digit of this number is a 0, then this number is divisible by 10.” “A number is divisible by 10.” “A last digit of this number is a 0.” Solution: Assume: p : A last digit of this number is a 0. q : A number is divisible by 10. then the argument can be written as: Argument p  qqpp  qqp  See line 3.  Conclusion p is false, even though all the hypotheses are true.  Thus, the argument is i n v a l i d.

39 2 nd way: Showing that the truth table of [(p  q)  q]  p is a tautology. If the compound proposition is a tautology, then the argument is valid. p  qqpp  qqp  The argument is i n v a l i d. Argument

40 The Connective Or in English In English “or” has two distinct meanings. –Inclusive Or: For p ∨q to be T, either p or q or both must be T Example: “CS 202 or Math 120 may be taken as a prerequisite.” Meaning: take either one or both –Exclusive Or (Xor). In p ⊕q, either p or q but not both must be T Example: “Soup or salad comes with this entrée.” Meaning: do not expect to get both soup and salad pqp ⊕q TTF TFT FTT FFF 401 July 2016

41 Logical operator for exclusive disjunction is xor, with the notation . Exclusive Disjunction 1 July 201641

42 Homework(1) for Monday 4/11 Pages: 39, 40(Discrete mathematics and its applications, Sussana S.epp,2007) 1) Use truth tables to determine whether the following argument forms are valid

43 2) Some of the following arguments are valid while the others exhibit the converse or the inverse error. Use symbols to write the logical form of each argument. If the argument is valid, identify the rule of inference that guarantees its validity. Otherwise state whether the converse or the inverse error is made. a) If Jules solved his problem correctly, then Jules obtained the answer 2. Jules obtained the number 2 Jules solved this problem correctly b) This real number is rational or it is irrational. This real number is rational This real number is irrational

44 c) If this number is larger than 2, then its square is larger than 4. This number is not larger than 2. The square of this number is not larger than 4.

45 SOLUTION Homework(1) 1 July 201645

46 1 July 201646

47 1 July 201647

48 First Exam 1 July 201648

49 Remember 1 July 201649


Download ppt "Discrete Mathematical الرياضيات المتقطعة Dr. Ahmad Tayyar Al Israa University"

Similar presentations


Ads by Google