SlideShare a Scribd company logo
1 of 44
LOGIC
Logic concerns with the study of analysis of methods of reasoning which lead to certain
conclusion or statement.
Example
If it rains today we shall play football. It rained we did not play football
Simple andcompound sentence
Consider the followingsentence
i) The medians of a triangle meet at a point
ii) The diagonals of any quadrilateral are parallel
i) and ii) are simple sentence
iii) The median of a triangle meet at a point and the diagonal of a quadrilateral are parallel
iii) Is a compoundsentence
Other connectingwords are: or, but, while
TRUTH VALUE OF A SENTENCE
2 x 3 = 5 has a truthvalue " false"
2 x 2 = 4 has a truthvalue " True"
The number 23 is prime. "True"
Propositions
A proposition is any statement which is free from ambiguity and having a property, it is
either true or false but not both nor neither.
Consider the followingsentence;
i) Birds have no wings (p)
ii) The sun rises from the west. (p)
iii) 8 = 6 + 2 (p)
iv) The grass is green(p)
v) I am feelinghungry (not proposition)
TRUTH TABLE
A truth table is a matrix whose entries are truthvalues
E.g. F T Or T F
A completetruthfor conjunction
Note: A conjunctionis a compound propositionconnectedbythe word "and"
E.g. the sun rises from the west and 8 = 6 + 2
The above propositionhas a truth value false
The proposition having and/ but, if both of the sentence are true, then only truth value will be
true.
The word “but” carries the same meaning as the word “and”
QUESTIONS
Find the components or simple sentenceof the followingconjunctions
a) 3< 5 and three are infinitelymany prime numbers.
i) 3< 5
ii) There are infinitelymany prime numbers
b) 4 is divisible by 2 and 4 is a prime number
i) 4 is divisible by 2
T T F F
T F T F
F F F F
T T F F
ii) 4 is a prime number
c) 2 < 3 and 5 < 3
i) 2< 3
ii) 5< 3
d) The sun rises from the west and is irrational
i) The sun rises from the west
ii) is irrational
e) 2 is an odd number and it is false that 5 is even
A completetruthtable for conjunction
Let P and Q be any general proposition
Requiredto find the truth table for P and Q
Now P and Q is writtenas P ∧ Q
P ∧ Q has truthvalue onlywhen bothP and Q are true
Truth table for P ∧ Q
Negation
A negation is a sentence which has an opposite truthvalue to the given one
P Q P Q
T T T
T F F
F T F
F F F
- One way of forminga 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
Disjunction
Another word used to combine sentence is the word " or "
Consider the sentence
i) 43 < 3 ii) 5 > 3
- combiningthem with the word " or " i.e. 43 < 3 or 5 > 3
- The connective word " or " is calleda disjunctionand is symbolizedby " V "
The truth value for disjunctionis onlyfalse when both the components are false
If P and Q are statement,thenP or Q is symbolizedas P V Q
P V Q has a truthvalue false in one case when both P and Q are false
Truth Table for disjunction
P Q P V Q
T T T
T F T
F T T
F F F
Implications
These are statements of the form "if……..then……"
Example. If a quadrilateral is a parallelogram thenthe pair of opposite sides are parallel
The phrase "a quadrilateral is a parallelogram" calledhypothesis or antecedent
The phrase "the pair of opposite sides are parallel"is calleda conclusionor constituent
If P hypothesis
Q conclusion
Then the statement if P then Q its implicationin 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 implicationis 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 whichcarrythe same meaning as if P then Q
i) If P, Q
ii) Q if P
iii) Q provided that P
iv) P only if Q
v) P is a sufficient conditionfor Q
vi) Q is a necessaryconditionfor P
EXERCISE
1. Determine the truthvalues of the following
a) If 2 < 3 then 2 + 3 = 5 T
b) If 3 < 2 then 3 + 2 = 5 T
c) If 2 + 3 = 5 then 3 < 2 F
d) If 2 + 1 = 2 then 1 = 0 T
2. Find the components of the followingcompound
i) If 3 < 5 then 10 + m = 9
a) 3 < 5
b) 10 + m = 9
ii) a + b = c + d only if p + q = r2
a) a + b = c + d
b) p + q = r2
iii) If Galileo was born before Descartes thenNewtonwas bornbefore Shakespeare
a) Galileo was bornbefore Descartes
b) Newton was born before Shakespeare
3. Write a truthtable for
i) (P ∧ Q) V (P V Q) ii) (P → Q) ∧ P iii) ((P → Q) → Q)
Solutions
i) (P ∧ Q) V (P V Q)
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
P Q P ∧ Q P V Q (P ∧ Q) V (P V Q)
T T T T T
T F F T T
F T 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
BI CONDITIONAL STATEMENT
Consider the truth table for (P → Q) ∧ (Q → P)
(A) (B)
P Q P → Q Q → P A ∧ B
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 bi-conditional 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 onlyif 3 < 5 (F)
43< 3 if and only if 5 < 3 (T)
43> 3 if and only if 5 > 3 (T)
CONVERSE, CONTRA POSITIVE, INVERSE
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.
Contra positive: If the positive 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 exactlytruth value as column7
i. e P → Q ~Q → ~ P
Q → P ~ P → ~Q
EQUIVALENT STATEMENTS
Two propositions are logicallyequivalent if they have exactlythe same truth values
E.g. P V Q and Q V P are logicallyequivalent
Solution: Draw truth for P V Q and Q V P
1 2 3 4
P Q P V Q Q V P
T T T T
T F T T
F T T T
F F F F
Since column3 has exactly the same truthvalues as column4 then
P V Q Q V P
Questions
Show whether or not the following propositions are logically equivalent
i)P → Q, ~ P V Q
P Q P → Q ~ P ~ P V 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 V Q
ii) P → (P V Q); P → Q
P Q P V Q 1 → 3 p → Q
Since column 4 does not have exactly same truth value as column 5 then p → (P V 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 column3 does not have exactlysame truthvalues as column5 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
T T T T T
T F T T F
F T T 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);PV ~ Q
(5) (6)
P Q ~ Q P → Q ~ (P → Q) P V ~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
V ~Q
vi) ~ (P V Q); ~P ∧ ~Q
P Q ~ P ~ Q P V Q ~ (P V 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 column6 has exact same truth values as column7 therefore ~ (P V Q) →( ~P ∧ ~Q)
COMPOUND STATEMENTS
Compound statements with three components P, Q, R.
Consider the followingcompoundstatement,
Triangles have all three sides and either the area of a circular region of radius r is 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 regionof radius r is
Let R diagonals of parallelogram do not meet
P ∧ (Q V ~R)
To find the truth values of the above statement
P Q R ~ R Q V ~R P ∧ (Q V ~ R)
T T F T T T
 The statement has a truth value true
TAUTOLOGY
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) V (~P → ~Q) is a tautology
(6) (7)
P Q ~ P ~ Q P ∧ Q ~ (P ∧ Q) ~ P → ~Q 6 V 7
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 column8 has all the truthvalues True (T) therefore it is TAUTOLOGY
Since column8 has truth value true throughout then, ~ (P ∧ Q) V (~ P → ~Q) is a tautology
Questions
1. Show whether the given compoundstatements are tautologyor 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 column4 has truth value true throughout then (P ∧ Q) → P is a tautology.
ii) P → (P ∧ Q)
Since column 4 does not have truth value true throughout then P → (P ∧ Q) is not a
tautology.
iii) P → ~P
P Q (P ∧ Q) P → (P ∧ Q)
T T T T
T F F F
F T F T
F F F T
P ~ P P → ~P
T F F
F T T
Since column3 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) V (Q → P)
P Q P → Q Q → P 3 V 4
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) V (Q → P) is a
tautology.
2. Express the followingin symbolic form and then find its truthvalue
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 V ~R)
P Q R ~ R Q V ~ R P ∧ (Q V ~ R)
T T T F T T
P ∧ (Q V ~R) has a truthvalue true.
ii) 7 is odd, or either Londonis 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 V (Q ∧ ~R)
P Q R ~ R Q ∧ ~R P V (Q ∧ ~ R)
T F T F F T
P V (Q ∧ ~R) has a truth value True
3. Find the truth values of P ∧ (Q V ~R) if
i) P, Q, R all has truth value T
ii) If P, Q, R all have truth value of F
iii) If P is true, Q is false and R is false
P Q R ~ R Q V ~ R P Λ (Q V ~
R)
T T T F T T
F F F T T F
T F F T T T
A complete truthtable for general cases
1. Only one compound P
Two rows
2. Two components P and Q
Four rows
3. Three components P, Q, R
Eight Rows
P
T
F
P Q
T T
T F
F T
F F
P Q R
T T T
T T F
4. Four components P, Q, R, S
Sixteenrows
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 T
T F F
F T T
F T F
F F T
F F 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
Example constructs atruthtable for the compound statement
((P → Q) Λ R) Q
P Q R P → Q (P → Q) Λ R 5 2
T T T T T T
T T F T F F
T F T F F T
T F F F F T
F T T T T T
F T F T F F
F F T T T F
F F F T F T
LAWS OF ALGEBRA OF PROPOSITIONS
1. Idempotent laws
a) P V P P
b) P Λ P P
2. Commutative
a) P V Q Q V P
b) P Q Q Λ P
3. Associative laws
a) (P V Q) V R P V (Q V R)
b) (P Λ Q) Λ R P Λ (Q Λ R)
4. Distributive laws
a) P V (Q Λ R) (P V Q) Λ (P V R)
b) P Λ (Q V R) (P Λ Q) V (P Λ R)
5. Identitylaws
a) P V f P
b) P Λ t P
c) P V t t
d) P Λ f f
6. Complementarylaws
a) P V ~ P t
b) P Λ ~ P f
c) ~ ~P P
d) ~ T F or t~ f
e) ~ F T or f~ t
7. De-Morgan’s law
a) ~ (P V Q) ~ P Λ ~ Q
b) ~ (P Λ Q) ~ P V ~ Q
Examples
Using the laws of algebra of propositionsimplify (P V Q) ∧ ~ P
Solution
(P V Q) Λ ~ P (~ P Λ P) V (~ P Λ Q) ……distributive law
f V (~ P Λ Q) ………compliment law
(~ P Λ Q) ………..identity
Questions
1. Simplifythe followingpropositions usingthe laws of algebra of propositions
i) ~ (P V Q) V (~P Λ Q)
ii) (P Λ Q) V [~ R Λ (Q Λ P)]
2. Show using the laws of algebra of propositions (P Λ Q) V [P Λ (~Q V R)] P
3. Construct atruth table for [(p → ~q) ∧ (r → p) ∧ r] → ~p
SENTENCE HAVING A GIVEN TRUTH TABLE
Example.1 Find a sentence which has the followingtruthtable
P Q -
T T T
T F T
F T T
F F F
Step: 1. Mark lines which are T in last column
2. Basic conjunctionof P and Q
3. Requiredsentence is the disjunctions of the above basic conjunction
Requiredsentence (P ∧ Q) V (P ∧ ~ Q) V (~ P ∧ Q)
Example. 2
P Q - Basic conjunction
T T T P ∧ Q
T F T P ∧ ~Q
F T T ~ P ∧ Q
F F F
Find a sentence having the truth table below
P Q R -
T T T T
T T F F
T F T F
T F F T
F T T F
F T F T
F F T F
F F F F
Solution
Requiredsentence is (P ∧ Q ∧ R) V (P ∧ ~ Q ∧ ~ R)
Example. 3
Find a sentence having the followingtruth table and simplifyit.
P Q R - Basic conjunction
T T T T P ∧ Q∧ R
T T F F
T F T F
T F F T P ∧ ~ Q ∧ ~ R
F T T F
F T F F
F F T F
F F F F
P Q -
T T T
T F F
F T T
F F T
SOLUTION
P Q - Basic conjunction
T T T P ∧ Q
T F F
F T T ~ P ∧ Q
F F T ~ P ∧ ~Q
The requiredsentence is (P ∧ Q) V (~ P ∧ Q) V (~ P ∧ ~ Q)
To simplify;
(P ∧ Q) V (~P ∧ Q) V (~P ∧ ~Q) = (P ∧ Q) V [~P ∧ (Q V ~Q)…..distributive law
= (P ∧ Q) V [~ P ∧ t] ……compliment law
= (P ∧ Q) V [~ P] ……..identity
= (P V ~P) ∧ (~P V Q)…….. Distributive
= t ∧ (~P V Q) ………compliment
= (~P V Q) ………identity
Note
P → Q ≡ ~ P V Q
QUESTIONS
1. for each of the following truth tables (a), (b) and (c) construct a compound sentence
having that truthtable.
P Q R (a) (b) (c)
T T T T T F
T T F F T T
T F T T T T
T F F F T F
F T T F F F
F T F F F F
F F T F F F
F F F F F T
Solution
P Q R (a) (b) (c) Basic conjunction of
(a)
Basic conjunction of
(b)
Basic conjunction of
( c)
T T T T T F P ∧ Q ∧ R P ∧ Q ∧ R
T T F F T T P ∧ Q ∧ ~ R P ∧ Q ∧ ~ R
T F T T T T P ∧ ~ Q ∧ R P ∧ ~ Q ∧ R P ∧ ~ Q ∧ R
T F F F T F P ∧ ~Q ∧ ~ R
F T T F F F
F T F F F F
F F T F F F
F F F F F T ~ P ∧ ~ Q ∧ ~ R
→The requiredsentence for (a) is (P ∧ Q ∧ R) V (P ∧ ~ Q ∧ R)
→The required sentence for (b) is (P ∧ Q ∧ R) V (P ∧ Q ∧ ~R) V (P∧ ~Q∧ R)V(P ∧ ~Q∧ ~
R)
→The requiredsentence for (c)is (P ∧ Q ∧ ~R) V (P ∧ ~Q ∧ R) V (~P ∧ ~Q ∧ ~R)
2. i) construct atruth table for ~ (P → Q)
ii) Write a compoundsentence having that truthtable (involving ~, ∧ , v)
3. Repeat for the followingsentence
i) ~ P → ~Q ii) ~ p Q
More question
1. Find a compound sentence having components P and Q which is true and only if exactly
one of its components P, Q is true.
2. Find a compound sentence having components P, Q and R which is true only if exactly
two of P, Q and R are true.
3. Give an example of sentence having one component which is always true
4. Give an example of a compoundsentence having one component which is always false
5. Use laws of algebra of propositions to simplify~ (p V q) ∧ (~ p ∧ q)
6. Show that p q and ~ p v q are logicallyequivalent
7. If Apq p ∧ q and Np ~ p write the followingwithout ~ and A
i) ~ (p ∧ q)
ii)~ (p ∧ ~q)
iii) ~ (~ p ∧ q)
iv) ~ (p ∧ ~ q)
QUESTIONS
1. Rewrite the followingwithout using the conditional
i) If it is cold, he wears a hat
ii) If productivity increases, thenwages rise
2. Determine the truthvalue of the following
i) 2 + 2 = 4 if and onlyif 3 + 6 = 9
ii) 2 + 2 = 4 if and only if 5 + 1 = 2
iii) 1 + 1 = 2 if and only if 3 + 2 = 8
iv) 1 + 2 = 5 if and only if 3 + 1 = 4
3. Prove by truthtable
i) ~ (p q) ≡ p ~q
ii) ~ (p q) ≡ ~ p q
4. Prove the conditional distributes over conjunctioni.e.
[p → (q ∧ r)] ≡ (p → q) ∧ (p → r)
5. Let p denote ‘’ it is cold’’ and let q denote " it rains ". Write the following statement in
symbolic form
i) It rains only if it is cold.
ii) A necessaryconditionfor it to be coldis that it rains.
iii) A sufficient conditionfor it to be coldis that it rains
iv) It never rains when it is cold.
6. a) Write the inverse of the converse of the conditional
" If a quadrilateral is a square then it is a rectangle"
b) Write the inverse of the converse of the contrapositive of
"If the diagonals of the rhombus are perpendicular then it is a square"
LOGICAL IMPLICATIONS
A propositionP is saidto be logicallyimply a propositionQ if p → Q is a tautology
Example
Show that p logicallyimplies pv q
Solution;Construct a truth table for p → (p v q)
Since column4 is a tautologythen p logicallyimplies p v q
ARGUMENTS
P q P v q P → (p v q)
T T T T
T F T T
F T T T
F F F T
An argument in logic is a declaration that a given set of proposition p1, p2, p3….pn
called premises yields to another proposition Q called a conclusion such as argument is
denotedby p1, p2….pn Q
Example of an argument
If I like mathematics, then I will study, either I study or I fail. But I failed therefore I
do not like mathematics.
VALIDITY OF AN ARGUMENT
Validity of an argument is determinedas follows
→An argument P1, P2, P3… Pn Q is valid if Q is true whenever all the premises P1,
P2, P3… Pn are true
→Validity of an argument is also determined if and only if the proposition (P1 ∧ P2 ∧
P3 ∧ ….. Pn) → Q is a tautology
Example
Prove whether the followingargument is valid or not P, P → Q Q
Solution:
Draw a truth table for [P ∧ P → Q] → Q
P Q P → Q P ∧ (p → Q) P ∧ (p → Q) → Q
T T T T T
T F F F T
F T T F T
F F T F T
1. Since in row 1 the conclusion is true and all the premises are true then the argument is
valid
2. Since column5 is a tautologythen the argument is valid
QUESTION
Use the truthtable to show whether the given argument is valid or not
P → Q, Q → R P → R
Example
Symbolize the given argument and then test its validity
*If I like mathematics, then I will study, either I study or I fail. But I failed, therefore I do
not like mathematics.
Solution.
The given argument is symbolizedas follows
Let p ≡ I like mathematics
q ≡ I will study
r ≡ I fail
Then given argument is as follows
P → q, q v r, r, ~p
Testing the validity
[(p → q) ∧ (q ∧ r)∧ r] → ~p
P Q r P → q q v r 3 ∧ 4 ∧ 5 ~ p 6 → 7
T T T T T T F F
T T F T T F F T
T F T F T F F T
T F F F F F F T
F T T T T T T T
F T F T T F T T
F F T T T T T T
F F F T F F T T
Since column8 is not a tautologythe given argument is not valid
QUESTIONS
1. Translate the followingarguments in symbolic form and then test its validity
i) If London is not in Denmark, then Paris is not in France. But Paris is in France,
thereforeLondonis in Denmark
ii) If I work I cannot study. Either I work or I pass mathematics. I passed mathematics
thereforeIstudied.
iii) If I buy books, I lose money. I bought books, thereforeIlost money
2. Determine the validity of
i) p → q, ~q ~p
ii)~p → q, p ~q
iii) [p → ~ q], r → q, r ~p
ELECTRICAL NETWORK
Electrical network is an arrangement of worse and switches that will accomplish a particular
task e.g. lighting a lamp, turning a motor, etc
The figure below shows an electrical network
When the switchp is closedthe current flows betweenT1 and T2
The above network simplifies to the following network
Relationship between statement in logic and network
A SERIES AND PARALLEL CONNECTION OF SWITCHES
A seriesconnectionofswitches
The followingswitches are connectedinseries
The current flow between T1 and T2 when both switches are closed current flows
when p ∧ Q is true
A parallel connectionofswitches
The current will flowwhen either one of the switches is closed.
Currents flowwhen P V Q is true
Example
Consider the electrical networkbelow
i) Construct acompound statement presentingthe networkabove
ii) Find possible switch setting that will allow the current to flow between T1 and
T2
Solution
Note i) current flows betweenT1 and T2 when switch p is closedi.e. p is true OR
ii) The current flows between T1 and T2 when switch switches q and r are
closedi.e. Q ∧ R is true.
The requiredcompoundstatement is p v (Q ∧ R)
iii) To find possible switchsetting, draw a truth table P v (Q ∧ R)
P Q R Q ∧ R P V (Q ∧ R) Current flows yes
or No
T T T T T Yes
T T F F T Yes
T F T F T Yes
T F F F T Yes
F T T T T Yes
F T F F F No
F F T F F No
F F F F F No
Possible switchsetting
P Q r
Closed Closed Closed
Closed Closed Closed
Closed Closed Closed
Closed Closed Closed
Closed Closed Closed
Questions
1. Construct compoundstatement that correspondto the networks
Solution
The current will flowwhen all three switches p, q, and r are closedi.e. p ∧ q ∧ r
The requiredcompoundstatement is P ∧ Q ∧ R
The requiredcomponent statement is (P ∨ q)
The requiredcompoundstatement is (p ∧ q) V (r∧ s)
The requiredcompoundstatement is P V Q V R
The requiredcompoundstatement is p ∧ (q V (r ∧ s))
The requiredcompoundstatement is (P ∨ Q ∨ R) ∧ S
2. In electrical network of (ii) find possible switch setting that will allow the current to flow
between T1 and T2
ii) (P ∨ Q) ∧ R
P Q R P V Q (P V Q) ∧ R
T T T T T
Possible switchsettings
From statements to network
Example
Draw a network for the statement (pv Q) ∧ (R ∧ S)
Solutions
T T F T F
T F T T T
T F F T F
F T T T T
F T F T F
F F T F F
F F F F F
P Q R
Closed Closed Closed
Closed Open closed
Correspondingnetworkis shown below
Questions
Draw network for the followingstatements
1. [P ∨Q ∧ (R ∧ S)]
2. [(P ∧ Q) ∧ (R V S)]
3. [P V (Q ∧ S) V (R ∧ T)]
4. (Q V(R V S) V P)
5. [P V (Q ∧ (R ∧ S)]
COMPLEX SWITCHES
These operates as follows
i) When one switchis closed, the other one closes also
ii) When one switch is closed, the other one opens
Refers to the diagram
The compound relatingto flow of electrical current is given
(P ∧ Q) V [P ∧ (~ Q V R)]
To find possible switchsettingthat will allow the current to flowbetween T1 and T2
- Draw a truth table for (P ∧ Q) V [ P ∧ ( ~ Q V R)]
1 2 3 4 5 6 7
8
P Q R P ∧ Q ~ Q ~ Q V R P ∧ (~ Q V R) 4 V 7
T T T T F T T T
T T F T F F F T
T F T F T T T T
T F F F T T T T
F T T F T F F F
F T F F F F F F
F F T F T T F F
F F F F T T F F
Possible switchsetting
P Q R
Closed Closed Closed
Closed Closed Open
Closed Open Closed
Closed Open open
Example
Without using a truthtable draw a sample network for the statement
(P ∧ Q) V [ P ∧ (~ Q V R)]
Solution
(P ∧ Q) V [ P ∧ (~ Q V R) ] = P ∧ (Q V (~ Q V R) ….. distributive
= P ∧ (Q V ~ Q) V R ……. associative
= P ∧ (t V R) ….. Complement
= P ∧ t ….. Identity
= P ….. Identity
The statement simplifies to p
The correspondingnetworkis a follows
For a statement which on simplifyingends upon F network drawn is as follows
For a statement which upon simplifyingyields to T, network is drawn as follows
QUESTION
1. For each of the network shown below. Find a compound statement that represents it
2. (a) Draw network for the correspondingstatement
i) (P ∧ ~ Q) ∨ (Q ∧ P)
ii) (P ∧ ~ Q) ∨(Q ∧ ~ R)
iii) P → Q ≡ ~ P ∨ Q
iv) (P → Q) ∧ (p v Q) ≡ (~ P V Q) ∧ (P V Q)
(b) Simplify the statement in 2 (iv) using the laws of algebra of propositions and draw a
simple network
MORE QUESTIONS
i) Write down compoundstatement for the followingnetworks
2. For each of these sentences drawa simple network
a) P∧ (~ Q → ~p)
b) ~ (P ∨ Q) →R
c) P ∧ ~ P
3. Given a truth table
a) Construct a statement having this truth table
b) Draw the electrical network
P Q R -
T T T F
T T F T
T F T T
T F F F
F T T T
F T F F
F F T F
F F F T

