Home /uol-discrete-mathematics

Week 6 - Propositional Logic B

2.202 Logical implication

  • Logical Implication

    • Let pp and qq be propositions.
    • The conditional statement, or "implication p→qp \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 p→qp \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
      • p→qp \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 p→qp \rightarrow q
    • The proposition q→pq \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 p→qp \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.
          • p→qp \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 p↔qp \leftrightarrow q is the proposition: p→qp \rightarrow q and q→pq \rightarrow p
  • Equivalence properties ($\leftrightarrow$)
    • Biconditional statements are also called bi-implications.
    • p↔qp \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 p→qp \rightarrow q q→pq \rightarrow p (p→q∧q→p)(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 p≡qp \equiv q
    • The symbol ≡\equiv is not a logical operator, and p≡qp \equiv q is not a compound proposition, but rather saying the statemnet that p↔qp \leftrightarrow q is always true.
  • Proving equivalence
    • To determine equivalence, we can use truth tables
    • Examples
      • Compare two propositions p→qp \rightarrow q and ¬p∨q\neg p \lor q
      • The truth tables shows that ¬p∨q\neg p \lor q is equivalent to p→qp \rightarrow q as they have the same truth values.
pp qq p→qp \rightarrow q ¬p\neg p ¬p∨q\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 p→qp \rightarrow q ¬p→¬q\neg p \rightarrow \neg q q→pq \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: p→rp \rightarrow r
      • n=20n = 20 if n is even: q→pq \rightarrow p
      • n=20n = 20 only if n is even: p→qp \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 Logic

    • Propositional logic is an algebra involving multiple laws. These are some of the laws:
    Disjunction Conjunction
    idempotent laws p∨p≡pp \lor p \equiv p p∧p≡pp \land p \equiv p
    commutative laws p∨q≡q∨pp \lor q \equiv q \lor p p∧q≡q∧pp \land q \equiv q \land p
    associative laws (p∨q)∧r≡p∨(q∨r)(p \lor q) \land r \equiv p \lor (q \lor r) (p∧q)∧r≡p∧(q∧r)(p \land q) \land r \equiv p \land ( q \land r)
    distributive laws p∨(q∧r)≡(p∨q)∧(p∨r)p \lor (q \land r) \equiv (p \lor q) \land (p \lor r) p∨(q∨r)≡(p∧q)∨(p∧r)p \lor (q \lor r) \equiv (p \land q) \lor (p \land r)
    identity laws p∨F≡pp \lor \mathbf{F} \equiv p p∧T≡pp \land \mathbf{T} \equiv p
    domination laws p∨T≡Tp \lor \mathbf{T} \equiv \mathbf{T} p∧F≡Fp \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∧(¬p∨q))\neg (p \land (\neg p \lor q)) and (¬p∨¬q)(\neg p \lor \neg q)
    • ¬(p∧(¬p∨q))\neg (p \land (\neg p \lor q)) - given proposition
    • ¬p∨¬(¬p∨q)\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
    • (¬p∨p)∧(¬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. s∧is \land i
  • Neither are stocks increasing nor are interest rates steady.

¬s∧¬i=¬(s∧i)\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.

¬h∧s\neg h \land s

  1. It is neither hot nor sunny

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

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

(h∧s)∨r(h \land s) \lor r

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

s⊕rs \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}
  • ¬p∨q\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 p∨qp \lor q ¬p\neg p ¬q\neg q ¬p∨¬q\neg p \lor \neg q p∧qp \land q ¬(p∧q)\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 ¬(p∧q)\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.

    h⊕rh \oplus r

  2. It is hot only if it is sunny.

    h→sh \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$
  • ¬p∧q\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

p→q=¬p∨q=¬q→¬pp \rightarrow q = \neg p \lor q = \neg q \rightarrow \neg p

¬q→¬p\neg q \rightarrow \neg p is the contrapositive of p→qp \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.

p∧qp \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.

¬q→p\neg q \rightarrow p

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

q⊕pq \oplus p

Question 9.

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

  • p∨¬(p∧q)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, p→qp \rightarrow q, q→pq \rightarrow p, p↔qp \leftrightarrow q

p q p→qp \rightarrow q q→pq \rightarrow p p↔qp \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

q→pq \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→(q∨r)s \rightarrow (q \lor r)

Inverse:

¬s→¬(q∨r)\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:

(q∨r)→s(q \lor r) \rightarrow s

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

Contrapositive:

¬(q∨r)→¬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:

p∨qp \lor q and ¬\neg