Week 6 - Propositional Logic B

2.202 Logical implication

  • Logical Implication

    • Let pp and qq be propositions.
    • The conditional statement, or "implication pqp \rightarrow q" is the Proposition "if pp then qq".
      • We call pp the hypothesis (or antecedent or premise)
      • We call qq the conclusion (or consequence)
    • Example:

      • Let pp and qq be the following statements:
        • pp: "John did well in Discrete Mathematics."
        • qq: "John will do well in the programming course."
      • The conditional statement pqp \rightarrow q can be written as:
        • "If John did well in Discrete Maths then John will do well in programming."
      • Truth table for condition statement

        • If reasoning is correct (implication is true):
          • If the hypothesis is true then the conclusion is true
        • If reasoning is incorrect (implication is false):
          • if the hypothesis is true, the conclusion is false
        • it's always true that:
          • from a false hypothesis any conclusion can be implied (true or false)
        p q p -> q
        F F T
        F T T
        T F F
        T T T
    • Different expressions for pp

      • Let pp and qq be the following statements:
        • pp: it's sunny
        • qq: John goes to the park
      • pqp \rightarrow q
        • if pp then qq
        • if pp, qq
        • pp implies qq
        • pp only if qq
        • pp follows from qq
        • pp is sufficient for qq
        • qq unless ¬p\neg p
        • qq is necessary for pp
    • Converse, contrapositive and inverse
    • Let pp and qq be propositions and AA the conditional statement pqp \rightarrow q
    • The proposition qpq \rightarrow p is the converse of AA.
    • The proposition ¬p¬q\neg p \rightarrow \neg q is the contrapositive of AA
    • Example 1
      • Let pp and qq be the following statements:
        • pp: It's sunny.
        • qq: John goes to the park.
        • And AA the statement pqp \rightarrow q: "If it's sunny then John goes to the park"
      • The converse of A is: If John goes to the park then it's sunny.
      • The contrapositive of A is: If John doesn't go to the park, then it's not sunny.
    • Example 2
      • Let p and q be two propositions concerning an integer n
        • pp: n has one digit
        • qq: n is less than 10
      • Writing the statement using symbolic logic expression:
        • If the integer n has one digit then it is less than 10.
          • pqp \rightarrow q
      • Now write its contrapositive using both symbolic logic expression and English:
        • ¬q¬p\neg q \rightarrow \neg p
        • If n is greater than or equal to 10, then n has more than one digit.

3.204 Logical equivalence

  • Logical Equivalence
    • The biconditional or equivalence statement pqp \leftrightarrow q is the proposition: pqp \rightarrow q and qpq \rightarrow p
  • Equivalence properties ($\leftrightarrow$)
    • Biconditional statements are also called bi-implications.
    • pqp \leftrightarrow q can be read as "p if and only if q"
    • The biconditional statements is true when p and q have the same truth values, and is false otherwise.
pp qq pqp \rightarrow q qpq \rightarrow p (pqqp)(p \rightarrow q \land q \rightarrow p) equivalent
F F T T T
F T T F F
T F F T F
T T T T T
  • Equivalent propositions
    • Let pp and qq be propositions
    • pp and qq are logically equivalent if they always have the same truth value.
    • We write pqp \equiv q
    • The symbol \equiv is not a logical operator, and pqp \equiv q is not a compound proposition, but rather saying the statemnet that pqp \leftrightarrow q is always true.
  • Proving equivalence
    • To determine equivalence, we can use truth tables
    • Examples
      • Compare two propositions pqp \rightarrow q and ¬pq\neg p \lor q
      • The truth tables shows that ¬pq\neg p \lor q is equivalent to pqp \rightarrow q as they have the same truth values.
pp qq pqp \rightarrow q ¬p\neg p ¬pq\neg p \lor q
F F T T T
F T T T T
T F F F F
T T T F T
  • Proving non-equivalence
    • To determine equivalence, we can use truth tables and find at least one row where values differ.
    • Example
      • Let's examine whether the converse or the inverse of an implication is equivalent to the original implication.
