141

Math 42, Discrete Mathematicskubelka/xtra42/DiscreteMathCh1...Math 42, Discrete Mathematics Richard .P Kubelka San Jose State University Preliminaries Propositional Logic Applications

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

  • Math 42, Discrete Mathematics

    Fall 2018

    Richard P. KubelkaSan Jose State University

    last updated 09/20/2018 at 17:00:17

    For use by students in this class only; all rights reserved.Note: some prose & some tables are taken directly from Kenneth R. Rosen, DiscreteMathematics and Its Applications, 8th Ed., the o�cial text adopted for this course.

    c© R. P. Kubelka

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Maximize Your Chance of Success in this Course

    I Get enough sleep! �Studies have shown that sleepquantity and sleep quality equal or outrank such popularcampus concerns as alcohol and drug use in predictingstudent grades and a student's chances of graduating."

    See �An Underappreciated Key to College Success:Sleep," New York Times, August 14, 2018:https://www.nytimes.com/2018/08/13/well/

    an-underappreciated-key-to-college-success-sleep.

    html

    https://www.nytimes.com/2018/08/13/well/an-underappreciated-key-to-college-success-sleep.htmlhttps://www.nytimes.com/2018/08/13/well/an-underappreciated-key-to-college-success-sleep.htmlhttps://www.nytimes.com/2018/08/13/well/an-underappreciated-key-to-college-success-sleep.html

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Maximize Your Chance of Success in this Course

    I Turn o� your smartphone when you come to class.

    I Recent research has shown that use of smartphones orlaptops in the classroom for purposes unrelated to thecurrent class�e.g., not for taking notes or photos ofthe whiteboard�lead to signi�cantly lower performanceon the course �nal exam.

    I Moreover, this e�ect is seen not just for the studentswho are using such devices, but for all the students inthe class�presumably because such devices constitute adistraction for everyone.

    I Furthermore, the adverse e�ect on academicperformance seems to be greater for weaker students,students who don't need any additional obstacles tolearning.

    Moral of the story: Facebook, Twitter, and sportsscores can wait till after class!

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Maximize Your Chance of Success in this Course

    I Arnold L. Glass & Mengxue Kang (2018): �Dividingattention in the classroom reduces exam performance,"Educational Psychology, DOI:10.1080/01443410.2018.1489046https://doi.org/10.1080/01443410.2018.1489046

    I Louis-Philippe Beland & Richard Murphy (2015): �IIICommunication: Technology, Distraction & StudentPerformance," CEP Discussion Paper No 1350, Centrefor Economic Performance, London School of Economicsand Political Sciencehttp://cep.lse.ac.uk/pubs/download/dp1350.pdf

    I Brian Heaton (2015): �Increased Smartphone UseEquals Lower GPA Among College Students," Center forDigital Educationhttp://www.govtech.com/education/

    Increased-Smartphone-Use-Equals-Lower-GPA-Among-College-Students.

    html

    https://doi.org/10.1080/01443410.2018.1489046http://cep.lse.ac.uk/pubs/download/dp1350.pdfhttp://www.govtech.com/education/Increased-Smartphone-Use-Equals-Lower-GPA-Among-College-Students.htmlhttp://www.govtech.com/education/Increased-Smartphone-Use-Equals-Lower-GPA-Among-College-Students.htmlhttp://www.govtech.com/education/Increased-Smartphone-Use-Equals-Lower-GPA-Among-College-Students.html

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    A Tip on Reading a Math Book

    The most important things to look for are the de�nitions.I De�nitions are key in understanding and using the

    underlying mathematicsI You can't prove that something is a glorp if you don't

    know what a glorp is.

    De�nitions may appear explicitly like:

    De�nition

    A yeti is a legendary large, hairy, humanoid creature said toinhabit the Himalayas. It is also referred to as an AbominableSnowman.

    Or they may be implicit or embedded, like:

    When stalking Big Foot, also known by its NativeAmerican name Sasquatch, you should avoid usinginsect repellent, as Big Foot has a keen sense ofsmell. [Note that the boldface term is de�ned bythe sentence containing it.]

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    De�nition

    A proposition is a declarative sentence�i.e., a sentence thatdeclares a fact�that is either true or false, but not both.

    The truth value of a true proposition is true, denoted by T;The truth value of a false proposition is false, denoted by F.

    Examples

    1. �I was born in California." Truth value T.

    2. �Water boils at 100◦C." Truth value T.

    3. �I am enrolled in Math 42." Truth value F.

    4. �I have travelled to all 50 states." Truth value F.

    5. �All humans are mortal." Truth value T.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    RemarksI We should take care in stating propositions and

    determining their truth values. Some propositions areabsolutely true or false, e.g., �I was born in California."But the truth value of some propositions may depend ontime or other conditions, e.g., �I am enrolled in Math42," �Water boils at 100◦C," or �My blood pressure istoo high."

    I We should also be as precise as possible when statingpropositions. �Water boils at 150◦C" is anotherproposition with truth value T, since water will boil atany temperature greater than 100◦C, its boiling point.A more precise statement than Example 2 above wouldbe �The boiling point of water is 100◦C."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples (Declarative Sentences But Not Propositions)

    1. �Colorless green ideas sleep furiously."

    2. �The police were ordered to stop drinking aftermidnight."

    3. �I am lying."

    4. x2 + y2 = z2.

    The �rst three of these statements are famous examplesillustrating various problems we can encounter whenexamining declarative sentences, e.g., lack of meaning,ambiguity, paradox.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    To simplify matters, we will denote speci�c propositions byusing propositional variables such as p, q, r, s, etc. This isespecially useful when we modify or combine propositionsinto compound propositions.

    De�nition

    Let p be a proposition. The negation of p, denoted by ¬p,is the statement �It is not the case that p."

    The proposition ¬p is read �not p" and it has the oppositetruth value from that of p.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Negation

    Remark

    We usually use more conventional English to express thenegation of a proposition than simply adding �It is not thecase that" to the front.

    Examples

    1. �I wasn't born in California" instead of �It is not the casethat I was born in California."

    2. �I haven't travelled to all 50 states." instead of �It is notthe case that I have travelled to all 50 states."

    3. �Water doesn't boil at 100◦C" instead of �It is not thecase that water boils at 100◦C."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    But some negations of propositions can be problematical:

    Example

    If we try to negate the statement p, �I got eight hours ofsleep last night," by saying �I didn't get eight hours of sleeplast night" that gives the impression that I got less thaneight hours of sleep. But maybe I actually got nine hours ofsleep. If that were the case, then ¬p would actually be true.This kind of situation is very important in a part of statisticscalled hypothesis testing.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Truth Tables

    In dealing with compound propositions, we will often employtruth tables, tables that show the truth values of modi�edor compound propositions relative to the truth values of thecomponent propositions.

    Table 1: Truth Table for the Negation of a Proposition

    p ¬p

    T FF T

    Remark

    As we've just seen, if p is a proposition, then ¬p is aproposition. So that means we can form the proposition¬(¬p), usually written ¬¬p. �It is not the case that it is notthe case that . . . " As we will see when we discussequivalence of propositions, ¬¬p is equivalent to p.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Conjunction

    De�nition

    Let p and q be propositions. The conjunction of p and q,denoted by p∧ q, is the proposition �p and q." Theconjunction p∧ q is true when both p and q are true andfalse otherwise.

    Table 2: Truth Table for the Conjunction of Two Propositions

    p q p∧ q

    T T TT F FF T FF F F

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Conjunction

    Examples

    1. p, �I was born in California," q, �Water boils at 100◦C,"p∧ q: �I was born in California, and water boils at100◦C." p∧ q has truth value T.

    2. p, �I was born in California," r, �I have travelled to all50 states," p∧ r: �I was born in California, and I havetravelled to all 50 states." p∧ r has truth value F, sinceI haven't travelled to all 50 states.

    3. �My brother played football in high school, but I rantrack and cross-country." (Note that �but" functions as�and" here.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Disjunction

    De�nition

    Let p and q be propositions. The disjunction of p and q,denoted by p∨ q, is the proposition �p or q." Thedisjunction p∨ q is false when both p and q are false andtrue otherwise.

    Table 3: Truth Table for the Disjunction of Two Propositions

    p q p∨ q

    T T TT F TF T TF F F

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Disjunction

    Examples

    1. p, �I was born in California," q, �Water boils at 100◦C,"p∨ q: �I was born in California, or water boils at100◦C." p∨ q has truth value T.

    2. p, �I was born in California," r, �I have travelled to all50 states," p∨ r: �I was born in California, or I havetravelled to all 50 states." p∨ r has truth value T, sinceI was born in California.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Disjunction, Exclusive Or

    RemarksI Note that disjunction is inclusive in that p∨ q really

    means �p, or q, or both p and q." That's why Example1 above has truth value T.

    I Sometimes we want Or to be explicitly exclusive, i.e., wemean �Either r is true or s is true but not both." In thiscase we de�ne a connective ⊕ called the exclusive or.So for r, �I will go to the Quakes game tonight," s, �Iwill stay home and do my Math 42 homework tonight,"r⊕ s: �I will either go to the Quakes game or stay homeand do my Math 42 homework tonight (but not both)."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Conjunction vs. Disjunction

    Figure 1: Conjunction vs. Disjunction

    p∧ q p∨ q

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Exclusive Or

    Table 4: Truth Table for the Exclusive Or of Two Propositions

    p q p⊕ qT T FT F TF T TF F F

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    De�nition

    Let p and q be propositions. The conditional statementp→ q is the proposition �If p, then q." The conditionalstatement p→ q is false when p is true and q is false, andtrue otherwise. In the conditional statement p→ q, p iscalled the hypothesis (or premise or antecedent) and q iscalled the conclusion (or consequence).

    RemarkI The statement p→ q is called a conditional statement

    because it doesn't assert the truth of q absolutely, butrather only on the condition that p is true.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    An implication can be stated in many forms other than thestandard �If p, then q." Here are some others:

    One of the trickiest of these alternative ways of statingp→ q is �p only if q." We can reformulate p→ q as �(Thetruth of) p implies (the truth of) q." Hence if p is true, qcannot be false. In other words, �(the truth of) p (ispossible) only if q (is true)."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    Example

    �To get a PhD in math you must have studied math for manyyears." p: �You have a PhD in math." q: �You have studiedmath for many years." p→ q: �If you have a PhD in math,then you have studied math for many years."

    �A necessary condition for having a PhD in math is havingstudied math for many years." Note that many years of studyis not enough to get you a PhD in math, i.e., it's not asu�cient condition for having a PhD in math.

    �A su�cient condition for having studied math for manyyears is having a PhD in math." Note that having a PhD inmath is not a necessary condition for having studied math formany years. (You could have studied math for many yearswithout having a PhD in math.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    Table 5: Truth Table for the Implication p→ q

    p q p→ qT T TT F FF T TF F T

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    For given propositions p, q, etc., we will need to be able totranslate p→ q into ordinary English. On the other hand,we will need to be able to translate certain compoundpropositions given verbally into symbolic implications.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    1. p, �I study hard," q, �I get a good grade in this class":p→ q, �If I study hard, then I get a good grade in thisclass." Or, in less stilted English, �If I study hard, I'll geta good grade in this class."

    2. �Nobody is despised who can manage a crocodile." If welet r be the proposition �I can manage a crocodile," ands be the proposition �I am despised," then we cantranslate the given sentence as: r→ ¬s. But note thatwe could also plausibly translate this as s→ ¬r.

    3. �If I travelled to all 50 states before January 1, 2016, amysterious stranger gave me $1 million." This statementis true because the hypothesis is false.

    4. If a salesperson says, �If you need any help, my name isSasha," what is her name if you don't need any help?

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    For each implication p→ q there are several relatedimplications. To illustrate these we will use Example 2above.

    De�nitionI The proposition q→ p is called the converse of p→ q.

    E.g., q→ p: �If I have studied math for many years,then I have a PhD in math."

    I The proposition ¬q→ ¬p is called the contrapositiveof p→ q. E.g., ¬q→ ¬p: �If I haven't studied mathfor many years, then I don't have a PhD in math."

    I The proposition ¬p→ ¬q is called the inverse ofp→ q. E.g., ¬p→ ¬q: �If I don't have a PhD in math,then I haven't studied math for many years."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication, Converse, Contrapositive, Inverse

    Note that the contrapositive of the converse is the inverse,and, if we believe that ¬¬r is equivalent to r, thecontrapositive of the inverse is the converse!

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication, Converse, Contrapositive, Inverse

    Example

    Translate the following proposition into symbolic implicationform, then give its converse, contrapositive, and inverse:�Everyone who is sane can do logic."

    I Let p be the statement �You are sane" and let q be thestatement �You can do logic." Then the givenproposition can be translated into the implicationp→ q: �If you are sane, then you can do logic."

    I Converse (q→ p): �If you can do logic, then you aresane."

    I Contrapositive (¬q→ ¬p): �If you can't do logic,then you are not sane." (Or, �You're insane if you can'tdo logic.")

    I Inverse (¬p→ ¬q): �If you're not sane, then you can'tdo logic." (Or, �Insane people can't do logic.")

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication, Converse, Contrapositive, Inverse

    Example

    Translate the following proposition into symbolic implicationform, then give its converse, contrapositive, and inverse: `Noone can remember the battle of Waterloo, unless he is veryold."

    I Let r be the statement �You are very old" and let s bethe statement �You can remember the battle ofWaterloo." Then the given proposition can be translatedinto the implication s→ r: �If you can remember thebattle of Waterloo, then you are very old."

    I Converse (r→ s): �If you are very old, then you canremember the battle of Waterloo."

    I Contrapositive (¬r→ ¬s): �If you aren't very old,then you can't remember the battle of Waterloo."

    I Inverse (¬s→ ¬r): �If you can't remember the battleof Waterloo, then you aren't very old."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication, Converse, Contrapositive, Inverse

    Table 6: Truth Table for p→ q and its Converse, Contrapositive,& Inverse

    p q p→ q q→ p ¬q→ ¬p ¬p→ ¬qT T T T T TT F F T F TF T T F T FF F T T T T

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    De�nition

    Two compound propositions with the same componentpropositions are called equivalent if their truth tables are thesame.

    We can see from this de�nition and Table 5 that anyimplication is equivalent to its contrapositive.

    This fact is what allowed us to translate Example 2 above intwo di�erent�but equivalent�ways.

    Since any implication is equivalent to its contrapositive, weconclude that the inverse of an implication is equivalent tothe converse of that implication. (Of course we could havenoted this directly by looking at the table.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Implication

    The implication p→ q is equivalent to the disjunction¬p∨ q. We see this by examining their truth tables:

    Table 7: Equivalence of p→ q and ¬p∨ q

    p q p→ q ¬p∨ qT T T TT F F FF T T TF F T T

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Biconditional

    De�nition

    Let p and q be propositions. The biconditional statementp↔ q is the proposition �p if and only if q." Thebiconditional statement p↔ q is true when p and q havethe same truth values, and false otherwise.

    RemarksI The biconditional statement p↔ q is equivalent to the

    conjunction �(p if q) AND (p only if q)," i.e.,(q→ p)∧ (p→ q).

    I Some other ways of expressing the biconditional p↔ qinclude �p i� q," �if p then q, and conversely," and �pis necessary and su�cient for q."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Biconditional

    Table 8: Truth Table for the Biconditional p↔ q

    p q p→ q q→ p p↔ q (q→ p)∧ (p→ q)T T T T T TT F F T F FF T T F F FF F T T T T

    Example

    Consider the statement �A real number x has a square root ifand only if x > 0." This is a conjunction of the twostatements �If x has a square root, then x > 0" and �Ifx > 0, then x has a square root."

    Or: �A necessary and su�cient condition for a real number tohave a square root is for that number to be nonnegative."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Precedence of Logical Operations

    Since a compound proposition might easily involve a numberof logical operators like negation, conjunction, disjunction,etc., it is important to use parentheses to avoid anyambiguity as to which operators apply to which operands. If,however, parentheses are missing, we use the following tableto determine which operators take precedence over others.

    Table 9: Precedence of Logical Operators

    Operator Precedence

    ¬ 1

    ∧ 2∨ 3

    → 4↔ 5

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic & Bit Operations

    In computer science, a bit is a symbol with two possiblevalues, viz., 0 (zero) and 1 (one). (Does this sound familiar?)As you probably know, most of computer science comesdown to storing and manipulating bits, i.e., 0's and 1's.

    Well, if we interpret True as 1 and False as 0, we cantranslate most everything we've done so far withpropositions, connectives and truth tables into bitoperations and their manipulation.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic & Bit Operations

    If we replace T and F by 1 and 0 in the truth table forconjunction (∧)�see Table 2 above�we get the following:

    Table 10: Digital Conjunction

    p q p∧ q

    1 1 11 0 00 1 00 0 0

    Table 11: Binary Multiplication

    × 0 10 0 01 0 1

    Now compare Table 10 with Table 11, the multiplicationtable for binary arithmetic.

    We see that, except for formatting, the tables are identical.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic & Bit Operations

    So conjunction�which is called the AND operator instead of∧ in computer science�can be used to perform binarymultiplication.

    Similarly, the exclusive or�called XOR instead of ⊕ incomputer science�can be used to perform binary addition.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic & Bit Operations

    First replace T and F by 1 and 0 in the truth table forexclusive or (⊕)�see Table 4 above�to get the following:

    Table 12: Digital Exclusive Or

    p q p⊕ q1 1 01 0 10 1 10 0 0

    Table 13: Binary Addition

    + 0 1

    0 0 11 1 0

    Now compare Table 12 with Table 13, the addition table forbinary arithmetic.

    Once again, we see that, except for formatting, the tables areidentical.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations

    Example

    Are the following system speci�cations consistent?

    1. The system is in multiuser state if and only if it isoperating normally.

    2. If the system is operating normally, the kernel isfunctioning.

    3. The kernel is not functioning or the system is ininterrupt mode.

    4. If the system is not in multiuser state, then it is ininterrupt mode.

    5. The system is not in interrupt mode.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations

    First give names to simple propositions:

    m: �The system is in multiuser state."

    n: �The system is operating normally."

    k: �The kernel is functioning."

    i: �The system is in interrupt mode."

    Then translate the system speci�cations into compoundpropositions:

    1. m↔ n2. n→ k3. ¬k∨ i

    4. ¬m→ i5. ¬i

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations

    Construct the truth table:

    Table 14: System Speci�cations

    m n k i ¬k∨ i ¬i n→ k ¬m→ iT T T T T F T TT T T F F T T TT T F T T F F TT T F F T T F TF F T T T F T TF F T F F T T FF F F T T F T TF F F F T T T F

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations

    Now note that the absolute statements�i.e., the statementsthat are not conditional�must be true. These are thestatements ¬k∨ i and ¬i, and they are marked in green.

    But there are only two lines in the truth table for which both¬k∨ i and ¬i are true�so we may disregard all the otherlines. And the truth table tells us that in the �rst of theselines the statement n→ k must be false and in the other thestatement ¬m→ i must be false. That shows that under noconditions is it possible for all of our speci�cations to be truesimultaneously. Thus the system of speci�cations isinconsistent.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    Example

    Suppose we're given the following assumptions. What can weconclude?

    1. Every object that is to the right of all the blue objects isabove all the triangles.

    2. If an object is a circle, then it is to the right of all theblue objects.

    3. If an object is not a circle, then it is not gray.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    First give names to simple propositions:

    r: �The object is to the right of all the blue objects."

    t: �The object is above all the triangles."

    c: �The object is a circle."

    g: �The object is gray."

    Then translate the three assumptions into compoundpropositions:

    1. r→ t2. c→ r3. ¬c→ ¬g

    Note that since ¬c→ ¬g is the contrapositive of g→ c, towhich it is equivalent, we may replace Assumption 3 byg→ c.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    But now we reason that since the truth of g implies the truthof c, the truth of c implies the truth of r, and the truth of rimplies the truth of t, we must conclude that the truth of gimplies the truth of t. That is, g→ t, or, in words:

    �If an object is gray it is above all the triangles."Or,�All the gray objects are above all the triangles."

    Remark

    What we said in the �rst paragraph above can besummarized simply by stringing the given implicationstogether, one after another:

    g→ c→ r→ t

    to get g→ t.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    Example

    Suppose we're given the following assumptions. What can weconclude?

    1. When I work a logic example without grumbling, youmay be sure it is one I understand.

    2. The arguments in these examples are not arranged inregular order like the ones I am used to.

    3. No easy examples make my head ache.

    4. I can't understand examples if the arguments are notarranged in regular order like the ones I am used to.

    5. I never grumble at an example unless it makes my headache.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    First give names to simple propositions:

    g: �I grumble at an example."

    u: �I understand an example."

    a: �The arguments are arranged in regular order like I amused to."

    e: �The example is easy."

    h: �The example makes my head ache."

    Then translate the three assumptions into compoundpropositions:

    1. ¬g→ u2. ¬a

    3. e→ ¬h4. ¬a→ ¬u5. g→ h

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logic Puzzles

    Now we string the given implications together as above toget:

    ¬a→ ¬u→ g→ h→ ¬e

    to get ¬a→ ¬e. (Here we've used that the contrapositive of¬g→ u is ¬u→ g (since ¬¬g is equivalent to g) and thatthe contrapositive of e→ ¬h is h→ ¬e (since ¬¬h isequivalent to h).)

    But we are given that ¬a is true. So we must conclude that¬e is true, i.e., �The example is not easy."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations, bis

    We solved the systems speci�cations example above by usingtruth tables. However, we could have used the method ofstringing implications together that we've just seen.

    Recall that our assumptions translated to:

    1. m↔ n2. n→ k3. ¬k∨ i

    4. ¬m→ i5. ¬i

    Since the contrapositive of Assumption 4 is ¬i→ m, andsince Assumption 3 is equivalent to k→ i, we have

    ¬i→ m↔ n→ k→ i,

    which is ridiculous: how can ¬i imply i?

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    System Speci�cations, bis

    Well, not so fast! Is¬i→ i (1)

    really a problem? Is (1) always false? No! If i is true, then(1) is actually true!

    In fact,¬i→ i ≡ ¬(¬i)∨ i ≡ i∨ i ≡ i, (2)

    which is true when i is true and false when i is false.

    So our �ridiculous" conclusion is simply the conclusion that iis true!

    But don't forget that one of our original speci�cations was¬i. So now we have that both i and ¬i are truesimultaneously, i.e., that i∧ ¬i is true. And that really is acontradiction, something that can never be true.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Tautology & Contradiction

    De�nition

    A compound proposition that is always true, no matter whatthe truth values of the propositional variables that occur init, is called a tautology. A compound proposition that isalways false is called a contradiction. A compoundproposition that is neither a tautology nor a contradiction iscalled a contingency.

    Example

    I (Tautology) p→ p

    Table 15: Truth Table for p→ p

    p p→ pT TF T

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Tautology & Contradiction

    Example

    I (Contradiction) ¬(p∨ ¬p)

    Table 16: Truth Table for ¬(p∨ ¬p)

    p ¬(p∨ ¬p)

    T FF F

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

    De�nition

    The compound propositions p and q are called logicallyequivalent if p↔ q is a tautology. The notation p ≡ qdenotes that p and q are logically equivalent.

    RemarksI Earlier we said that two compound propositions were

    equivalent if their truth tables were identical. Thatformulation of equivalence is actually easier to use thanthis new de�nition, although each of the twoformulations implies the other.

    I In manipulating complicated propositions, we canreplace any subproposition by another proposition that isequivalent to it. This will often help us simplifycomplicated propositions.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

    Example

    Show that ¬(p∧ q) ≡ ¬p∨ ¬q.

    Proof.

    Here's the truth table:

    Table 17: Equivalence of ¬(p∧ q) and ¬p∨ ¬q

    p q ¬(p∧ q) ¬p∨ ¬q ¬(p∧ q)↔ ¬p∨ ¬qT T F F TT F T T TF T T T TF F T T T

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

    Remark

    Considering columns three and four of Table 17, we see thatour older formulation of equivalence is satis�ed. Consideringcolumn �ve, we see that the new de�nition of equivalence issatis�ed.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Logical Equivalences

    RemarksI Don't freak out: you don't have to memorize all these

    equivalences.

    I But I could ask you to prove any of them.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Contradiction

    The book's Example 7 (p. 19) gives one of Smullyan's�Knights and Knaves" puzzles. Smullyan posits an islandwhere all inhabitants are either knights, who always tell thetruth, or knaves, who always lie. Suppose you encounter twopeople, A and B, on the island and A says, "B is a knight,"while B says, "The two of us are opposite types." What canyou conclude?

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Let p be the statement �A is a knight," and let q be thestatement �B is a knight." Then if person A is a knight�andthus telling the truth�then statement q must hold. That is,we get

    p→ q. (3)

    On the other hand, if B is a knight then A must be a knave,and not a knight�since B is telling the truth about the twobeing of opposite types. Thus,

    q→ ¬p (4)

    Statements (3) and (4) are given to be true. And if wereplace (4) by its contrapositive p→ ¬q, we get the truestatement

    p→ (q∧ ¬q). (5)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Contradiction

    But q∧ ¬q in (5) is a contradiction, i.e., never true. Sowhat can we conclude from (5)?

    The truth of (5) must imply that p is false, i.e., that A is aknave.

    The argument that we've just seen is called argument bycontradiction or reductio ad absurdum. We'll see more aboutthis later on.

    Can we conclude anything about B? Well, since A is a knave,A's statement that B is a knight is a lie, i.e., it's false. So Bmust be a knave. And B's statement that the two are ofopposite types is false�consistent with what we'veconcluded so far.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Predicate Logic

    Sometimes propositional logic, which we've been studying sofar, is too limited for examining the kinds of propositions inwhich we're interested.

    Example

    A famous argument from late antiquity goes as follows:

    All men are mortal.Socrates is a man.Therefore Socrates is mortal.

    We could almost get there by letting p be the statement�You're a man" and q be the statement �You are mortal,"then writing

    p→ qp

    ∴ q. But where is Socrates in all this?

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Predicates & Quanti�ers

    The following shows another way in which PropositionalLogic is inadequate to the task of handling complicatedpropositions:

    Example

    The statement �x is a root of the polynomial y2 − y− 6" isnot a proposition: it doesn't have a well-de�ned truth valuesince we don't know what x is. If x = −2, then thestatement becomes a proposition with truth value T . On theother hand, if x = 10, the statement becomes a propositionwith truth value F.

    The example above suggests that we can de�ne apropositional function, a function whose outputs arepropositions that vary depending on its inputs.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Predicate Logic

    Recall that a function f : X→ Y consists of1. A set X of inputs of the function; X is called the

    domain of the function.

    2. A set Y of potential outputs of the function; Y is calledthe codomain of the function.

    3. A rule that associates to each element x of the domaina unique element f(x) of the codomain.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Predicate Logic

    RemarksI Note that we don't say that Y is the set of outputs of

    the function because it may be that not every elementof Y is actually an output. For example, the functionf : R→ R given by f(x) = x2 has only nonnegativeoutputs. So −1 is in the codomain R but it is not anoutput of the function.

    I Some high school textbooks refer to Y as the range ofthe function instead of as the codomain. Do not use thisterminology; the range of a function is the set of actualoutputs of the function. In the example referred toabove, the range is the set of all nonnegative numbers.

    I Although most of the functions you've seen so far havehad domains and codomains that were sets of numbers,nothing in the de�nition requires this. That's why I cantalk about a function whose outputs are propositions.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples of Predicates

    Examples

    1. Let P(x) be the statement �x is a root of the polynomialy2 − y− 6." Then P(−2) is the proposition �−2 is aroot of the polynomial y2 − y− 6," which has truthvalue T . P(10), on the other hand has truth value F.

    2. Let Q(x) be the statement �x is Prince William's son."Then Q(George) has truth value T , whileQ(Charlotte) and Q(Harry) have truth value F.

    3. Let R(x,y, z) be the statement �x2 + y2 = z2." ThenR(3, 4, 5) and R(5, 12, 13) have truth value T , whileR(1, 2, 3) has truth value F.

    Example 3 shows that a propositional function can have morethan one input. In this case we have a 3-place predicate orternary predicate (in general n-place predicate or n-arypredicate).

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    Returning to the example with which we started this section,we could de�ne the propositional function P(x) as �x ismortal." Then P(Socrates) and P(Professor Kubelka) havetruth value T .

    Besides plugging in speci�c values for x one at a time,another way to convert P(x) into a statement with awell-de�ned truth value is by the application of quanti�ers.

    De�nition

    The universal quanti�cation of P(x) is the statement

    �P(x) for all values of x in the domain."

    The notation ∀x P(x) denotes the universal quanti�cation ofP(x). Here ∀ is called the universal quanti�er. We read∀x P(x) as �for all x P(x)" or �for every x P(x)." An elementfor which P(x) is false is called a counterexample of∀x P(x).

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    Example

    The universal quanti�cation of the propositional functionP(x) �x is mortal" is

    ∀x P(x) �For every x in the domain, x is mortal."

    This is a pretty awkward sentence. For one thing, what is thedomain here? Since the original statement was �All men aremortal," we may assume that the domain is the set of allmen. The statement ∀x P(x) is meaningless without adomain that is at least implied.

    In fact, assuming that the domain comprises all men, we maytranslate ∀x P(x) precisely as �All men are mortal."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    Example

    Let Q(x) be the statement � |x| is positive," and assume thatthe domain of this propositional function is the set of all realnumbers.

    ∀x Q(x) may be translated as �The absolute value of a realnumber is positive."

    Do you believe that ∀x Q(x) is a true statement? That is, doyou believe that for every real number x, |x| is positive?

    If you didn't believe the statement were true, how would yourefute (disprove) it?

    You would simply need to �nd one x with the property that|x| is not positive. Do you think that's possible?

    What about x = 0? Is |0| positive? No! We have acounterexample to ∀x Q(x).

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    RemarksI Sometimes universal quanti�ers are hidden. The

    statement above �The absolute value of a real number ispositive" contains neither the word �all" nor the word�every." What it does contain is the word �a." Thepresence of the inde�nite article �a" signals that thestatement is supposed to be true for any old number,not just some special or lucky one. Thus �all" is implied.

    I Generally, an implicit assumption is made that alldomains of discourse for quanti�ers are nonempty. Notethat if the domain is empty, then ∀x P(x) is true for anypropositional function P(x) because there are noelements x in the domain for which P(x) is false. Thestatement �All unicorns have golden horns and silverhooves" is true, vacuously.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    RemarksI Besides �for all" and �for every," universal quanti�cation

    can be expressed in many other ways, including �all of,"�for each," �given any," �for arbitrary," �for each," and�for any."

    There's another important quanti�er we could apply to thepropositional function P(x).

    De�nition

    The existential quanti�cation of P(x) is the proposition

    �There exists an element x in the domain such thatP(x)."

    We use the notation ∃x P(x) for the existential quanti�cationof P(x). Here ∃ is called the existential quanti�er.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    RemarksI Once again, we must specify the domain of the

    propositional function P(x). The statement ∃x P(x) ismeaningless without a domain that is at least implied.

    I Besides the phrase �there exists," we can also expressexistential quanti�cation in many other ways, such as byusing the words �for some," �for at least one," or �thereis." The existential quanti�cation ∃x P(x) is read as�There is an x such that P(x)," �There is at least one xsuch that P(x)," or �For some x P(x)."

    I ∃x P(x) will be a false statement when P(x) is false forevery x, i.e., when ∀x (¬P(x)) is true.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Negating Quanti�ers

    I Negating the universal quanti�er:

    ¬∀x P(x) ≡ ∃x ¬P(x) (6)

    I Negating the existential quanti�er:

    ¬∃x P(x) ≡ ∀x ¬P(x) (7)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Quanti�ers

    Example

    Let P(x) be the statement �x is a root of the polynomialy2 − y− 6." Then ∃x P(x) is a true statement, sinceP(−2) = 0 (and also P(3) = 0). (But note that ∀x P(x) isfalse, since P(5) 6= 0, for example. )

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Some Exercises

    (#5, p. 56)

    Let P(x) be the statement �x spends more than �ve hoursevery weekday in class," where the domain for x consists ofall students. Express each of these quanti�cations in English.

    1. ∃x P(x).�Some student spends more than �ve hours everyweekday in class."

    2. ∀x P(x)�Every student spends more than �ve hours everyweekday in class."

    3. ∃x ¬P(x)�There is a student who doesn't spend more than �vehours every weekday in class," or �Some student spendsno more than �ve hours every weekday in class."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Some Exercises

    (#5, p. 56)

    4. ∀x ¬P(x)�No student in class spends more than �ve hours everyweekday in class," or �Every student spends no morethan �ve hours every weekday in class."

    Example

    Translate the saying �No man is an island" into a quanti�edexpression.

    Let I(x) be the statement �x is an island," and let thedomain consist of all men (people). Then our desiredtranslation is ¬∃x I(x) ≡ ∀x ¬I(x).

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    (#23, p. 57)

    Translate in two ways each of these statements into logicalexpressions using predicates, quanti�ers, and logicalconnectives. First, let the domain consist of the students inyour class and second, let it consist of all people.

    1. Someone in your class speaks Hindi.

    Let H(x) be the statement �x speaks Hindi." Thenwhen the domain of x consists of all students in the yourclass, the desired translation is ∃x H(x).If the domain consists of all people, let C(x) be thestatement �x is a student in your class." Then thedesired translation is ∃x (C(x)∧H(x))

    2. Everyone in your class is friendly.

    Let F(x) be statement �x is friendly." Then when thedomain of x consists of all students in the your class,the desired translation is ∀x F(x).If the domain consists of all people, then the desiredtranslation is ∀x (C(x)→ F(x))

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    Translate the following English sentences into quanti�edexpressions. Then determine if the third assertion followslogically from the �rst two.

    1. A prudent man shuns hyænas.2. No banker is imprudent.3. No banker fails to shun hyænas.

    Let P(x) be the statement �x is prudent," let H(x) be thestatement �x shuns hyænas," and let B(x) be the statement�x is a banker."Then our three statements translate asfollows:

    1. ∀x (P(x)→ H(x))

    2. ¬(∃x (¬P(x)∧ B(x)))

    3. ∀x (B(x)→ H(x)).

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    We �rst manipulate Statement 2 to get

    ¬(∃x (¬P(x)∧ B(x))) ≡ ∀x ¬(¬P(x)∧ B(x))≡ ∀x (P(x)∨ ¬B(x))≡ ∀x (¬B(x)∨ P(x))≡ ∀x (B(x)→ P(x))

    (8)

    So we may replace Statement 2 by ∀x (B(x)→ P(x)).

    But Statement 1 says ∀x (P(x)→ H(x)). Now for anyparticular x, we saw earlier that we could string implicationstogether to get a new implication:

    B(x)→ P(x)→ H(x) ⇒ B(x)→ H(x). (9)

    But now since (9) is true for any particular x, we must have∀x(B(x)→ H(x)), which is just Statement 3.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Nested Quanti�ers

    RemarkI We can combine quanti�ers when dealing with

    propositional functions with more than one inputvariable.

    Example

    Let M(x,y) be the statement �x is the biological mother ofy." Then ∀y ∃x M(x,y) could be translated as �Everyonehas a biological mother."

    Remark

    But be careful about the order of the quanti�ers:∃x ∀y M(x,y) would be translated as �There's a personwho's the biological mother of everyone." This is quiteunlikely, especially given the di�culty of a person being thebiological mother of herself.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Negating Nested Quanti�ers

    We negate from the outside in, using (7) and (6) above:

    ¬(∃x ∀y P(x,y)) ≡ ∀x ¬(∀y P(x,y))≡ ∀x ∃y ¬P(x,y)

    (10)

    ¬(∀x ∃y P(x,y)) ≡ ∃x ¬(∃y P(x,y))≡ ∃x ∀y ¬P(x,y)

    (11)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    Example

    Translate the following statement into a quanti�edexpression:

    �There is a smallest positive integer."

    If we let m and n be positive integers, then

    ∃m ∀n (m 6 n)

    is the desired translation.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    RemarksI We could also have translated the given statement as

    ∃m ¬∃n (n < m),

    i.e., �There exists a positive integer m such that nosmaller positive integer n exists."

    I The negation of the statement above would, by (10), be

    ∀m ∃n m > n

    Warning

    Be careful negating inequalities. For example, the negation of�greater than" is not �less than." It's �no more than" or �atmost."

    The negation of �less than" is not �more than." It's �no lessthan" or �at least."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Examples

    Example

    Translate the following statement into a quanti�edexpression:

    �There is no smallest positive real number."

    If we let x and y be positive reals, then

    ¬(∃x ∀y (x 6 y)) (12)

    is the desired translation.

    Remark

    Note that by (10), (12) is equivalent to

    ∀x ∃y (y < x). (13)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Arguments

    So far we have mostly studied single propositions�whetherquanti�ed or not.

    Now we will consider collections of propositions arranged insuch a way as to prove or infer the truth of some conclusion.

    The tools we will use are called Rules of Inference.

    As usual, we must �rst establish some terminology. We startwith the notion of an argument.

    An argument is a connected series of statements toestablish a de�nite proposition.

    Monty Python's Flying Circus, �Argument Clinic"

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Arguments

    More precisely, by an argument, we mean a sequence ofstatements that ends with a conclusion. By a validargument, we mean an argument in which the conclusion, or�nal statement, must follow from the truth of the precedingstatements, or premises. That is, an argument is valid if andonly if it is impossible for all the premises to be true and theconclusion to be false.

    Example

    The following is a valid argument. Statements 1 and 2 arepremises; Statement 3 is the conclusion.

    1. All Englishmen like plum pudding.2. I am an Englishman.3. I like plum pudding.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Arguments

    Remark

    Note that we do not say that the conclusion is true. We onlysay that the conclusion follows inescapably from the truth ofthe premises. If one or more of the premises is a falsestatement, then we have no basis for deciding whether or notthe conclusion is true.

    In the argument above, we can't conclude anything aboutwhether I like plum pudding since the assumption that I aman Englishman is false.

    Some texts�but not ours�call an argument sound if is validand all of its premises are true. The conclusion of a soundargument is true, since its premises are true and theconclusion follows from them.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Arguments

    In the plum pudding argument above, if we let p be thestatement �I am an Englishman" and q be the statement �Ilike plum pudding," then we can express the argumentsymbolically as

    p→ qp

    ∴ q

    Here we have replaced the argument by an argument form.We will deduce the validity of the argument from the validityof the associated argument form.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Arguments

    De�nition

    An argument in propositional logic is a sequence ofpropositions. All but the �nal proposition in the argumentare called premises and the �nal proposition is called theconclusion. An argument is valid if the truth of all itspremises implies that the conclusion is true.

    An argument form in propositional logic is a sequence ofcompound propositions involving propositional variables. Anargument form is valid if no matter which particularpropositions are substituted for the propositional variables inits premises, the conclusion is true if the premises are all true.

    Remark

    An argument form with premises p1,p2, . . . ,pn andconclusion q is valid, when (p1 ∧ p2 ∧ . . .∧ pn)→ q is atautology.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Rules of Inference

    We could, in principle, establish the validity of an argumentform by demonstrating by truth table that the appropriatecompound proposition is a tautology. But that approachquickly becomes unwieldy for more complex compoundpropositions.

    Instead, as we did in proving tautologies in some examplesabove, we will progressively simplify the argument form byreplacing relatively simple pieces of it by equivalent pieces. Indoing so we will be applying rules of inference.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Modus Ponens

    We saw that the �plum pudding" argument above could bereduced to the argument form

    p→ qp

    ∴ q

    This can be expressed as the proposition

    ((p→ q)∧ p)→ q. (14)

    But (14) was one of the examples in the Tautologieshandout. (Actually, we saw in that handout that(p∧ (p→ q))→ q is a tautology, but these twopropositions are equivalent by the commutativity of ∧.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Modus Ponens

    The rule of inference based on the tautology((p→ q)∧ p)→ q�or, equivalently,(p∧ (p→ q))→ q�is called modus ponens.

    Example

    The (truth of the) premises �If I talk too much, people willconsider me a bore" and �I talk too much" imply the (truthof the) conclusion �People consider me a bore" by modusponens. (We usually omit the parenthetical expressions, butthey are always hidden in the background.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Hypothetical Syllogism

    Another rule of inference we've already seen�although Igave no proof�is called hypothetical syllogism. It is basedon the tautology

    ((p→ q)∧ (q→ r))→ (p→ r),

    or, in alternate notation:p→ qq→ r∴ p→ r

    This is the rule of inference we used to string twoimplications together:

    p→ q→ r ⇒ p→ r

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Hypothetical Syllogism

    Example

    Is the following a valid argument?

    1. If my computer fails I won't have slides for class.

    2. If I don't have slides for class I'll have to write the lessonon the board.

    3. Therefore, if my computer fails I'll have to write thelesson on the board.

    c: �My computer fails."s: �I have slides for class."b: �I must write the lesson on the board."

    c→ ¬s¬s→ b∴ c→ b Yes, the argument is valid.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Find a Conclusion

    What conclusion(s) can we draw from the following premises?

    1. All writers who understand human nature are clever.

    2. No one is a true poet unless he can stir the hearts ofmen.

    3. Shakespeare wrote Hamlet.

    4. No writer who does not understand human nature canstir the hearts of men.

    5. None but a true poet could have written Hamlet.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Find a Conclusion

    u: �Writer understands human nature."c: �Writer is clever."p: �Writer is a true poet."s: �Writer stirs the hearts of men."h: �Writer wrote Hamlet."

    The assumptions may be translated as

    1. u→ c2. p→ s3. h4. s→ u5. h→ p

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Find a Conclusion

    Step Reason

    1 h→ p Premise2 p→ s Premise3 h→ s Hypothetical syllogism using (1) and (2)4 s→ u Premise5 h→ u Hypothetical syllogism using (3) and (4)6 u→ c Premise7 h→ c Hypothetical syllogism using (5) and (6)8 h Premise9 c Modus ponens using (7) and (8)

    So what is our conclusion? �Writer is clever," i.e.,�Shakespeare is clever."

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Modus tollens

    Another important rule of inference is modus tollens:

    ¬q

    p→ q∴ ¬p

    p→ q¬q

    ∴ ¬p

    Example

    I Whenever I have a hearty breakfast I'm in a good mood.

    I I'm not in good mood.

    Ergo, I didn't have a hearty breakfast.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Rules of Inference

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Using Rules of Inference

    Use rules of inference to show that the hypotheses (premises)imply the conclusion.

    1. If it does not rain or if it is not foggy, then the sailingrace will be held and the lifesaving demonstration will goon.

    2. If the sailing race is held, then the trophy will beawarded.

    3. The trophy was not awarded.

    4. It rained.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Using Rules of Inference

    r: �It rained."f: �It was foggy."s: �The sailing race was held."a: �The lifesaving event went on."t: �The trophy was awarded."

    The hypotheses (assumptions) may be translated as

    1. (¬r∨ ¬f)→ (s∧ a)2. s→ t3. ¬t

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Using Rules of Inference

    Step Reason

    1 s→ t Premise2 ¬t Premise3 ¬s Modus tollens using (1) and (2)4 ¬s∨ ¬a ≡ ¬(s∧ a) Addition and equivalence using (3)5 (¬r∨ ¬f)→ (s∧ a) Premise6 ¬(¬r∨ ¬f) Modus tollens using (4) and (5)7 r∧ f Equivalence using (6)8 r Simpli�cation using (7)

    So we reach the desired conclusion, i.e., that it rained.

    (Note that we could also have concluded that it was foggy.)

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Using Rules of Inference

    Remark

    Note that the �rst premise��If it does not rain or if it is notfoggy, then the sailing race will be held and the lifesavingdemonstration will go on"�is a little peculiar. It says that ifit's rainy but not foggy or foggy but not rainy then the showwill go on. Does that sound reasonable? Probably thepremise should say �If it's not foggy or rainy, then . . . ."

    This would translate as

    ¬(r∨ f)→ (s∧ a).

    Or(¬r∧ ¬f)→ (s∧ a).

    Unfortunately, if we translated the �rst premise that way wecould only conclude that it rained or was foggy.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Fallacies

    Some argument forms that look like rules of inferenceactually aren't. Sequences of proprositions that don'tcorrespond to tautologies are called fallacies.

    Example (A�rming the Conclusion)

    I If I eat too much I will have an upset stomach.I I have an upset stomach.

    Therefore, I ate too much.

    But maybe I didn't eat too much; maybe I have an ulcer.

    This example is based on the argument form

    p→ qq

    ∴ p

    This is not based on atautology, since if p is falseand q is true, the premisesare true while the conclusionis false.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Fallacies

    Example (Denying the Hypothesis)

    I If Maria sends out 100 resumes she will surelyget a job.

    I Maria sent out fewer than 100 resumes.Therefore, Maria didn't get a job.

    But maybe the �rst place to which Maria sent her resumehired her.

    This example is based on the argument form

    p→ q¬p

    ∴ ¬q

    This is not based on atautology, since if p is falseand q is true, the premisesare true while the conclusionis false.

  • Math 42,Discrete

    Mathematics

    Richard P.Kubelka

    San Jose StateUniversity

    Preliminaries

    PropositionalLogic

    Applications ofPropositionalLogic

    PropositionalEquivalences

    Predicates &Quanti�ers

    NestedQuanti�ers

    Rules ofInference

    Introduction toProofs

    c© R. P. Kubelka

    Fallacies

    RemarksI Given p→ q, a�rming the hypothesis to reach the

    conclusion�i.e., assuming p to conclude q�is a validr