More Related Content

What's hot

Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
taimoor iftikhar
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
guestd166eb5
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
Slideshare
 
Truth tables
Truth tablesTruth tables
Truth tables
walkerlj
 

What's hot (20)

CMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional EquivalencesCMSC 56 | Lecture 2: Propositional Equivalences
CMSC 56 | Lecture 2: Propositional Equivalences
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Truth table
Truth tableTruth table
Truth table
 
Proof by contradiction
Proof by contradictionProof by contradiction
Proof by contradiction
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
 
Rules of inference
Rules of inferenceRules of inference
Rules of inference
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Chapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptChapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).ppt
 
Truth tables
Truth tablesTruth tables
Truth tables
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Logic (slides)
Logic (slides)Logic (slides)
Logic (slides)
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Conditionals
ConditionalsConditionals
Conditionals
 
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 

Similar to LOGIC

Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
BindhuBhargaviTalasi
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
PradeeshSAI
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
Syed Umair
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
Syed Umair
 

Similar to LOGIC (20)

UNIT-III-PPT.pptx
UNIT-III-PPT.pptxUNIT-III-PPT.pptx
UNIT-III-PPT.pptx
 
Logic - Logical Propositions
Logic - Logical Propositions Logic - Logical Propositions
Logic - Logical Propositions
 