pp qq ¬p\neg p ¬q\neg q pqp \rightarrow q ¬p¬q\neg p \rightarrow \neg q qpq \rightarrow p
F F T T T T T
F T T F T F F
T F F T F T T
T T F F T T T
  • Example
    • Let pp, qq and rr be the following propositions concerning an integer n:
      • pp: n = 20
      • qq: n is even
      • rr: n is positive
    • Let's express each of the following conditional statements symbolically:
      • if n=20n = 20 then nn is positive: prp \rightarrow r
      • n=20n = 20 if n is even: qpq \rightarrow p
      • n=20n = 20 only if n is even: pqp \rightarrow q
  • Precedence of logical operations
    • ¬\neg - 1
    • \land - 2
    • \lor - 3
    • \rightarrow - 4
    • \leftrightarrow - 5
  • Summary
    • definition of equivalence
    • equivalence properties
    • equivalent propositions
    • proving equivalence
    • proving non-equivalence
    • precedence of logical operations

3.206 Laws of prospositional logic

  • Laws of Propositional Logic

    • Propositional logic is an algebra involving multiple laws. These are some of the laws:
    Disjunction Conjunction
    idempotent laws pppp \lor p \equiv p pppp \land p \equiv p
    commutative laws pqqpp \lor q \equiv q \lor p pqqpp \land q \equiv q \land p
    associative laws (pq)rp(qr)(p \lor q) \land r \equiv p \lor (q \lor r) (pq)rp(qr)(p \land q) \land r \equiv p \land ( q \land r)
    distributive laws p(qr)(pq)(pr)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r) p(qr)(pq)(pr)p \lor (q \lor r) \equiv (p \land q) \lor (p \land r)
    identity laws pFpp \lor \mathbf{F} \equiv p pTpp \land \mathbf{T} \equiv p
    domination laws pTTp \lor \mathbf{T} \equiv \mathbf{T} pFFp \land \mathbf{F} \equiv \mathbf{F}
    • Example

      distributive-law-truth-table

    • Laws of propositional logic 2

      equivalence-table

  • Equivalence Proof

    • Example the equivalence between ¬(p(¬pq))\neg (p \land (\neg p \lor q)) and (¬p¬q)(\neg p \lor \neg q)
    • ¬(p(¬pq))\neg (p \land (\neg p \lor q)) - given proposition
    • ¬p¬(¬pq)\neg p \lor \neg (\neg p \lor q) - De Morgan's law
    • ¬p((¬¬p)¬q)\neg p \lor ((\neg \neg p) \land \neg q) - De Morgan's law
    • ¬p(p¬q)\neg p \lor (p \land \neg q) - double negation law
    • (¬pp)(¬p¬q)(\neg p \lor p) \land (\neg p \lor \neg q) - distributive laws
    • T(¬p¬q)T \land (\neg p \lor \neg q) - complement laws

Problem Sheet

Question 1

Which of the following statements are propositions?

  • *$2 + 2 = 4$ - is proposition
  • 2 + 2 = 5 is proposition
  • w2+2=11w^2 + 2 = 11 - is not a proposition,as value depends on the value of x
  • x+y>0x + y > 0 - is not a proposition, as value depends on x and y.
  • "This coffee is strong" - is not a proposition. It is subjective, not true or false.

Question 2. Let ss and ii be the following propositions:

  • ss - "stocks are increasing"
  • ii - "interest rates are steady"
  • Write each of the following sentences symbolically:
  • Stocks are increasing but interest rates are steady. sis \land i
  • Neither are stocks increasing nor are interest rates steady.

¬s¬i=¬(si)\neg s \land \neg i = \neg (s \land i)

Question 3.

Let hh, ss and rr be the following 3 propositions:

h: it is hot. s: it is sunny. r: it is raining.

  1. It is not hot but it is sunny.

¬hs\neg h \land s

  1. It is neither hot nor sunny

¬(hs)\neg (h \lor s)

  1. It is either hot and sunny or it is raining

(hs)r(h \land s) \lor r

  1. It is sunny or it is raining but not both

srs \oplus r

Question 4.

Let l denote one of the letters in the word "software". The following propositions relate to ll

p: "l is a vowel". q: "l comes after the letter k in the alphabet".

Use the listing method to specify the truth sets corresponding to each of the following statements:

pp: {o,a,e}\{o, a, e\} qq: {s,o,t,w,r}\{s, o, t, w, r\} ¬p\neg p: {s,f,t,w,r,o}\{s, f, t, w, r, o\}

  • ¬q\neg q = {f, a, e}
  • p¬qp \land \neg q = {a, e}
  • ¬pq\neg p \lor q = {s, o, f, t, w, r}

