Mada za sehemu hiiLogicMada 5
A negation is a sentence which has an opposite truth value to the given one.
One way of forming a negation is to put the word "not" with a verb.
Example: 6 is divisible by 3
6 is not divisible by 3
It is not true that 6 is divisible by 3
It is false that 6 is divisible by 3
Given a statement P, its negation is denoted ∼P
The complement of ∼P is P
Truth table for negation
| P | ~P |
|---|---|
| T | F |
| F | T |
Another word used to combine sentences is the word "or".
Consider the sentence
i) 43<3 ii) 5>3
Combining them with the word "or" i.e. 43<3 or 5>3
The connective word "or" is called a disjunction and is symbolized by "∨"
The truth value for disjunction is only false when both the components are false.
If P and Q are statements, then P or Q is symbolized as P∨Q
P∨Q has a truth value false in one case when both P and Q are false.
Truth table for disjunction
| P | Q | P ∨ Q |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
These are statements of the form "if……..then……"
Example. If a quadrilateral is a parallelogram then the pair of opposite sides are parallel.
The phrase "a quadrilateral is a parallelogram" is called hypothesis or antecedent.
The phrase "the pair of opposite sides are parallel" is called a conclusion or consequent.
If P= hypothesis
Q= conclusion
Then the statement if P then Q is an implication, in short we write P→Q
Consider the statement
If 43<3 then 5>3 T
If 43<3 then 5<3 T If hypothesis is T and conclusion is F 43>3 then 5<3 F then the implication is T
Note: The compound statement P→Q is false only in one case P is true and Q is false.
Truth table for P→Q
| P | Q | P → Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
Propositions which carry the same meaning as if P then Q
- If P, Q
- Q if P
- Q provided that P
- P only if Q
- P is a sufficient condition for Q
- Q is a necessary condition for P
-
Determine the truth values of the following
-
If 2<3 then 2+3=5 T
-
If 3<2 then 3+2=5 T
-
If 2+3=5 then 3<2 F
-
If 2+1=2 then 1=0 T
-
Find the components of the following compound
i) If 3<5 then 10+m=9
- 3<5
- 10+m=9
ii) a+b=c+d only if p+q=r2
- a+b=c+d
- p+q=r2
iii) If Galileo was born before Descartes then Newton was born before Shakespeare
-
Galileo was born before Descartes
-
Newton was born before Shakespeare
-
Write a truth table for
i) (P∧Q)∨(P∨Q) ii) (P→Q)∧P iii) ((P→Q)→Q)
Solutions
i) (P∧Q)∨(P∨Q)
| P | Q | P ∧ Q | P ∨ Q | (P ∧ Q) ∨ (P ∨ Q) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | T |
| F | T | F | T | T |
| F | F | F | F | F |
ii) (P→Q)∧P
| P | Q | P → Q | (P → Q) ∧ P |
|---|---|---|---|
| T | T | T | T |
| T | F | F | F |
| F | T | T | F |
| F | F | F | F |
iii) ((P→Q)→Q)
| P | Q | P → Q | (P → Q) → Q |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | T | T |
| F | F | T | F |
Consider the truth table for (P→Q)∧(Q→P)
| P | Q | P → Q | Q → P | (P → Q) ∧ (Q → P) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | F |
| F | T | T | F | F |
| F | F | T | T | T |
The statement (P→Q)∧(Q→P) is known as biconditional statement and is abbreviated as P↔Q
Truth table for P↔Q
| P | Q | P ↔ Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
Note: P↔Q is read P if and only if Q
P↔Q is true when both P and Q are true or when P and Q are false.
Example. The truth value of 43>3 if and only if 5<3 (F)
43<3 if and only if 3<5 (F)
43<3 if and only if 5<3 (T)
43>3 if and only if 5>3 (T)
Given a proposition: if a quadrilateral is a parallelogram then its opposite sides are parallel, P→Q
Converse: If the opposite sides are parallel, then the quadrilateral is a parallelogram i.e. Q→P.
Contrapositive: If the opposite sides are not parallel, then the quadrilateral is not a parallelogram. i.e. ∼Q→∼P
Inverse: if a quadrilateral is not a parallelogram, then the opposite sides are not parallel i.e. ∼P→∼Q
Truth table for implication, converse, contrapositive, inverse
| P | Q | P → Q | Q → P | ~ P | ~ Q | ~ Q → ~P | ~P → ~ Q |
|---|---|---|---|---|---|---|---|
| T | T | T | T | F | F | T | T |
| T | F | F | T | F | T | F | T |
| F | T | T | F | T | F | T | F |
| F | F | T | T | T | T | T | T |
Column 3 has exactly truth value as column 7
i.e. P→Q≡∼Q→∼P
Q→P≡∼P→∼Q
Two propositions are logically equivalent if they have exactly the same truth values.
E.g. P∨Q and Q∨P are logically equivalent.
Solution: Draw truth for P∨Q and Q∨P
| P | Q | P ∨ Q | Q ∨ P |
|---|---|---|---|
| T | T | T | T |
| T | F | T | T |
| F | T | T | T |
| F | F | F | F |
Since column 3 has exactly the same truth values as column 4 then
P∨Q≡Q∨P
Questions
Show whether or not the following propositions are logically equivalent
i) P→Q, ∼P∨Q
| P | Q | P → Q | ~ P | ~ P ∨ Q |
|---|---|---|---|---|
| T | T | T | F | T |
| T | F | F | F | F |
| F | T | T | T | T |
| F | F | T | T | T |
Since column 3 and 5 have exactly the same truth value therefore
P→Q≡∼P∨Q
ii) P→(P∨Q); P→Q
| P | Q | P ∨ Q | P → (P ∨ Q) | p → Q |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | T | T | F |
| F | T | T | T | T |
| F | F | F | T | T |
Since column 4 does not have exactly same truth value as column 5 then P→(P∨Q)≡P→Q
iii) P→Q: ∼P→Q
| P | Q | P → Q | ~ P | ~ P → Q |
|---|---|---|---|---|
| T | T | T | F | T |
| T | F | F | F | T |
| F | T | T | T | T |
| F | F | T | T | F |
Since column 3 does not have exactly same truth values as column 5 therefore
P→Q≡∼P→Q
iv) P→Q; Q→P
| P | Q | P → Q | Q → P |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | T | F |
| F | F | T | T |
Since column 3 does not have exactly same truth values as column 4 therefore P→Q≡Q→P
v) ∼(P→Q); P∨∼Q
| P | Q | ~ Q | P → Q | ~ (P → Q) | P ∨ ~Q |
|---|---|---|---|---|---|
| T | T | F | T | F | T |
| T | F | T | F | T | T |
| F | T | F | T | F | F |
| F | F | T | T | F | T |
Since column 5 does not have exactly same truth value as column 6 therefore ∼(P→Q)≡P∨∼Q
vi) ∼(P∨Q); ∼P∧∼Q
| P | Q | ~ P | ~ Q | P ∨ Q | ~ (P ∨ Q) | ~P ∧ ~Q |
|---|---|---|---|---|---|---|
| T | T | F | F | T | F | F |
| T | F | F | T | T | F | F |
| F | T | T | F | T | F | F |
| F | F | T | T | F | T | T |
Since column 6 has exact same truth values as column 7 therefore ∼(P∨Q)≡∼P∧∼Q
Compound statements with three components P, Q, R.
Consider the following compound statement,
Triangles have all three sides and either the area of a circular region of radius r is πr2 or it is false that the diagonals of a parallelogram do not meet.
Solution
(To symbolize the above statement)
Let P= triangles have three sides
Let Q= circular region of radius r is πr2
Let R= diagonals of parallelogram do not meet
P∧(Q∨∼R)
To find the truth values of the above statement
| P | Q | R | ~ R | Q ∨ ~R | P ∧ (Q ∨ ~ R) |
|---|---|---|---|---|---|
| T | T | F | T | T | T |
The statement has a truth value true.
A tautology is a proposition which is always true under all possible truth conditions of its component parts.
Example
Show that whether or not ∼(P∧Q)∨(∼P→∼Q) is a tautology
| P | Q | ~ P | ~ Q | P ∧ Q | ~ (P ∧ Q) | ~ P → ~Q | ~ (P ∧ Q) ∨ (~ P → ~Q) |
|---|---|---|---|---|---|---|---|
| T | T | F | F | T | F | T | T |
| T | F | F | T | F | T | T | T |
| F | T | T | F | F | T | F | T |
| F | F | T | T | F | T | T | T |
Since column 8 has all the truth values True (T) therefore it is TAUTOLOGY.
Since column 8 has truth value true throughout then, ∼(P∧Q)∨(∼P→∼Q) is a tautology.
Questions
- Show whether the given compound statements are tautology or not
i) (P∧Q)→P
| P | Q | P ∧ Q | (P ∧ Q) → P |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | F | T |
| F | F | F | T |
Since column 4 has truth value true throughout then (P∧Q)→P is a tautology.
ii) P→(P∧Q)
| P | Q | P ∧ Q | P → (P ∧ Q) |
|---|---|---|---|
| T | T | T | T |
| T | F | F | F |
| F | T | F | T |
| F | F | F | T |
Since column 4 does not have truth value true throughout then P→(P∧Q) is not a tautology.
iii) P→∼P
| P | ~ P | P → ~P |
|---|---|---|
| T | F | F |
| F | T | T |
Since column 3 does not have the truth value true throughout then
P→∼P is not a tautology.
iv) (P→Q)→(∼P→Q)
| P | Q | P → Q | ~ P | ~P → Q | (P → Q) → (~ P → Q) |
|---|---|---|---|---|---|
| T | T | T | F | T | T |
| T | F | F | F | T | T |
| F | T | T | T | T | T |
| F | F | T | T | F | F |
Since column 6 does not have the truth value true throughout then (P→Q)→(∼P→Q) is not a tautology.
v) (P→Q)∨(Q→P)
| P | Q | P → Q | Q → P | (P → Q) ∨ (Q → P) |
|---|---|---|---|---|
| T | T | T | T | T |
| T | F | F | T | T |
| F | T | T | F | T |
| F | F | T | T | T |
Since column 5 has all truth values true throughout then (P→Q)∨(Q→P) is a tautology.
- Express the following in symbolic form and then find its truth value
i) 2 is a prime, and either 4 is even or it's not true that 5 is even
Solution
Let P= 2 is a prime
Let Q= 4 is even
Let R= 5 is even
P∧(Q∨∼R)
| P | Q | R | ~ R | Q ∨ ~ R | P ∧ (Q ∨ ~ R) |
|---|---|---|---|---|---|
| T | T | T | F | T | T |
P∧(Q∨∼R) has a truth value true.
ii) 7 is odd, or either London is in France and it is false that Paris is not in Denmark
Let P= 7 is odd
Q= London is in France
R= Paris is not in Denmark
P∨(Q∧∼R)
| P | Q | R | ~ R | Q ∧ ~R | P ∨ (Q ∧ ~ R) |
|---|---|---|---|---|---|
| T | F | T | F | F | T |
P∨(Q∧∼R) has a truth value True.
- Find the truth values of P∧(Q∨∼R) if
P, Q, R all has truth value T
If P, Q, R all have truth value of F
If P is true, Q is false and R is false
| P | Q | R | ~ R | Q ∨ ~ R | P ∧ (Q ∨ ~ R) |
|---|---|---|---|---|---|
| T | T | T | F | T | T |
| F | F | F | T | T | F |
| T | F | F | T | T | T |
A complete truth table for general cases
- Only one compound P — Two rows
| P |
|---|
| T |
| F |
- Two components P and Q — Four rows
| P | Q |
|---|---|
| T | T |
| T | F |
| F | T |
| F | F |
- Three components P, Q, R — Eight rows
| P | Q | R |
|---|---|---|
| T | T | T |
| T | T | F |
| T | F | T |
| T | F | F |
| F | T | T |
| F | T | F |
| F | F | T |
| F | F | F |
- Four components P, Q, R, S — Sixteen rows
| P | Q | R | S |
|---|---|---|---|
| T | T | T | T |
| T | T | T | F |
| T | T | F | T |
| T | T | F | F |
| T | F | T | T |
| T | F | T | F |
| T | F | F | T |
| T | F | F | F |
| F | T | T | T |
| F | T | T | F |
| F | T | F | T |
| F | T | F | F |
| F | F | T | T |
| F | F | T | F |
| F | F | F | T |
| F | F | F | F |
Example constructs a truth table for the compound statement
((P→Q)∧R)↔Q
Mwalimu
Unasoma somo hili? Niulize nikuelezee chochote kilichomo.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu mada hii.
Ingia ili kuulizaMajadiliano
Hakuna maswali bado