Logic and proof
Logic and proofLogic and proof
Logic and proof
 
Nature of Logic.pptx
Nature of Logic.pptxNature of Logic.pptx
Nature of Logic.pptx
 
Mathematical foundations of computer science
Mathematical foundations of computer scienceMathematical foundations of computer science
Mathematical foundations of computer science
 
Discrete math Truth Table
Discrete math Truth TableDiscrete math Truth Table
Discrete math Truth Table
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
 
null-12.pdf
null-12.pdfnull-12.pdf
null-12.pdf
 
Maths teachers guide For freshman course.pdf
Maths teachers guide For freshman course.pdfMaths teachers guide For freshman course.pdf
Maths teachers guide For freshman course.pdf
 
The logic
The logicThe logic
The logic
 
L4-IntroducClick to edit Master title styletion to logic.pptx
L4-IntroducClick to edit Master title styletion to logic.pptxL4-IntroducClick to edit Master title styletion to logic.pptx
L4-IntroducClick to edit Master title styletion to logic.pptx
 
Propositional logic by shawan
Propositional logic by shawanPropositional logic by shawan
Propositional logic by shawan
 
Bab 1 proposisi
Bab 1 proposisiBab 1 proposisi
Bab 1 proposisi
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
 
Lecture-3-and-4.pdf
Lecture-3-and-4.pdfLecture-3-and-4.pdf
Lecture-3-and-4.pdf
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
 
