Chapter_2_Logic
Chapter_2_Logic
2.1 Propositions
Logic is the concern of analyzing the pattern of reasoning by which the conclusion is
drawn from a set of statements, without reference to meaning or context.
The logic is very important because it is really crucial for mathematical reasoning and
used for designing electronic circuits.
A proposition is a statement that is either true (T) or false (F) but NOT both.
Examples of statements:
a. Taylor Swift is a Singapore singer. (False)
b. A triangle has three sided. (True)
c. 6 x 3 = 45 (False)
d. Harimau Malaya is a team from Malaysia. (True)
e. Prime numbers can only be divided by itself and one. (True)
f. Venice is located near to Istanbul. (False)
Examples of non-statements:
a. Please have a seat.
b. Run for your life!
c. What is your favorite team?
d. 3x + 6
e. Hey you, please come here.
Determine either the following is a statement or not. If they are statements, state either
the statement is true or false.
Connectives Interpretation
~ Negation of ~p is true if and only if p is false.
∧ A conjunction p∧q is true if and only if both p and q are true.
∨ A disjunction p∨q is true if and only if p is true or q is true.
An implication of p q is false if and only if p is true and q is false.
A biconditional p q is true if and only if p and q is true and false.
In 1938, Hitler seized Austria and in 1939 he seized former Czechoslovia and in 1941 he
attacked the former USSR while still having a non-aggression pact with it.
Atomic Proposition.
Let p – In 1938, Hitler seized Austria.
q – In 1939, Hitler seized Czechoslovia.
r – In 1941, Hitler attacked the former USSR.
s – In 1941, Hitler has a non-aggression pact with the former USSR.
Propositional Logic.
p∧q∧r∧s
Exercise 2:
p: A puppy is green-eyed.
q: A puppy can be taught.
r: A puppy loves toys.
a) If Jane bought a piano today, she either sold her old one or took
out the bank loan.
b) James is either a policeman or a footballer. If he is policeman, then
he has big feet. James has not big feet so he is a footballer.
c) Neither the fox nor the lynx can catch the hare if the hare is alert
and quick.
d) You can either stay at the hostel and watch movie or you can go to
museum and spend some time there.
A truth table is a tabular listing of all possible input value combinations for a logical
function and their corresponding output values depends on operators.
Unary Operator, P
Symbol, ~
P ~P
T F
F T
Example 2:
i. P – Today is Monday.
~P – Today is not Monday.
Binary Operators, P, Q
Symbol, ∧
P Q P∧Q
T T T
T F F
F T F
F F F
Example 3:
i. P – Ahmad goes to school by bicycle.
Q – Ali goes to school by bicycle.
P ∧ Q – Ahmad and Ali go to school by bicycles.
Binary Operators, P, Q
Symbol, ∨
P Q P∨Q
T T T
T F T
F T T
F F F
Example 4:
Binary Operators, P, Q
Symbol,
P Q P Q
T T T
T F F
F T T
F F T
Example 5:
Binary Operators, P, Q
Symbol,
P Q P Q
T T T
T F F
F T F
F F T
Example 6:
a: We are on vacation
b: We go fishing
a) a Λ ~b
b) b→a
c) ~a → ~b
d) ~b → ~a
a) p∧q
b) p ∧ (q ∨ r)
c) q → (p ∧ r)
d) ( ∼ r ∧ ∼ q) → ∼ p
2.4.1 Tautology
Example 7:
i. R ∨ ~R
R ~R R ∨ ~R
T F T
F T T
2.4.2 Contradiction
Example 8:
i. ~(R ∨ ~R)
R ~R R ∨ ~R ~( R ∨ ~R)
T F T F
F T T F
2.4.3 Contingency
Example 9:
i. R ~R
R ~R R (~R)
T F F
F T T
ii. ~P∧(P∨Q)
P Q ~P P∨Q ~P∧(P∨Q)
T T F T F
T F F T F
F T T T T
F F T F F
iii. ~(P∧Q)∧(~R)
i. ~(P∧Q) [(~P)∧(~Q)]
ii. [~P∧(P∨Q)] Q
iii. (~P∧R) [(P∨Q)∧(~Q)]
iv. [(Q R)∨(~P)] [~(P∧(~R))∧Q]
v. ~(R ~Q) (~P∨~R)