Question 5.

Let pp and qq be 2 propositions. Construct a truth table to show the truth value of each of the following logical statements:

p q pqp \lor q ¬p\neg p ¬q\neg q ¬p¬q\neg p \lor \neg q pqp \land q ¬(pq)\neg (p \land q)
T F T F T T F T
T T T F F F T F
F T T T F T F T
F F F T T T F T

We can see that ¬p¬q\neg p \lor \neg q and ¬(pq)\neg (p \land q) are equivalent statements (using De Morgan's Law).

Question 6.

Let hh, ss, and pp be the following 3 propositions:

hh: it is hot ss: it is sunny rr: it is raining

  1. It is sunny or it is raining but not both.

    hrh \oplus r

  2. It is hot only if it is sunny.

    hsh \rightarrow s

  3. It is hot only if it is sunny and not raining.

    h(s¬r)h \rightarrow (s \land \neg r)

Question 7.

Let pp, qq be propositions. Construct a truth table to show the truth value of each of the statements:

  • *$p \rightarrow q$
  • ¬pq\neg p \land q
  • ¬q¬p\neg q \rightarrow \neg p
p q not p not q if p then q not p or q if not q then not p
T F F T F F F
T T F F T T T
F T T F T T T
F F T T T T T

pq=¬pq=¬q¬pp \rightarrow q = \neg p \lor q = \neg q \rightarrow \neg p

¬q¬p\neg q \rightarrow \neg p is the contrapositive of pqp \rightarrow q

Question 8.

Let p and q be the following propositions concerning a positive integer nn

p: n is divisible by 5. q: n is even.

  1. Express in words the following statements:

p¬qp \lor \neg q

n is divisble by 5 or n is odd.

pqp \land q

n is divisible by 5 and n is even.

  1. List the elemenst of the truth sets corresponding to each of the statements in (1).

{1,3,5,7,9,10,11,13...}\{1, 3, 5, 7, 9, 10, 11, 13 ...\} {10,20,30,...}\{10, 20, 30, ...\}

  1. Express each of the following conditional statements symbolically.

if n is odd then n is divisible by 5.

¬qp\neg q \rightarrow p

n is even or n is divisible by 5 but not both.

qpq \oplus p

Question 9.

Let pp and qq be two propositions. Show that p¬(pq)p \lor \neg (p \land q) is a tautology.

  • p¬(pq)p \lor \neg (p \land q) -- original expression
  • p¬p¬qp \lor \neg p \lor \neg q -- De Morgan's law
  • p¬p=Tp \lor \neg p = T = T¬qT \land \neg q = T

Question 10.

Complete the following table by showing the truth value of each: pp, qq, pqp \rightarrow q, qpq \rightarrow p, pqp \leftrightarrow q

p q pqp \rightarrow q qpq \rightarrow p pqp \leftrightarrow q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1

Question 11.

What is the inverse, the converse and the contraposition of the following statement:

If it is November 5th then we have fireworks.

p: is it November 5th q: we have fireworks

Inverse

¬p¬q\neg p \rightarrow \neg q

If it's not November 5th then we don't have fireworks.

Converse

qpq \rightarrow p

If we have fireworks then it is November 5th

Contrapositive

¬q¬p\neg q \rightarrow \neg p

If we don't have fireworks then it's not November 5th.

Question 12.

Let p denote the following statement about integers n:

If n is divisible by 15, then it is divisible by 3 or divisible by 5.

Write the inverse, the converse and the contrapositive of p.

p: if n is divisible by 15, then it is divisble by 3 or divisible by 5.

s: divisible by 15 q: divisible by 3 r: divisble by 5

s(qr)s \rightarrow (q \lor r)

Inverse:

¬s¬(qr)\neg s \rightarrow \neg (q \lor r)

If n is not divisible by 15, then it is not divisible by either 3 or 5.

Converse:

(qr)s(q \lor r) \rightarrow s

If n is divisble by either 3 or 5, then n is divisble by 15.

Contrapositive:

¬(qr)¬s\neg (q \lor r) \rightarrow \neg s

If n is not divisble by either 3 or 5 then n is not divisible by 15.

Question 13.

Let p and q be two propositions. Show by constructing the truth table or otherwise that the following statements are equivalent:

pqp \lor q and ¬\neg