Logic & Circuit-2
Logic & Circuit-2
Discrete Mathematics
Structures
Email: 2019aqilkhan@gmail.com
Examples of Implies
Converse will not follow
p = Ali lives in Multan
q = Ali lives in Pakistan
If p then q not p unless q
p implies q q follows from p
If p, q q if p
p only if q q whenever p
p is sufficient for q
q is necessary for p
Implies →
1- An Implication is logically
equivalent to its counter positive.
p↔q≡q↔p
Example
1- If it is hot outside you buy an ice-
cream cone. And if you buy an ice-
cream cone it is hot outside
(p → q )ʌ (q → p)
You buy an ice-cream cone if and
only if it is hot outside
p↔q
Truth Table
(p → q ) ↔ (~q → ~p )
p q (p → q ) ~q ~p (~q → ~p ) (p → q ) ↔ (~q → ~p )
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T
p ʌ ~r ↔ q ˅ r
Truth Table
(p ↔ q ) ↔ (r ↔ q )
p q r p↔q r↔q (p ↔ q ) ↔ (r ↔ q )
T T T T T T
T F F T F F
T T T F F T
T F F F T F
F T T F T F
F T F F F T
F F T T F F
F F F T T T
Truth Table
~(p q ) ≡ p ↔ q
p q (p q ) ~(p q ) (p ↔ q )
T T F T T
T F T F F
F T T F F
F F F T T
Laws of Logic
1- Commutative Laws
e.g: p↔q ≡ q↔p
2- Implication Law
e.g: p→q ≡ ~ p ˅ q ≡ ~(p ʌ~ q)
3- Exportation Law
e.g: (p ʌ q)→ r ≡ p →(q → r)
Laws Of Logic
4- Equivalence Law
e.g: p ↔ q ≡ (p → q) ʌ (q → p)
Conclusion ∴C
Therefore my discrete mathematics
teacher is interesting
Valid Argument
An argument is valid if the
conclusion is True, when all the
premises are True.
That is :
p True
q False
p→q
Example
Show that the following argument
form is valid:
pq Premise
p Premise
∴q Conclusion
Truth Table
Premises Conclusion
p q p→q p q
T T T T T
T F F T F
F T T F T
F F T F F
Argument is valid
Invalid Argument
An argument is invalid if the
conclusion is False when all the
premises are True.
Premises Conclusion
p q p→q q p
T T T T T
T F F F T
F T T T F
F F T F F
Argument is invalid
Example
Use truth table to determine the
argument form:
pq Premise
p ~q Premise
pr Premise
∴r Conclusion
is valid or invalid ?
Truth Table
p q r p˅q p → ~q p→r r
T T T T F T T
T T F T F F F
T F T T T T T
T F F T T F F
HHKLLLKIJIUJU
F
F
T
T
T
F
T
T
T
T
T
T
T
F
F F T F T T T
F F F F T T F
Argument is invalid
Example
Let
t = Tariq is on team A
h = Hameed is on team B
If Tariq is not on team A, then
Hameed is on team B. ~ t h
If Hameed is not on team B, then
Tariq is on team A. ~ h t
∴ Tariq is not on team A or Hameed
is not on team B. ~ t ~ h
Truth Table
t h ~t ~h ~t→h ~h→t ~t˅~h
T T F F T T F
T F F T T T T
F T T F T T T
F F T T F F T
Argument is invalid
Example
t: my teacher is interesting
a: I stay awake
m:I am in Discrete Mathematics class
Argument is invalid
Switches
Switches In Series
Switches Light Bulb
P Q State
Closed Closed On
P Q P Q
open T T T
T F F
F T F
closed
F F F
Switches
Switches In Parallel
Switches Light Bulb
P Q State
Q Closed Closed On
Light bulb
Closed Open On
Open Closed On
P Q PQ
T T T
open
T F T
closed F T T
F F F
Gates
NOT-gate
A NOT-gate (or inverter) is a circuit with one input and
one output signal. If the input signal is 1, the output signal
is 0. Conversely, if the input signal is 0, then the output
signal is 1.
Input Output
P R
1 0
0 1
Gates
AND-gate
An AND-gate is a circuit with two input signals and one
output signal. If both input signals are 1, the output signal
is 1. Otherwise the output signal is 0.
Symbolic representation & Input / Output Table
Input Output
P
AND R P Q R
Q 1 1 1
1 0 0
0 1 0
0 0 0
Gates
OR - gate
An OR-gate is a circuit with two input signals and one
output signal. If both input signals are 0, then the output
signal is 0. Otherwise, the output signal is 1. Symbolic
representation & Input / Output Table
P
R
Q OR
Rules Of Circuits
Rule 1 = Inputs can be combined directly using gates
P Q ~R
Exercise
Find the Boolean expressions for the circuits and show that
they are logically equivalent, when regarded as statement
forms
Exercise