You are on page 1of 23

STATEMENTS RELATED TO THE CONDITIONAL STATEMENT

 Converse- The converse of p→q is formed by interchanging p with q. q→p


 Inverse: The inverse of p→q is formed by negating both p and q. ̃p→ ̃q
 Contrapositive: The contrapositive of p→q is formed by negating both p and q
and interchanging these negated statements. ̃q→ p
̃
Truth Table for related statements.

p q ̃p ̃q q→p ̃p→ ̃q ̃q→ ̃p

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

in bit multiples called bytes.

 Computers represent information using bits.

 A bit (short for binary digit) is a symbol with two possible values, 0 and 1.

 By convention, 1 represents T (true) and 0 represents F (false).

 replace true by 1 and false by 0 in logical operations.


BITWISE AND

p q p∧q
1 1 1
1 0 0
0 1 0
0 0 0

-if both of the bits are 1, the result on that position is 1.


BITWISE OR
p q p∨q
1 1 1
1 0 1
0 1 1
0 0 0
-if any one of the bit is 1, the result on that position is 1.
BITWISE XOR
p q p  q
1 1 0
1 0 1
0 1 1
0 0 0

-if the bits are different, the result on that position is 1.


A BIT STRING is a sequence of zero or more bits. The length of this string is the

number of bits in the string.

Example: 1010 , the length is 4.

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

the corresponding bits in the two strings, respectively.


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 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

You might also like