2 1. PropositionsA proposition is a sentence that is either true or false.ExamplesThe Moon is made of green cheese.Bangkok is the capital of Thailand.1 + 0 = 10 + 0 = 2Examples that are not propositions:Sit down!What time is it?x + 1 = 2x + y = z
3 Propositional variables: p, q, r, s, … A proposition that is always true = TA proposition that is always false = FLogical connectives (operators):Negation ¬Conjunction ∧ Disjunction ∨Implication → Biconditional ↔Compound Propositions are built from logical operators and smaller propositions:p ∧ q (p ∨ q) → s
4 2. Negation (not, ¬)The negation of p is ¬p and has the truth table:Example: If p is “The earth is round”, then ¬p is “The earth is not round”p¬pTF
5 Venn Diagram for ¬ Draw p as a set inside the universal domain U. So ¬p is true in the gray area:UP
6 3. Conjunction (and, ∧) The conjunction of p and q is p ∧ q Example: If p is “I am at home” and q is “It is raining” then p ∧q is “I am at home and it is raining”pqp ∧ qTF
7 Venn Diagram for ∧Represent p and q as sets. p ∧ q is true in the gray area:
8 4. Disjunction (or, ∨) The disjunction of p and q is p ∨q Example: If p is “I am at home” and q is “It is raining” then p ∨q is “I am at home or it is raining”pqp ∨qTF
9 Venn Diagram for ∨Represent p and q as sets. p ∨ q is true in the gray area:Note, that ∨ has a bigger true area than ∧
10 5. Implication (if-then, →) p →q is an implication which can be read as “if p then q ”Example: If p is “I am at home” and q is “It is raining” then p →q is “If I am at home then it is raining”pqp →qTF
11 Logical Jargon for p →qp can be called the hypothesis (or antecedent or premise)q can be called the conclusion (or consequent)
12 Many Ways of Saying p →qif p then q p implies q p only if q q unless ¬p q when p q if p q whenever p p is sufficient for q q follows from p q is necessary for pVery confusing, and if-then is extra confusing because it is NOT the same as a programming if-then or English if-then
13 → Confusion when p = FThe following implications are true (i.e p → q is T) but make no sense as English“If the moon is made of green cheese then I have more money than Bill Gates. ”“If = 3 then my grandmother is old”p = Fq = Fp = Fq = T
14 Two Ways to Avoid Confusion Do not think of p → q as if-then.Instead:1. Translate → into simpler logical connectives (usually ¬ and ∨).or2. Draw a venn diagram
15 p → q is the same as ¬p ∨ qThere are many other ways of rewriting →, but memorize this one.
16 Venn Diagram of p → q as ¬p ∨ q The easiest way of drawing a Venn diagram for → is to use ¬p ∨ q. It is true in the gray area:12is like34
17 Example p = "it is raining"; q = " I have an umbrella" Being able to draw a dotmeans p q is truefor this case.p = "it is raining"; q = " I have an umbrella"There are four cases to draw:It is raining and I have an umbrellaIt is raining and I do not have an umbrellaIt is not raining and I have an umbrellaIt not is raining and I do not have an umbrellaNo example, so p q is falsefor this case
18 6. Converse, Inverse, Contrapositive More uses of , with special names:q →p is the converse of p →q¬ p → ¬ q is the inverse of p →q¬q → ¬ p is the contrapositive of p →quseful later
19 Examples “If it is sunny then I go shopping” (p q) Converse: If I go shopping then it is sunnyContrapositive: If I do not go shopping, then it is not sunnyInverse: If it is not sunny, then I do not go shopping.
20 7. Biconditional (iff, ↔)The biconditional p ↔q is read as “p if and only if q ” or "p iff q"True when p and q have the same value.If p is “I am at home.” and q is “It is raining.” then p ↔q is “I am at home if and only if it is raining.”pqp ↔qTF
21 Also known as Equivalence () p q is true when p and q have the same value.Also called logical equality. is used when defining equivalences between propositional statements (see section 10 and later).
22 8. Tautologies, Contradictions A tautology is a proposition which is always true.Example: p ∨¬pA contradiction is a proposition which is always false.Example: p ∧¬pp¬pp ∨¬pp ∧¬pTF
23 9. Bigger Truth TablesA truth table forpqrrp qp q → rTF
24 Truth Tables do not Scale Up How many rows are there in a truth table with n propositional variables?2n (true and false cases for each variable)Truth tables cannot easily be written for more complex propositions.
25 10. Proving Equivalences We can prove equivalences using truth tables. Example: is ¬(p ∧ q) ¬p ∨ ¬q ?lhs rhsTTTTyes, the same
26 Example: is ¬(p ∧ q) ¬p ∧ ¬q ? lhs rhsTFFTno, not the same
27 De Morgan’s LawsAugustus De MorganThis truth table shows that De Morgan’s Second Law holds.pq¬p¬q(p∨q)¬(p∨q)¬p∧¬qTFthe same
28 Implication and contrapositive are equivalent. Also, converse and inverse are equivalentthe samethe same
29 Equivalence is Very Useful If we have:complicated proposition simple propositionThen we can replace the complex one with the simple one.Equivalence is also useful for replacing logical operators.See the circuit examples in the next section.
30 Proving Equivalences with Truth Tables We can prove equivalences using truth tables but tables become very big for complex propositions.We need a different technique for proving the equivalence of larger propositions.rewrites; see section 13
31 11. Logic CircuitsElectronic circuits; each input/output signal can be viewed as a 0 or 1.0 represents False1 represents TrueComplicated circuits are constructed from three basic circuits called gates.The inverter (NOT gate) takes an input bit and produces the negation of that bit.The OR gate takes two input bits and produces the value equivalent to the disjunction of the two bits.The AND gate takes two input bits and produces the value equivalent to the conjunction of the two bits.continued
32 More complicated digital circuits can be constructed by combining these basic circuits . For example:
33 Simplifying Circuits Simplify circuits (i.e. use less gates), by using equivalences.ppqandnotqornot¬(p ∧ q) ¬p ∨ ¬qTwo gates compared to three gates; different gates; less wiring
34 ppqorandp ∨ (p ∧ q) pZero gates compared to two gates; less wiring
37 13. Equivalence Proofs Using Rewrites To prove that , we produce a series of equivalences beginning with A and ending with B.Each line rewrites the left-hand side (lhs) to the right-hand side (rhs) by using the logic equivalences from section 12.A1 A2