Truth table analysis
Truth table analysisTruth table analysis
Truth table analysis
 
12_Truth_Tables.pptx
12_Truth_Tables.pptx12_Truth_Tables.pptx
12_Truth_Tables.pptx
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 
Assignement of discrete mathematics
Assignement of discrete mathematicsAssignement of discrete mathematics
Assignement of discrete mathematics
 

More from shahzadebaujiti

More from shahzadebaujiti (20)

IMPERIALISM AND TERRITORIAL DIVISION OF THE WORLD (COLONIZATION OF AFRICA)
IMPERIALISM AND TERRITORIAL DIVISION OF THE WORLD (COLONIZATION OF AFRICA)IMPERIALISM AND TERRITORIAL DIVISION OF THE WORLD (COLONIZATION OF AFRICA)
IMPERIALISM AND TERRITORIAL DIVISION OF THE WORLD (COLONIZATION OF AFRICA)
 
THE RISE OF DEMOCRACY IN EUROPE
THE RISE OF DEMOCRACY IN EUROPE THE RISE OF DEMOCRACY IN EUROPE
THE RISE OF DEMOCRACY IN EUROPE
 
THE RISE OF CAPITALISM IN EUROPE
THE RISE OF CAPITALISM IN EUROPETHE RISE OF CAPITALISM IN EUROPE
THE RISE OF CAPITALISM IN EUROPE
 
