lecture 6
lecture 6
Lecture No 06
Ameer Hamza
Logic
► Negation
► The negation of P, written , is the statement obtained by
negating statement P is
► Example:
► P: A is a consonant
► : it is the case that A is not a consonant
P
► Truth Table
T F
F T
Conjunction
(p ν ¬q) → (p Λ q).
Example:
► A Contingency is a formula which has both some true and some false
values for every value of its propositional variables.
Example:
► Let p denote the proposition "Jill plays basketball" and q denote the
proposition "Jim plays soccer." Write out-in the clearest way you can-what the
following propositions mean:
Example:
► Translate the following expressions of propositional logic into words using the
following
► translation of the proposition letters:
► p = "All the world is apple pie."
► q = "All the seas are ink'"
► r = "All the trees are bread and cheese."
► s = "There is nothing to drink."
► t = "Socrates was a man."
► u = "All men are mortal."
► v = "Socrates was mortal."
Example:
Translate the following expressions into propositional logic. Use the following proposition letters:
p = "Jones told the truth."
q = "The butler did it."
r - "I'll eat my hat."
s = "The moon is made of green cheese."
t - "If water is heated to 100 0C, it turns to vapor."
(a) "If Jones told the truth, then if the butler did it, I'll eat my hat."
(b) "If the butler did it, then either Jones told the truth or the moon is made of greencheese, but not
both."
(c) "It is not the case that both Jones told the truth and the moon is made of greencheese."
(d) "Jones did not tell the truth, and the moon is not made of green cheese, and I'llnot eat my hat."
(e) "If Jones told the truth implies I'll eat my hat, then if the butler did it, the moon ismade of green
cheese."
(f) "Jones told the truth, and if water is heated to 100 0C, it turns to vapor."
A = "Alice is at home."
𝐵 = "Bob is at the park."
C = "Charlie is studying."
D = "It's raining."
E = "The lights are on.“
"If Alice is at home, then Bob is not at the park.“
"Charlie is studying if and only if it's raining.“
"Either Alice is at home or Charlie is studying, but not both.“
"If it's raining, then the lights are on.“
"If the lights are on, then it's either raining or Alice is at home.“
"If Charlie is studying, then both Alice is at home and Bob is at the park."
Expression Trees for Formulas
► An expression tree is simply a visual representation for the way that a formula
is built from propositions and logical operators. A proposition is represented
by a single node, simply a filled-in circle.
Example:
Propositional Logic
►
Logical Gates and Combinatorial Circuits
Logical Gates and Combinatorial Circuits
32
Logical Gates and Combinatorial Circuits
Draw a circuit diagram for δ = (xy' + x'y)z.
Example:
Elementary Product (conjunction, AND)
► Example:
conjunctive normal form
►
Predicates
► Example:
► Is “𝑥>1” True or False?
► Is “𝑥 is a great tennis player”
Predicate:
► The domain of a predicate variable is the set of all possible value that amy
substitute in place of variable
► Example:
► We need quantifiers to express the meaning of English words including all and
some:
► “All students in this class are computer science majors”
► “There is a math major student in this class”
► The two most important quantifiers are:
Universal Quantifier, “For all,” symbol: ∀
Existential Quantifier, “There exists,” symbol: ∃
Question:
Question:
Example:
► Let C(x) be the statement "x has a cat," let D(x) be the statement "x has adog," and
let F(x) be the statement "x has a ferret." Express each of thesestatements in terms
of C(x), D(x), F(x), quantifiers, and logical connectives.Let the domain consist of all
students in your class.
► a) A student in your class has a cat, a dog, and a ferret.
Solution: x (C(x) ^ D(x) ^ F(x))
► b) All students in your class have a cat, a dog, and a ferret.
Solution: Vx (C(x) ^ D(x) ^ F(x))
► c) Some student in your class has a cat and a ferret, but not a dog.
Solution: x (C(x) ^ F(x) ^¬D(x))
► d) No students in your class has a cat, a dog, and a ferret.
Solution: Vx ¬ (C(x) ^ D(x) ^ F(x))