Chapter 2 Logic of Compound statements
Statement :
Definition: A statement (or proposition) is a sentence that is true or false but not both.
Propositional logic deals with statements and their truth value
Logic:
Definition :The study of formal reasoning based upon statements (or propositions)
Logic :
◼ Defines a formal language for representing knowledge and for making logical inferences
◼ Helps us to understand how to construct a valid argument
Argument:
Definition :A sequence of statements aimed at demonstrating the truth of an assertion
◼ An argument consists of a sequence of statements called premises and a conclusion
◼ An argument is valid if the conclusion is true whenever the premises are all true
Compound Statements:
Compound statements are constructed from logical connectives and other propositions
Negation
Definition :
◼ If p is a statement variable, the negation of p is “not p” or “It is not the case that p” and is denoted ∼p
◼ It has opposite truth value from p
if p is true, ∼p is false; if p is false, ∼p is true
Truth table:
P | ~P |
T | F |
F | T |
Conjunction :
Definition :If p and q are statement variables, the conjunction of p and q is “p and q,” denoted p ∧ q
Truth table:
p | q | p ∧ q |
T | T | T |
T | F | F |
F | T | F |
F | F | F |
Disjunction :
Definition: If p and q are statement variables, the disjunction of p and q is “p or q,” denoted p ∨ q
Truth table:
p | q | p ∨ q |
T | T | T |
T | F | T |
F | T | T |
F | F | F |
Exclusive Or:
Definition: If p and q are statement variables, "p exclusive or q" denoted by p ⊕ q is true when exactly one of p and q is true and it is false otherwise
Truth table :
p | q | p ⊕ q |
T | T | F |
T | F | T |
F | T | T |
F | F | F |
English words of p ⊕ q :
◼ p or q but not both
◼ p or q and not both p and q
Truth table:
p | q | p ∨ q | p ∧ q | ~(p ∧ q) | (p ∨ q)∧~(p ∧ q) |
T | T | T | T | F | F |
T | F | T | F | T | T |
F | T | T | F | T | T |
F | F | F | F | T | F |
Logical Equivalence :
Definition :
◼ Two statement forms are called logically equivalent if, and only if, they have identical truth values
◼ The logical equivalence of statement forms P and Q is denoted by writing P ≡ Q
De Morgan’s Law:
Definition :
◼ The negation of and statement is logically equivalent to or statement in which each component is negated
◼ The negation of or statement is logically equivalent to and statement in which each component is negated
Truth table:
p | q | ~p | ~q | p ∧ q | ~(p ∧ q) | ~p∨~q |
T | T | F | F | T | F | F |
T | F | F | T | F | T | T |
F | T | T | F | F | T | T |
F | F | T | T | F | T | T |
Tautologies and Contradictions :
Definition :
◼ A tautology is statement form that is always true regardless of the truth values of individual statements
◼ A contradiction is statement form that is always false regardless of the truth values of the individual
statements
If t is a tautology and c is a contradiction, then p ∧ t ≡ p and p ∧ c ≡ c
Logical Equivalence:
Commutative laws | p ∧ q ≡ q ∧ p | p ∨ q ≡ q ∨ p |
Associative laws | (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) | (p ∨ q) ∨ r ≡ p ∨ (q ∨ r ) |
Distributive laws | p ∧ (q ∨ r ) ≡ (p ∧ q) ∨ (p ∧ r ) | p ∨ (q ∧ r ) ≡ (p ∨ q) ∧ (p ∨ r ) |
Identity laws | p ∧ t ≡ p | p ∨ c ≡ p |
Negation laws | p ∨ ∼p ≡ t | p ∧ ∼p ≡ c |
Double negative law | ∼(∼p) ≡ p | ∼(∼p) ≡ p |
Idempotent laws | p ∧ p ≡ p | p ∧ p ≡ p |
Universal bound laws | p ∨ t ≡ t | p ∧ c ≡ c |
De Morgan’s laws | ∼(p ∧ q) ≡ ∼p ∨ ∼q | ∼(p ∨ q) ≡ ∼p ∧ ∼q |
Absorption laws | p ∨ (p ∧ q) ≡ p | p ∧ (p ∨ q) ≡ p |
Negations of t and c | ∼t ≡ c | ∼c ≡ t |
Conditional (Implication) :
Definition:
◼ If p and q are statement variables, the conditional of q by p is “If p then q” or “p implies q” and is denoted p →q
◼ It is false when p is true and q is false; otherwise it is true We call p the hypothesis (or antecedent or premise) of the conditional and q the conclusion (or consequence)
Truth table:
p | q | p → q |
T | T | T |
T | F | F |
F | T | T |
F | F | T |
A conditional statement that is true by virtue of the fact that its hypothesis is false is often called vacuously true or true by default
Expression of p → q :
Logical equivalence:
(p ∨ q) → r ≡ (p → r) ∧ (q → r)
Conditional Statement | (p ∨ q) → r ≡ (p → r) ∧ (q → r) |
If-Then As Or | p → q ≡ ~p ∨ q |
Negation of If-then | ~(p → q) ≡ p ∧ ~q |
Converse and Inverse:
Definition:
◼ The converse of p →q is q → p
◼ The inverse of p →q is ~p → ~q
Contrapositive :
Definition :
The contrapositive of a conditional statement "If p then q"is lf ~q then ~p
Symbolically the contrapositive of p →q is ~q →~p
A condition statement is logically equivalent to its contrapositive
Only If and If-Then :
Meaning of “only if” :
◼ “p only if q” means “if not q then not p”
◼ Equivalently “if p then q”
Biconditional :
Definitation :
◼ Biconditional of p and q is “p if and only if q” and is denoted p ↔ q
◼ It is true if both p and q have the same truth values and is false if p and q have opposite truth values
◼ if and only if are abbreviated iff
Meaning :
◼ (p → q) ∧ (q → p)
◼ q → p can be written “p if q” and p → q can be written “p only if q”
◼ p ↔ q means “p if q and p only if q”
◼ Often written “p if and only if q”
Truth table:
p | p | p ↔ q |
T | T | T |
T | F | F |
F | T | F |
F | F | T |
Sufficient and Necessary conditions :
Definition :
◼ r is a sufficient condition for s means “if r then s”
◼ r is a necessary condition for s means “if not r then not s” also “if s then r”
◼ r is a necessary and sufficient condition for s means “r if and only if s''
Argument :
Definition :
◼ An argument is a sequence of statements
◼ An argument form is a sequence of statement forms
Valid Argument Form :
Definition:
◼ An argument form consisting of two premises and a conclusion is called a syllogism
Proof by Contradiction :
反证法
Fallacies :
A fallacy is an error in reasoning that results in an invalid argument
Three common fallacies:
Vague or ambiguous premises
Circular reasoning
Jumping to conclusions
Converse Error:
◼ Form: p → q
q
∴ p
Inverse Error:
◼ Form: p → q
~p
∴ ~q
Definitation:
◼ An argument is called sound if and only if, it is valid and all its premises are true
◼ An argument that is not sound is called unsound
Valid Argument Forms :
Boolean Expression for Circuit :
Recognizer is a circuit that outputs a 1 for exactly one particular combination of input signals and outputs 0’s for all other combinations