Professional Documents
Culture Documents
T T F F T T T
T F F T T T F
F T T F F F T
F F T T T T T
Example:
Write the converse, inverse, and contrapositive of
a) If m∠A is 35, then ∠A is an acute angle.
b) If you are an Olympian, then you are an athlete.
Solution (a.)
q→p: If ∠A is an acute angle, then m∠A is 35.
̃p→ q ̃ : If m∠A is not 35, then ∠A is not an acute angle.
̃q→ ̃p: If ∠A is not an acute angle, then m∠A is not 35.
Solution (b.)
q→p: If you are an athlete, then you are an Olympian.
̃p→ q ̃ : If you are not an Olympian, then you are not an athlete.
̃q→ ̃p: If you are not an athlete, then you are not an Olympian.
TAUTOLOGY, CONTRADICTION and CONTINGENCY
•A compound proposition that is always true no matter what the truth values of the propositions that
occur in it, is called TAUTOLOGY.
Example:
p ∨ ~p
p ~p p ∨ ~p
T F T
F T T
•A compound proposition that is always false is called CONTRADICTION.
Example:
p ∧ ~p
p ~p p ∧ ~p
T F F
F T F
•A compound proposition that is neither a tautology nor a contradiction is called CONTINGENCY.
Example:
(p → q ) → (p ∧ q)
p q p→q p∧q (p → q ) → (p ∧ q)
T T T T T
T F F F T
F T T F F
F F T F F
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T
T F
F T
F F
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T
T F F
F T T
F F T
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T F
T F F F
F T T T
F F T T
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T F F
T F F F T
F T T T F
F F T T T
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T F F T
T F F F T F
F T T T F T
F F T T T T
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T F F T T
T F F F T F T
F T T T F T T
F F T T T T T
Example
State whether the given proposition is a TAUTOLOGY, CONTRADICTION, Or a
CONTINGENCY by constructing the truth table.
(p → q) ↔ ( ~q → ~p)
Solution
p q p→q ~p ~q ~q → ~p (p → q) ↔ ( ~q → ~p)
T T T F F T T
T F F F T F T
F T T T F T T
F F T T T T T
TAUTOLOGY
BIT OPERATION
Bitwise is a level of operations that involves working with individual bits, which are the
smallest units of data in a computer. Each bit has a single binary value: 0 or 1. Although
computers are capable of manipulating bits, they usually store data and execute instructions
A bit (short for binary digit) is a symbol with two possible values, 0 and 1.
p q p∧q
1 1 1
1 0 0
0 1 0
0 0 0
The bitwise AND, bitwise OR, and bitwise XOR of two strings of the same length
are defined as the strings that have as their bits the connectives OR, AND, XOR of
Find (a) bitwise AND, (b) bitwise OR, and (c) bitwise XOR
Solution:
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
Bitwise AND : 0 1 0 0 0 1 0 1 0 0
Example:
Consider two bit strings 01101 10110 and 11000 11101.
Find (a) bitwise AND, (b) bitwise OR, and (c) bitwise XOR
Solution:
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
Bitwise OR : 1 1 1 0 1 1 1 1 1 1
Example:
Consider two bit strings 01101 10110 and 11000 11101.
Find (a) bitwise AND, (b) bitwise OR, and (c) bitwise XOR
Solution:
0 1 1 0 1 1 0 1 1 0
1 1 0 0 0 1 1 1 0 1
Bitwise XOR : 1 0 1 0 1 0 1 0 1 1