Ex 1.2 Applications of Propositional Logic
Ex 1.2 Applications of Propositional Logic
1
● Draw truth table of p ∨ (q ∧ r)
● Number of variables = 3
● Number of rows = 23 = 8
Truth table (Example)
2
● Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r)
are logically equivalent
Applications of propositional logic
3
● Example:
if you are senior citizen and it is a Tuesday then
a b
you can have free coffee
c
● Example:
if you are senior citizen and it is a Tuesday then
a b
you can have free coffee
c
● Example:
if you are senior citizen and it is a Tuesday then
a b
you can have free coffee
c
Example:
“Ali is not wealthy but he is healthy and wise.”
Translating English Sentences
12
Example:
“Ali is not wealthy but he is healthy and wise.”
Translating English Sentences
13
Example:
“Ali is not wealthy but he is healthy and wise.”
h = “Ali is healthy”
w = “Ali is wealthy”
s = “Ali is wise”
Translating English Sentences
14
Example:
“Ali is not wealthy but he is healthy and wise.”
w = “Ali is wealthy”
h = “Ali is healthy”
s = “Ali is wise”
~wɅhɅs
Translating English Sentences
15
Example:
If it is below freezing, it is snowing.
Translating English Sentences
16
Example:
If it is below freezing, it is snowing.
Translating English Sentences
17
Example:
If it is below freezing, it is snowing.
h = it is below freezing
w = it is snowing
Translating English Sentences
18
Example:
If it is below freezing, it is snowing.
h = it is below freezing
w = it is snowing
hw
Translation
19
• Example:
You can have free coffee if you are senior citizen
a b
and it is a Tuesday.
c
• Example:
You can have free coffee if you are senior citizen
a b
and it is a Tuesday.
c
Step 3: rewrite the sentence in propositional
logic
bɅc→a
Logic Circuits
24
A A
Input Output
A A
0 1
1 0
Conjunction / AND Gate
27
A
C = A ɅB
B
Inputs Output
A B C = A ɅB
0 0 0
0 1 0
1 0 0
1 1 1
Disjunction /OR gate
28
A
C=AV
B B
Inputs Output
A B C=A VB
0 0 0
0 1 1
1 0 1
1 1 1
Exclusive-OR
(XOR) 29
A C =A
B
B
Inputs Output
A B C =A B
0 0 0
0 1 1
1 0 1
1 1 0
Example
30
C
Example
31
AND
A AɅB
A Ʌ BVC
B
C
OR
Example
32
C
Example
33
A
D=~A Ʌ B v C
NOT
B BvC AND
C OR
Class Activity
34
A
B
Class Activity
35
B
C= AvB Ʌ ~A Ʌ B
A ɅB ~A Ʌ B AND
AND NOT
Class Activity
36
• Determine the output for combinatorial
circuit
Example
37
AND
A A∧
B
B A ∧ B∨C
C
OR
Example
39
• Q: 1,3,5,7,41,43