CLIMATOLOGY CLIMATOLOGY
CLIMATOLOGY CLIMATOLOGYCLIMATOLOGY CLIMATOLOGY
CLIMATOLOGY CLIMATOLOGY
 
SUSTAINABLE USE OF FUEL AND POWER
SUSTAINABLE USE OF FUEL AND POWERSUSTAINABLE USE OF FUEL AND POWER
SUSTAINABLE USE OF FUEL AND POWER
 
SPACE DYNAMIC
SPACE DYNAMICSPACE DYNAMIC
SPACE DYNAMIC
 
PHYSICAL GEOGRAPHY 1.5 -STUDY OF SOIL
PHYSICAL GEOGRAPHY 1.5 -STUDY OF SOILPHYSICAL GEOGRAPHY 1.5 -STUDY OF SOIL
PHYSICAL GEOGRAPHY 1.5 -STUDY OF SOIL
 
PHYSICAL GEOGRAPHY 1.4-WATER MASSES
PHYSICAL GEOGRAPHY 1.4-WATER MASSESPHYSICAL GEOGRAPHY 1.4-WATER MASSES
PHYSICAL GEOGRAPHY 1.4-WATER MASSES
 
ENVIRONMENTAL ISSUES AND CONSERVATION
ENVIRONMENTAL ISSUES AND CONSERVATIONENVIRONMENTAL ISSUES AND CONSERVATION
ENVIRONMENTAL ISSUES AND CONSERVATION
 
TRANSPORT AND COMMUNICATION
TRANSPORT AND COMMUNICATIONTRANSPORT AND COMMUNICATION
TRANSPORT AND COMMUNICATION
 
MANUFACTURING INDUSTRY
MANUFACTURING INDUSTRYMANUFACTURING INDUSTRY
MANUFACTURING INDUSTRY
 
RIVER BASIN DEVELOPMENT
RIVER BASIN DEVELOPMENTRIVER BASIN DEVELOPMENT
RIVER BASIN DEVELOPMENT
 
REGIONAL FOCAL STUDIES - 5.7 ENVIRONMENTAL FRIENDLY TOURISM
REGIONAL FOCAL STUDIES - 5.7 ENVIRONMENTAL FRIENDLY TOURISMREGIONAL FOCAL STUDIES - 5.7 ENVIRONMENTAL FRIENDLY TOURISM
REGIONAL FOCAL STUDIES - 5.7 ENVIRONMENTAL FRIENDLY TOURISM
 
REGIONAL FOCAL STUDIES -5.5 SUSTAINABLE USE OF FORESTRY
REGIONAL FOCAL STUDIES -5.5 SUSTAINABLE USE OF FORESTRYREGIONAL FOCAL STUDIES -5.5 SUSTAINABLE USE OF FORESTRY
REGIONAL FOCAL STUDIES -5.5 SUSTAINABLE USE OF FORESTRY
 
REGIONAL FOCAL STUDIES - 5.6 SUSTAINABLE FISHING
REGIONAL FOCAL STUDIES - 5.6 SUSTAINABLE FISHINGREGIONAL FOCAL STUDIES - 5.6 SUSTAINABLE FISHING
REGIONAL FOCAL STUDIES - 5.6 SUSTAINABLE FISHING
 
SUSTAINABLE MINING MINERAL EXTRACTION (MINING INDUSTRY)
SUSTAINABLE MINING  MINERAL EXTRACTION (MINING INDUSTRY)SUSTAINABLE MINING  MINERAL EXTRACTION (MINING INDUSTRY)
SUSTAINABLE MINING MINERAL EXTRACTION (MINING INDUSTRY)
 
SOIL DEGRADATION AND CONSERVATION
SOIL DEGRADATION AND CONSERVATIONSOIL DEGRADATION AND CONSERVATION
SOIL DEGRADATION AND CONSERVATION
 
AGRICULTURAL DEVELOPMENT
AGRICULTURAL DEVELOPMENTAGRICULTURAL DEVELOPMENT
AGRICULTURAL DEVELOPMENT
 
POPULATION AND DEVELOPMENT
POPULATION AND DEVELOPMENTPOPULATION AND DEVELOPMENT
POPULATION AND DEVELOPMENT
 
THE BUSINESS OFFICE
THE BUSINESS OFFICETHE BUSINESS OFFICE
THE BUSINESS OFFICE
 

Recently uploaded

Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Uttam Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 

