Title: Logic of Compound Statements
1Logic of Compound Statements
- Introductory Discrete Mathematics (CS/MAT165)
2Compound Statements
- Logical Form and Logical Equivalence
- Conditional Statements
- Valid and Invalid Arguments
- Application Digital Logic Circuits
3Boolean Operations
- Logical
- Combines logical expressions
- Arguments must be logical
- Relational
- Compares logical expressions
- Arguments must be comparable
4Logical Operations
5Truth Tables
Or
And
Not
6Relational Operations
- Greater than a b
- Less than a
- Equal to a b
- Not greater than a b (also a ? b)
- Not less than a
- Not equal to a ? b
7Logical Form and Logical Equivalence
- Argument
- A sequence of statements (premise) aimed at
demonstrating the truth of an assertion
(conclusion). - Example
- Premise If a fruit is a cherry, then its red.
- Conclusion Therefore, if a fruit is not red,
then its not a cherry.
8Logical Form and Logical Equivalence
- Premise a ? b (if a then b)
- Conclusion b ? a (If not b then not a)
- or maybe
- Premise a ? b
- Conclusion b ? a
- Is This True?
9Logical Equivalence
- Two expressions are said to be logically
equivalent when the first is true if and only if
the second is true - Examples
- (p) ? p (double negative)
- a ? b ? b ? a (commutative property)
- (a ? b) ? c ? a ? (b ? c) (associative
property)
10De Morgans Laws
- (p ? q) ? p ? q
- (p ? q) ? p ? q
Augustus De Morgan (1806-1871)
11Tautological Statements Contradictions
- Tautological Statement
- Always true regardless of the values of its
variables - Example
- p ? p
- Contradiction
- Always false regardless of the values of its
variables - Example
- p ? p
12Study!
- Theorem 1.1.1Logical Equivalencespage 14
13Conditional Statements
14Logical EquivalencesDivision Into Cases
- p ? q ? r ? (p ? r) ? (q ? r)
- Think about it!
- It makes sense!
15Representing If-Then as Or
- p ? q ? p ? q
- How could you prove this?
- Do this!
- Create a truth table for both sides of the
equivalence
16Negation
- (p ? q) ? p ? q
- Okay, truth tables (again)
17Contrapositive
- p ? q ? q ? p
- Truth tables (one more time)
18Converse / Inverse
- Given
- p ? q
- Converse
- q ? p
- Inverse
- p ? q
19Valid and Invalid Arguments
- Argument
- p ? q ? rq ? p ? r? p ? r (Read therefore p
implies r) - This is invalid!
- Why?
- How would you mathematically show its invalid?
20Valid and Invalid Arguments
- p ? q ? r
- q ? p ? r
- ? p ? r
- First, rewrite (i)(p ? q) ? (p ? r)
- Substitute (ii) into (i) (p ? p ? r) ? (p ? r)
- Rewrite (p ? r) ? (p ? r)
- Set this equal to (iii) (p ? r) ? (p ? r) p ?
r - Simplify p ? r p ? r
- This is false, therefore the original argument is
invalid
21Modus Ponens Modus Tollens
- Syllogism
- An argument with two premises and a conclusion
- Modus ponens
- If p then qp ? q
- Modus tollens
- If p then q
- q
- ? p
22Rules of Inference
23Rules of Inference
24ProblemHow to Reason With a Robot
- You might try the ploy successfully used by Mr.
Spock on the malevolent android 'Norman' (Star
Trek), wherein he posed the following to Norman
"Everything I say is a lie. I'm a liar". Norman
self-fried. - Can you prove what Spock said is invalid?
25Knights and Knaves
- On a fictional island, all inhabitants are either
knights, who always tell the truth, or knaves,
who always lie. The puzzles involve a visitor to
the island who meets small groups of inhabitants.
Usually the aim is for the visitor to deduce the
inhabitants' type from their statements, but some
puzzles of this type ask for other facts to be
deduced. The puzzle may also be to determine a
yes/no question which the visitor can ask in
order to discover what he needs to know.
Raymond Smullyan (b1919)
26Knights and KnavesQuestion 1
- John and Bill are residents of the island of
knights and knaves. - John says We are both knaves.
- Who is who?
Raymond Smullyan (b1919)
27Knights and KnavesQuestion 2
- John If Bill is a knave then I'm a knight.
- Bill We are different.
- Who is who?
Raymond Smullyan (b1919)
28Knights and KnavesQuestion 3
- Logician Are you both knights?
- John answers either Yes or No, but the Logician
does not have enough information to solve the
problem. - Logician Are you both knaves?
- Bill answers either Yes or No, and the Logician
can now solve the problem. - Who is who?
Raymond Smullyan (b1919)
29Knights and KnavesQuestion 4
- Here is a rendition of perhaps the most famous of
this type of puzzle - John and Bill are standing at a fork in the road.
You know that one of them is a knight and the
other a knave, but you don't know which. You also
know that one road leads to Someplace, and the
other leads to Nowhere. - By asking one yes/no question, can you determine
the road to Someplace? - By asking one yes/no question, can you determine
whether John is a knight? - This version of the puzzle was further
popularized by a scene in the 1980's fantasy
film, Labyrinth, in which Sarah (Jennifer
Connelly) finds herself faced with two doors each
guided by a two-headed knight. One door leads to
the castle at the centre of the labyrinth, and
one to certain doom.
Raymond Smullyan (b1919)
30Digital Logic Circuits
- Time to use the computers!