0% found this document useful (0 votes)
2 views56 pages

lecture 6

The document covers fundamental concepts of logic in discrete mathematics, including propositions, propositional logic, and logical operations such as negation, conjunction, disjunction, implication, and biconditional. It also discusses predicates, quantifiers, and their applications in expressing mathematical statements. Additionally, the document includes examples and truth tables to illustrate these concepts.

Uploaded by

mabiba1225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views56 pages

lecture 6

The document covers fundamental concepts of logic in discrete mathematics, including propositions, propositional logic, and logical operations such as negation, conjunction, disjunction, implication, and biconditional. It also discusses predicates, quantifiers, and their applications in expressing mathematical statements. Additionally, the document includes examples and truth tables to illustrate these concepts.

Uploaded by

mabiba1225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Discrete Mathematics

Lecture No 06
Ameer Hamza
Logic

► Logic – used to distinguish between valid and invalid mathematical arguments.


► Logic was developed by Aristotle
► Application in computer science – design computer circuits, construction of
computer program, verification of the correctness of programs.
► Logic is a system based on proposition
proposition

► A proposition is a declarative sentence (a sentence that declares a fact) that


is either true or false, but not both
► Are the following sentences propositions?
► Islamabad is the capital of Pakistan
► 1+2=3
► x+1=2
Propositional Logic

► Propositional Logic – the area of logic that deals with propositions


► Propositional Variables – variables that represent propositions: p, q, r, s
► E.g. Proposition p – “Today is Friday.”
► Truth values – T, F
Negation

► 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

► Let P and Q be statements. The conjunction of P


and Q, written P ^ Q , is the statement formed by
joining statements P and Q using the word “and”
► The statement P ^ Q is true if both p and q are true; otherwise P ^ Q is
false
► Truth Table for Conjunction:
Disjunction

► Let P and Q be statements. The disjunction of P and Q, written P


v Q , is the statement formed by joining statements P and Q using
the word “or”
► The statement P v Q is true if at least one of the statements P and
Q is true; otherwise P v Q is false
► The symbol v is read “or”

► Truth Table for Disjunction:


Implication

► Let P and Q be statements. The statement “if P then Q” is called


an implication or condition.
► The implication “if P then Q” is written P → Q
► P is called the hypothesis, Q is called the conclusion
► Let p and q be propositions. The conditional statement p → q, is
the proposition “if p, then q.” The conditional statement is false
when p is true and q is false, and true otherwise.
► Truth Table for Implication:
Biconditional

► 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.
Implication

► Let P: Today is Sunday and Q: I will wash the car.


► P→Q:
If today is Sunday, then I will wash the car
► The converse of this implication is written
If I wash the car, then today is Sunday

► The inverse of this implication is


If today is not Sunday, then I will not wash the car

► The contrapositive of this implication is


If I do not wash the car, then today is not Sunday
Example:

► Example: Construct the truth table of the compound proposition

(p ν ¬q) → (p Λ q).
Example:

Prove that ¬[r∨(q∧(¬r → ¬p ))] ≡ ¬r∧(p∨¬q)


by using a truth table.
Example:
► A tautology is a statement that is true in every row of the table.

► It’s a contradiction if it’s false in every row.

► 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

► Logic and Bit Operations


► Computers represent information using bits.
► A bit is a symbol with two possible values, 0 and 1.
► By convention, 1 represents T (true) and 0 represents F (false).
► A variable is called a Boolean variable if its value is either true or false.
► Bit operation – replace true by 1 and false by 0 in logical operations.
Using Gates to Represent Formulas


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)

► A product of the variables and their negations in a


formula is called an elementary product. (product means
conjunction)
► Then P, ┐P^Q, ┐Q^P, P^┐P and Q^┐P are elementary
products.
Elementary Sum (Disjunction, OR)

► An elementary sum is a sum of literals


► e.g. P ∨ ¬ Q, P ∨ ¬ R are elementary sum

► There are two types of Normal Form


► DNF
► CNF
Disjunctive normal form (DNF)

► A statement from which consist of disjunction between conjunction is called


DNF

► Example:
conjunctive normal form

► A statement from which consist of Conjunction between disjunction is called


CNF
► Example:
Rules:
Rules of implication and Biconditional:
Question


Predicates

► Propositional logic is not enough to express the meaning of all statements in


mathematics and natural language.
► A property or relationship between objects is called a predicate.

► Example:
► Is “𝑥>1” True or False?
► Is “𝑥 is a great tennis player”
Predicate:

► A predicate P(x) is a sentence that contains a finite number of variables and


becomes a proposition when specific value are substituted for the variables.

► Where p(x) is a propositional function and x is a predicate variable


Example

► The following are predicates:


► (a) Let P(x, y, z) denote "x + y = z."
► (b) Let Q(x1 , X2) denote "xl - x2 > 0."
► (c) Let M(x, y) denote "x is married to y."
► (d) Let E(x, y) denote "x = y.
Domain

► The domain of a predicate variable is the set of all possible value that amy
substitute in place of variable

► Example:

► X is a great tennis player Domain is x= {ali, hamza------}


► x is set of all human begin
Quantifiers

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

You might also like