LOGIC

  • 1. LOGIC Logic concerns with the study of analysis of methods of reasoning which lead to certain conclusion or statement. Example If it rains today we shall play football. It rained we did not play football Simple andcompound sentence Consider the followingsentence i) The medians of a triangle meet at a point ii) The diagonals of any quadrilateral are parallel i) and ii) are simple sentence iii) The median of a triangle meet at a point and the diagonal of a quadrilateral are parallel iii) Is a compoundsentence Other connectingwords are: or, but, while TRUTH VALUE OF A SENTENCE 2 x 3 = 5 has a truthvalue " false" 2 x 2 = 4 has a truthvalue " True" The number 23 is prime. "True" Propositions A proposition is any statement which is free from ambiguity and having a property, it is either true or false but not both nor neither. Consider the followingsentence; i) Birds have no wings (p) ii) The sun rises from the west. (p)
  • 2. iii) 8 = 6 + 2 (p) iv) The grass is green(p) v) I am feelinghungry (not proposition) TRUTH TABLE A truth table is a matrix whose entries are truthvalues E.g. F T Or T F A completetruthfor conjunction Note: A conjunctionis a compound propositionconnectedbythe word "and" E.g. the sun rises from the west and 8 = 6 + 2 The above propositionhas a truth value false The proposition having and/ but, if both of the sentence are true, then only truth value will be true. The word “but” carries the same meaning as the word “and” QUESTIONS Find the components or simple sentenceof the followingconjunctions a) 3< 5 and three are infinitelymany prime numbers. i) 3< 5 ii) There are infinitelymany prime numbers b) 4 is divisible by 2 and 4 is a prime number i) 4 is divisible by 2 T T F F T F T F F F F F T T F F
  • 3. ii) 4 is a prime number c) 2 < 3 and 5 < 3 i) 2< 3 ii) 5< 3 d) The sun rises from the west and is irrational i) The sun rises from the west ii) is irrational e) 2 is an odd number and it is false that 5 is even A completetruthtable for conjunction Let P and Q be any general proposition Requiredto find the truth table for P and Q Now P and Q is writtenas P ∧ Q P ∧ Q has truthvalue onlywhen bothP and Q are true Truth table for P ∧ Q Negation A negation is a sentence which has an opposite truthvalue to the given one P Q P Q T T T T F F F T F F F F
  • 4. - One way of forminga 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 Disjunction Another word used to combine sentence is the word " or " Consider the sentence i) 43 < 3 ii) 5 > 3 - combiningthem with the word " or " i.e. 43 < 3 or 5 > 3 - The connective word " or " is calleda disjunctionand is symbolizedby " V " The truth value for disjunctionis onlyfalse when both the components are false If P and Q are statement,thenP or Q is symbolizedas P V Q P V Q has a truthvalue false in one case when both P and Q are false Truth Table for disjunction
  • 5. P Q P V Q T T T T F T F T T F F F Implications These are statements of the form "if……..then……" Example. If a quadrilateral is a parallelogram thenthe pair of opposite sides are parallel The phrase "a quadrilateral is a parallelogram" calledhypothesis or antecedent The phrase "the pair of opposite sides are parallel"is calleda conclusionor constituent If P hypothesis Q conclusion Then the statement if P then Q its implicationin 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 implicationis 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
  • 6. T F F F T T F F T Propositions whichcarrythe same meaning as if P then Q i) If P, Q ii) Q if P iii) Q provided that P iv) P only if Q v) P is a sufficient conditionfor Q vi) Q is a necessaryconditionfor P EXERCISE 1. Determine the truthvalues of the following a) If 2 < 3 then 2 + 3 = 5 T b) If 3 < 2 then 3 + 2 = 5 T c) If 2 + 3 = 5 then 3 < 2 F d) If 2 + 1 = 2 then 1 = 0 T 2. Find the components of the followingcompound i) If 3 < 5 then 10 + m = 9 a) 3 < 5 b) 10 + m = 9 ii) a + b = c + d only if p + q = r2
  • 7. a) a + b = c + d b) p + q = r2 iii) If Galileo was born before Descartes thenNewtonwas bornbefore Shakespeare a) Galileo was bornbefore Descartes b) Newton was born before Shakespeare 3. Write a truthtable for i) (P ∧ Q) V (P V Q) ii) (P → Q) ∧ P iii) ((P → Q) → Q) Solutions i) (P ∧ Q) V (P V Q) 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 P Q P ∧ Q P V Q (P ∧ Q) V (P V Q) T T T T T T F F T T F T F T T F F F F F
  • 8. 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 BI CONDITIONAL STATEMENT Consider the truth table for (P → Q) ∧ (Q → P) (A) (B) P Q P → Q Q → P A ∧ B 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 bi-conditional 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
  • 9. 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 onlyif 3 < 5 (F) 43< 3 if and only if 5 < 3 (T) 43> 3 if and only if 5 > 3 (T) CONVERSE, CONTRA POSITIVE, INVERSE 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. Contra positive: If the positive 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 exactlytruth value as column7 i. e P → Q ~Q → ~ P Q → P ~ P → ~Q
  • 10. EQUIVALENT STATEMENTS Two propositions are logicallyequivalent if they have exactlythe same truth values E.g. P V Q and Q V P are logicallyequivalent Solution: Draw truth for P V Q and Q V P 1 2 3 4 P Q P V Q Q V P T T T T T F T T F T T T F F F F Since column3 has exactly the same truthvalues as column4 then P V Q Q V P Questions Show whether or not the following propositions are logically equivalent i)P → Q, ~ P V Q P Q P → Q ~ P ~ P V 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 V Q ii) P → (P V Q); P → Q P Q P V Q 1 → 3 p → Q
  • 11. Since column 4 does not have exactly same truth value as column 5 then p → (P V 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 column3 does not have exactlysame truthvalues as column5 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 T T T T T T F T T F F T T T T F F F T T
  • 12. Since column 3 does not have exactly same truth values as column 4 therefore P → Q Q → P v) ~ (P → Q);PV ~ Q (5) (6) P Q ~ Q P → Q ~ (P → Q) P V ~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 V ~Q vi) ~ (P V Q); ~P ∧ ~Q P Q ~ P ~ Q P V Q ~ (P V 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 column6 has exact same truth values as column7 therefore ~ (P V Q) →( ~P ∧ ~Q) COMPOUND STATEMENTS Compound statements with three components P, Q, R. Consider the followingcompoundstatement, Triangles have all three sides and either the area of a circular region of radius r is or it is false that the diagonals of a parallelogram do not meet. Solution (To symbolize the above statement)
  • 13. Let P triangles have three sides Let Q circular regionof radius r is Let R diagonals of parallelogram do not meet P ∧ (Q V ~R) To find the truth values of the above statement P Q R ~ R Q V ~R P ∧ (Q V ~ R) T T F T T T  The statement has a truth value true TAUTOLOGY 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) V (~P → ~Q) is a tautology (6) (7) P Q ~ P ~ Q P ∧ Q ~ (P ∧ Q) ~ P → ~Q 6 V 7 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 column8 has all the truthvalues True (T) therefore it is TAUTOLOGY Since column8 has truth value true throughout then, ~ (P ∧ Q) V (~ P → ~Q) is a tautology
  • 14. Questions 1. Show whether the given compoundstatements are tautologyor 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 column4 has truth value true throughout then (P ∧ Q) → P is a tautology. ii) P → (P ∧ Q) Since column 4 does not have truth value true throughout then P → (P ∧ Q) is not a tautology. iii) P → ~P P Q (P ∧ Q) P → (P ∧ Q) T T T T T F F F F T F T F F F T P ~ P P → ~P T F F F T T
  • 15. Since column3 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) V (Q → P) P Q P → Q Q → P 3 V 4 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) V (Q → P) is a tautology. 2. Express the followingin symbolic form and then find its truthvalue 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
  • 16. Let R 5 is even P ∧ (Q V ~R) P Q R ~ R Q V ~ R P ∧ (Q V ~ R) T T T F T T P ∧ (Q V ~R) has a truthvalue true. ii) 7 is odd, or either Londonis 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 V (Q ∧ ~R) P Q R ~ R Q ∧ ~R P V (Q ∧ ~ R) T F T F F T P V (Q ∧ ~R) has a truth value True 3. Find the truth values of P ∧ (Q V ~R) if i) P, Q, R all has truth value T ii) If P, Q, R all have truth value of F iii) If P is true, Q is false and R is false P Q R ~ R Q V ~ R P Λ (Q V ~ R) T T T F T T
  • 17. F F F T T F T F F T T T A complete truthtable for general cases 1. Only one compound P Two rows 2. Two components P and Q Four rows 3. Three components P, Q, R Eight Rows P T F P Q T T T F F T F F P Q R T T T T T F
  • 18. 4. Four components P, Q, R, S Sixteenrows 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 T T F F F T T F T F F F T F F F
  • 19. 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 Example constructs atruthtable for the compound statement ((P → Q) Λ R) Q P Q R P → Q (P → Q) Λ R 5 2 T T T T T T T T F T F F T F T F F T T F F F F T F T T T T T F T F T F F
  • 20. F F T T T F F F F T F T LAWS OF ALGEBRA OF PROPOSITIONS 1. Idempotent laws a) P V P P b) P Λ P P 2. Commutative a) P V Q Q V P b) P Q Q Λ P 3. Associative laws a) (P V Q) V R P V (Q V R) b) (P Λ Q) Λ R P Λ (Q Λ R) 4. Distributive laws a) P V (Q Λ R) (P V Q) Λ (P V R) b) P Λ (Q V R) (P Λ Q) V (P Λ R) 5. Identitylaws a) P V f P b) P Λ t P c) P V t t
  • 21. d) P Λ f f 6. Complementarylaws a) P V ~ P t b) P Λ ~ P f c) ~ ~P P d) ~ T F or t~ f e) ~ F T or f~ t 7. De-Morgan’s law a) ~ (P V Q) ~ P Λ ~ Q b) ~ (P Λ Q) ~ P V ~ Q Examples Using the laws of algebra of propositionsimplify (P V Q) ∧ ~ P Solution (P V Q) Λ ~ P (~ P Λ P) V (~ P Λ Q) ……distributive law f V (~ P Λ Q) ………compliment law (~ P Λ Q) ………..identity Questions 1. Simplifythe followingpropositions usingthe laws of algebra of propositions i) ~ (P V Q) V (~P Λ Q) ii) (P Λ Q) V [~ R Λ (Q Λ P)] 2. Show using the laws of algebra of propositions (P Λ Q) V [P Λ (~Q V R)] P
  • 22. 3. Construct atruth table for [(p → ~q) ∧ (r → p) ∧ r] → ~p SENTENCE HAVING A GIVEN TRUTH TABLE Example.1 Find a sentence which has the followingtruthtable P Q - T T T T F T F T T F F F Step: 1. Mark lines which are T in last column 2. Basic conjunctionof P and Q 3. Requiredsentence is the disjunctions of the above basic conjunction Requiredsentence (P ∧ Q) V (P ∧ ~ Q) V (~ P ∧ Q) Example. 2 P Q - Basic conjunction T T T P ∧ Q T F T P ∧ ~Q F T T ~ P ∧ Q F F F
  • 23. Find a sentence having the truth table below P Q R - T T T T T T F F T F T F T F F T F T T F F T F T F F T F F F F F Solution Requiredsentence is (P ∧ Q ∧ R) V (P ∧ ~ Q ∧ ~ R) Example. 3 Find a sentence having the followingtruth table and simplifyit. P Q R - Basic conjunction T T T T P ∧ Q∧ R T T F F T F T F T F F T P ∧ ~ Q ∧ ~ R F T T F F T F F F F T F F F F F
  • 24. P Q - T T T T F F F T T F F T SOLUTION P Q - Basic conjunction T T T P ∧ Q T F F F T T ~ P ∧ Q F F T ~ P ∧ ~Q The requiredsentence is (P ∧ Q) V (~ P ∧ Q) V (~ P ∧ ~ Q) To simplify; (P ∧ Q) V (~P ∧ Q) V (~P ∧ ~Q) = (P ∧ Q) V [~P ∧ (Q V ~Q)…..distributive law = (P ∧ Q) V [~ P ∧ t] ……compliment law = (P ∧ Q) V [~ P] ……..identity = (P V ~P) ∧ (~P V Q)…….. Distributive = t ∧ (~P V Q) ………compliment = (~P V Q) ………identity Note P → Q ≡ ~ P V Q
  • 25. QUESTIONS 1. for each of the following truth tables (a), (b) and (c) construct a compound sentence having that truthtable. P Q R (a) (b) (c) T T T T T F T T F F T T T F T T T T T F F F T F F T T F F F F T F F F F F F T F F F F F F F F T Solution P Q R (a) (b) (c) Basic conjunction of (a) Basic conjunction of (b) Basic conjunction of ( c) T T T T T F P ∧ Q ∧ R P ∧ Q ∧ R T T F F T T P ∧ Q ∧ ~ R P ∧ Q ∧ ~ R T F T T T T P ∧ ~ Q ∧ R P ∧ ~ Q ∧ R P ∧ ~ Q ∧ R T F F F T F P ∧ ~Q ∧ ~ R F T T F F F
  • 26. F T F F F F F F T F F F F F F F F T ~ P ∧ ~ Q ∧ ~ R →The requiredsentence for (a) is (P ∧ Q ∧ R) V (P ∧ ~ Q ∧ R) →The required sentence for (b) is (P ∧ Q ∧ R) V (P ∧ Q ∧ ~R) V (P∧ ~Q∧ R)V(P ∧ ~Q∧ ~ R) →The requiredsentence for (c)is (P ∧ Q ∧ ~R) V (P ∧ ~Q ∧ R) V (~P ∧ ~Q ∧ ~R) 2. i) construct atruth table for ~ (P → Q) ii) Write a compoundsentence having that truthtable (involving ~, ∧ , v) 3. Repeat for the followingsentence i) ~ P → ~Q ii) ~ p Q More question 1. Find a compound sentence having components P and Q which is true and only if exactly one of its components P, Q is true. 2. Find a compound sentence having components P, Q and R which is true only if exactly two of P, Q and R are true. 3. Give an example of sentence having one component which is always true 4. Give an example of a compoundsentence having one component which is always false 5. Use laws of algebra of propositions to simplify~ (p V q) ∧ (~ p ∧ q) 6. Show that p q and ~ p v q are logicallyequivalent
  • 27. 7. If Apq p ∧ q and Np ~ p write the followingwithout ~ and A i) ~ (p ∧ q) ii)~ (p ∧ ~q) iii) ~ (~ p ∧ q) iv) ~ (p ∧ ~ q) QUESTIONS 1. Rewrite the followingwithout using the conditional i) If it is cold, he wears a hat ii) If productivity increases, thenwages rise 2. Determine the truthvalue of the following i) 2 + 2 = 4 if and onlyif 3 + 6 = 9 ii) 2 + 2 = 4 if and only if 5 + 1 = 2 iii) 1 + 1 = 2 if and only if 3 + 2 = 8 iv) 1 + 2 = 5 if and only if 3 + 1 = 4 3. Prove by truthtable i) ~ (p q) ≡ p ~q ii) ~ (p q) ≡ ~ p q 4. Prove the conditional distributes over conjunctioni.e. [p → (q ∧ r)] ≡ (p → q) ∧ (p → r) 5. Let p denote ‘’ it is cold’’ and let q denote " it rains ". Write the following statement in symbolic form i) It rains only if it is cold.
  • 28. ii) A necessaryconditionfor it to be coldis that it rains. iii) A sufficient conditionfor it to be coldis that it rains iv) It never rains when it is cold. 6. a) Write the inverse of the converse of the conditional " If a quadrilateral is a square then it is a rectangle" b) Write the inverse of the converse of the contrapositive of "If the diagonals of the rhombus are perpendicular then it is a square" LOGICAL IMPLICATIONS A propositionP is saidto be logicallyimply a propositionQ if p → Q is a tautology Example Show that p logicallyimplies pv q Solution;Construct a truth table for p → (p v q) Since column4 is a tautologythen p logicallyimplies p v q ARGUMENTS P q P v q P → (p v q) T T T T T F T T F T T T F F F T
  • 29. An argument in logic is a declaration that a given set of proposition p1, p2, p3….pn called premises yields to another proposition Q called a conclusion such as argument is denotedby p1, p2….pn Q Example of an argument If I like mathematics, then I will study, either I study or I fail. But I failed therefore I do not like mathematics. VALIDITY OF AN ARGUMENT Validity of an argument is determinedas follows →An argument P1, P2, P3… Pn Q is valid if Q is true whenever all the premises P1, P2, P3… Pn are true →Validity of an argument is also determined if and only if the proposition (P1 ∧ P2 ∧ P3 ∧ ….. Pn) → Q is a tautology Example Prove whether the followingargument is valid or not P, P → Q Q Solution: Draw a truth table for [P ∧ P → Q] → Q P Q P → Q P ∧ (p → Q) P ∧ (p → Q) → Q T T T T T T F F F T F T T F T F F T F T
  • 30. 1. Since in row 1 the conclusion is true and all the premises are true then the argument is valid 2. Since column5 is a tautologythen the argument is valid QUESTION Use the truthtable to show whether the given argument is valid or not P → Q, Q → R P → R Example Symbolize the given argument and then test its validity *If I like mathematics, then I will study, either I study or I fail. But I failed, therefore I do not like mathematics. Solution. The given argument is symbolizedas follows Let p ≡ I like mathematics q ≡ I will study r ≡ I fail Then given argument is as follows P → q, q v r, r, ~p Testing the validity [(p → q) ∧ (q ∧ r)∧ r] → ~p P Q r P → q q v r 3 ∧ 4 ∧ 5 ~ p 6 → 7 T T T T T T F F T T F T T F F T
  • 31. T F T F T F F T T F F F F F F T F T T T T T T T F T F T T F T T F F T T T T T T F F F T F F T T Since column8 is not a tautologythe given argument is not valid QUESTIONS 1. Translate the followingarguments in symbolic form and then test its validity i) If London is not in Denmark, then Paris is not in France. But Paris is in France, thereforeLondonis in Denmark ii) If I work I cannot study. Either I work or I pass mathematics. I passed mathematics thereforeIstudied. iii) If I buy books, I lose money. I bought books, thereforeIlost money 2. Determine the validity of i) p → q, ~q ~p ii)~p → q, p ~q iii) [p → ~ q], r → q, r ~p ELECTRICAL NETWORK Electrical network is an arrangement of worse and switches that will accomplish a particular task e.g. lighting a lamp, turning a motor, etc The figure below shows an electrical network
  • 32. When the switchp is closedthe current flows betweenT1 and T2 The above network simplifies to the following network Relationship between statement in logic and network A SERIES AND PARALLEL CONNECTION OF SWITCHES A seriesconnectionofswitches The followingswitches are connectedinseries
  • 33. The current flow between T1 and T2 when both switches are closed current flows when p ∧ Q is true A parallel connectionofswitches The current will flowwhen either one of the switches is closed. Currents flowwhen P V Q is true Example Consider the electrical networkbelow i) Construct acompound statement presentingthe networkabove ii) Find possible switch setting that will allow the current to flow between T1 and T2
  • 34. Solution Note i) current flows betweenT1 and T2 when switch p is closedi.e. p is true OR ii) The current flows between T1 and T2 when switch switches q and r are closedi.e. Q ∧ R is true. The requiredcompoundstatement is p v (Q ∧ R) iii) To find possible switchsetting, draw a truth table P v (Q ∧ R) P Q R Q ∧ R P V (Q ∧ R) Current flows yes or No T T T T T Yes T T F F T Yes T F T F T Yes T F F F T Yes F T T T T Yes F T F F F No F F T F F No F F F F F No Possible switchsetting P Q r Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed Closed
  • 35. Closed Closed Closed Questions 1. Construct compoundstatement that correspondto the networks Solution The current will flowwhen all three switches p, q, and r are closedi.e. p ∧ q ∧ r The requiredcompoundstatement is P ∧ Q ∧ R The requiredcomponent statement is (P ∨ q) The requiredcompoundstatement is (p ∧ q) V (r∧ s)
  • 36. The requiredcompoundstatement is P V Q V R The requiredcompoundstatement is p ∧ (q V (r ∧ s)) The requiredcompoundstatement is (P ∨ Q ∨ R) ∧ S 2. In electrical network of (ii) find possible switch setting that will allow the current to flow between T1 and T2 ii) (P ∨ Q) ∧ R P Q R P V Q (P V Q) ∧ R T T T T T
  • 37. Possible switchsettings From statements to network Example Draw a network for the statement (pv Q) ∧ (R ∧ S) Solutions T T F T F T F T T T T F F T F F T T T T F T F T F F F T F F F F F F F P Q R Closed Closed Closed Closed Open closed
  • 38. Correspondingnetworkis shown below Questions Draw network for the followingstatements 1. [P ∨Q ∧ (R ∧ S)] 2. [(P ∧ Q) ∧ (R V S)] 3. [P V (Q ∧ S) V (R ∧ T)] 4. (Q V(R V S) V P) 5. [P V (Q ∧ (R ∧ S)] COMPLEX SWITCHES These operates as follows i) When one switchis closed, the other one closes also ii) When one switch is closed, the other one opens Refers to the diagram
  • 39. The compound relatingto flow of electrical current is given (P ∧ Q) V [P ∧ (~ Q V R)] To find possible switchsettingthat will allow the current to flowbetween T1 and T2 - Draw a truth table for (P ∧ Q) V [ P ∧ ( ~ Q V R)] 1 2 3 4 5 6 7 8 P Q R P ∧ Q ~ Q ~ Q V R P ∧ (~ Q V R) 4 V 7 T T T T F T T T T T F T F F F T
  • 40. T F T F T T T T T F F F T T T T F T T F T F F F F T F F F F F F F F T F T T F F F F F F T T F F Possible switchsetting P Q R Closed Closed Closed Closed Closed Open Closed Open Closed Closed Open open Example Without using a truthtable draw a sample network for the statement (P ∧ Q) V [ P ∧ (~ Q V R)] Solution (P ∧ Q) V [ P ∧ (~ Q V R) ] = P ∧ (Q V (~ Q V R) ….. distributive = P ∧ (Q V ~ Q) V R ……. associative = P ∧ (t V R) ….. Complement
  • 41. = P ∧ t ….. Identity = P ….. Identity The statement simplifies to p The correspondingnetworkis a follows For a statement which on simplifyingends upon F network drawn is as follows For a statement which upon simplifyingyields to T, network is drawn as follows QUESTION 1. For each of the network shown below. Find a compound statement that represents it
  • 42. 2. (a) Draw network for the correspondingstatement i) (P ∧ ~ Q) ∨ (Q ∧ P) ii) (P ∧ ~ Q) ∨(Q ∧ ~ R) iii) P → Q ≡ ~ P ∨ Q iv) (P → Q) ∧ (p v Q) ≡ (~ P V Q) ∧ (P V Q) (b) Simplify the statement in 2 (iv) using the laws of algebra of propositions and draw a simple network MORE QUESTIONS i) Write down compoundstatement for the followingnetworks
  • 43. 2. For each of these sentences drawa simple network a) P∧ (~ Q → ~p) b) ~ (P ∨ Q) →R
  • 44. c) P ∧ ~ P 3. Given a truth table a) Construct a statement having this truth table b) Draw the electrical network P Q R - T T T F T T F T T F T T T F F F F T T T F T F F F F T F F F F T