Professional Documents
Culture Documents
Week 01 - 1 - Propositoinal Logic
Week 01 - 1 - Propositoinal Logic
• Advantages
Quizzes 20%
Midterm X 2 40%
Final 30%
• Advantages
1. Discrete Mathematics and its applications, 8th Edition, Kenneth Rosen, Mc Graw
Hill, 2019, ISBN-13: 9781259676512
❑ Propositional Logic –
✔ Overview
✔ Connectives
❑ Compound Propositions
✔ Construct the truth table Local Environment Setup
p q p∨q
Translate the statement “Students who have taken calculus or
T T T introductory computer science can take this class”
p p Solution: The negation is “It is not the case that Michael’s PC runs Linux.”
This negation can be more simply expressed as
“Michael’s PC does not run Linux.”
T F
Solution : The negation is “It is not the case that Vandana’s smartphone has
at least 32 GB of memory.” This negation can also be expressed as Vandana’s
smartphone does not have at least 32 GB of memory”
Conditional Statements (implies)
Definition: Let p and q be propositions. The conditional statement p
→ q is the proposition “if p, then q.” The conditional statement p → q is
false when p is true and q is false, and true otherwise. In the conditional
statement p → q, p is called the hypothesis and q is called the
conclusion (or consequence).
Let p be the statement “Maria learns discrete mathematics”
p q p→q and q the statement “Maria will find a good job.” Express the
statement p → q as a statement in English.
T T T
p→q= p∨q
p q p→q p p∨q
T T T F T
T F F F F
F T T T T
F F T T T
Bi-conditional (iff)
Definition: Let p and q be propositions. The biconditional statement
p ↔ q is the proposition “p if and only if q.” The biconditional statement
p ↔ q is true when p and q have the same truth values, and is false
otherwise. Biconditional statements are also called bi-implications.
p q p↔q
T T T
Let p be the statement “You can take the flight,” and let q be
T F F the statement “You buy a ticket.”
Then p ↔ q is the statement
F T F
Solution: “You can take the flight if and only if you buy a ticket.”
F F T This statement is true if p and q are either both true or both false
Compound Propositions
Construct the truth table of the compound proposition
(p ∨ q) → (p ∧ q).
p q q p∨ q p∧q (p ∨ q) → (p ∧ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F
Class Task
a) p ∧ p
b) p ∨ p
c) (p ∨ .q) → q
d) (p ∨ q) → (p ∧ q)
e) (p → q) ↔ ( q → p)
f ) (p → q) → (q → p)
Applications of Propositional Logic
Translation English statement into logical
expressions,
• logic is used in the specification of software and hardware, because these
specifications need to be precise before development begins.
• Furthermore, propositional logic and its rules can be used to design computer
circuits, to construct computer programs, to verify the correctness of programs,
and to build expert systems
How can this English sentence be translated into a logical expression?
Example 1: “You can access the Internet from campus only if you are a computer science major or
you are not a freshman.”? Solution 1: a → (c ∨ ¬f ).
Example 1: “You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16
years old.” Solution 1: (r ∧ ¬s) → ¬q.
Examples
• How can this English sentence be translated into a logical expression?
Example 1: “The automated reply cannot be sent when the file system is full” using logical
connectives..”? Solution 1: q → ¬p.
a) “The message is scanned for viruses whenever the message was sent from an
unknown system.”
b) “The message was sent from an unknown system but it was not scanned for
viruses.”
c) “It is necessary to scan the message for viruses whenever it was sent from an
unknown system.”
d) “When a message is not sent from an unknown system it is not scanned for
viruses.”
Basic logic gates
Not x
x
x xy x xyz
And y y
z
x x+y x x+y+z
Or y
y z
x xy
Nand y
x x+y
Nor y
x xÅ y
Xor y
Examples
Find the output of the following circuit
x x+y
y (x+y)y
y
• Answer: (x+y)y
• Or (xy)y
Examples
x
x xy xy
y
y
• Answer: xy
• Or (xy) ≡ xy
Examples
• Write the circuits for the following Boolean algebraic
expressions
__
a) x+y
_______
b) (x+y)x
c) p q (p q) ¬(p q)
x y (x + y)(xy)
Thank you!
Darulaman Road
Kabul, Afghanistan
Main +93(0)729863447
auaf.edu.af