0% found this document useful (0 votes)
52 views20 pages

Chapter 1 - Propositional Logic

The document provides an introduction to propositional logic. It discusses: 1. The motivations for studying propositional logic including its applications in computer science fields. 2. The basic concepts of propositions, truth values, and propositional operators like negation, conjunction, disjunction, implication and their truth tables. 3. Examples of evaluating compound propositions and formalizing natural language propositions. 4. Useful logical equivalences to remember including double negation, distribution, De Morgan's laws, and conditional/bi-conditional equivalences.

Uploaded by

phamgiakhanh0709
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)
52 views20 pages

Chapter 1 - Propositional Logic

The document provides an introduction to propositional logic. It discusses: 1. The motivations for studying propositional logic including its applications in computer science fields. 2. The basic concepts of propositions, truth values, and propositional operators like negation, conjunction, disjunction, implication and their truth tables. 3. Examples of evaluating compound propositions and formalizing natural language propositions. 4. Useful logical equivalences to remember including double negation, distribution, De Morgan's laws, and conditional/bi-conditional equivalences.

Uploaded by

phamgiakhanh0709
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/ 20

Discrete Mathematics - MAD101

Chapter 1: Propositional Logic

Dr. Vu Khac Ky
[email protected]

Faculty of Mathematics, FPT University, Hanoi

April 11, 2022


Motivations:
I Logic is the basis of all mathematical reasoning
I Logic is foundation of automated reasoning
I Applications in: design of computer hardware (logic circuits),
artificial intelligence, programming languages, machine
translation,... and many other computer science fields.

(Propositional logic helps us to understand mathematical arguments


and proofs).
Propositional logic
A proposition is a statement that is either true or false (but not both).
Examples
I The water boils at 100 degrees Celsius.
I There are 12 students in Discrete Mathematics Class.
I Do you have a cat?
I x2 + 4 ≥ y.
I She is so sexy!
Remarks

I A proposition declares a fact (either correct or incorrect).


I A proposition can be viewed as a number with value 1 (true) or 0
(false).
I Therefore, propositional logic is a mathematical system that
works with 0 and 1 numbers.
Propositional Operators

1. Negation operator
I Notation: ¬p (sometimes ∼p).
I Examples:
1. He is rich −→ He is NOT rich.
2. The girl is pretty −→ The girl is NOT pretty.
3. Discrete math is not difficult −→ Discrete math is difficult.
I Truth table:
p ¬p
0 1
1 0
Propositional Operators

2. Conjunction operator (and)


I Notation: p ∧ q
I Examples:
1. p = "He is fat". q = "He is super rich".
−→ p ∧ q = He is fat BUT super rich.
2. p = "The school is closing". q = "The kids are not happy".
−→ The school is closing AND the kids are not happy".
I Truth table:
p q p∧q
0 0 0
0 1 0
1 0 0
1 1 1
Propositional Operators

3. Disjunction operator (or)


I Notation: p ∨ q
I Examples:
1. p = "She is smart". q = "She is hard-working".
−→ She is smart OR hard-working (cause she passed the
MAD101 course).
2. At least one of the suspects is the murder.
I Truth table:

p q p∨q
0 0 0
0 1 1
1 0 1
1 1 1
Propositional Operators

4. Exclusive-or operator (XOR)


I Notation: p ⊕ q
I Examples:
1. p = "She will marry Peter". q ="She will marry Tom."
−→ p ⊕ q = She will marry either Peter or Tom.
2. You never lose. You either win or learn.
I Truth table:

p q p⊕q
0 0 0
0 1 1
1 0 1
1 1 0
Propositional Operators

5. Implication
I Notation: p → q
I Examples:
1. p = "You don’t water your plants". q ="The plants die."
p → q = If you don’t water your plants, they will die.
2. If I am a billionaire, I will buy each of my students a Mercedes G63.
I Truth table:
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
Propositional Operators

6. Bi-conditional operator
I Notation: p ↔ q
I Examples:
1. x ≥ y ↔ x − y ≥ 0.
2. Two triangles are congruent if and only if all three pairs of
corresponding sides are congruent.
I Truth table:
p q p↔q
0 0 1
0 1 0
1 0 0
1 1 1
Precedence of Logical Operators

From high to low priority:


I 1. Negation
I 2. Conjunction
I 3. Disjunction
I 4. Exclusive-or
I 5. Implication
I 6. Bi-condition
Summarization (truth table):

p q ¬p p∧q p∨q p⊕q p→q p↔q


0 0 1 0 0 1 1 1
0 1 1 0 1 1 1 0
1 0 0 0 1 1 0 0
1 1 0 1 1 0 1 1
Example 1: Evaluating Compound Proposition

Evaluate:
A = ¬p → (q ⊕ r → ¬p ∧ q) ↔ s
in which p = 0, q = 1, r = 0, s = 1.
Solution: Substitute p, q, r , s to the expression:

A = ¬0 → (1 ⊕ 0 → ¬0 ∧ 1) ↔ 1
= 1 → (1 ⊕ 0 → 1 ∧ 1) ↔ 1
= 1 → (1 ⊕ 0 → 1) ↔ 1
= 1 → (1 → 1) ↔ 1
= 1→1↔1
= 1↔1
= 1.
Example 2: Formalize a proposition
Let p, q, and r be the propositions
I p: Grizzly bears have been seen in the area.
I q: Hiking is safe on the trail.
I r: Berries are ripe along the trail.
Write the following propositions using p, q, and r and logical connectives
(including negations).
1. Berries are ripe along the trail, but grizzly bears have not been seen in
the area.
2. Grizzly bears have not been seen in the area and hiking on the trail is
safe, but berries are ripe along the trail.
3. If berries are ripe along the trail, hiking is safe if and only if grizzly bears
have not been seen in the area.
4. It is not safe to hike on the trail, but grizzly bears have not been seen in
the area and the berries along the trail are ripe.
5. For hiking on the trail to be safe, it is necessary but not sufficient that
berries not be ripe along the trail and for grizzly bears not to have been
seen in the area.
6. Hiking is not safe on the trail whenever grizzly bears have been seen in
the area and berries are ripe along the trail.
Example 2 (continue)
I p: Grizzly bears have been seen in the area.
I q: Hiking is safe on the trail.
I r: Berries are ripe along the trail.
Solution
1. Berries are ripe along the trail, but grizzly bears have not been seen in
the area. r ∧ ¬p
2. Grizzly bears have not been seen in the area and hiking on the trail is
safe, but berries are ripe along the trail. ¬p ∧ q ∧ r
3. If berries are ripe along the trail, hiking is safe if and only if grizzly bears
have not been seen in the area. r → (q ↔ ¬p)
4. It is not safe to hike on the trail, but grizzly bears have not been seen in
the area and the berries along the trail are ripe. ¬q ∧ ¬p ∧ r
5. For hiking on the trail to be safe, it is necessary but not sufficient that
berries not be ripe along the trail and for grizzly bears not to have been
seen in the area. q → (¬r ∧ ¬p)
6. Hiking is not safe on the trail whenever grizzly bears have been seen in
the area and berries are ripe along the trail. p ∧ r → ¬q
Tautology, Contradiction and Logical Equivalences
Definitions
A contradiction is a statement that is always false.
A tautology is a statement that is always true.
If p ↔ q is a tautology, then p is logically equivalent to q. We
denote by p ≡ q.

Remark
I Two statements p and q are said to be logically equivalent if they
have the same truth value in every model.
I A logical equivalence can be verified by comparing the two
corresponding columns in the Truth Table.

Example: Prove that p → q is logically equivalent to ¬p ∨ q

p q ¬p p→q ¬p ∨ q
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
1 1 0 1 1
Useful logical equivalences
A long list, but the most important to remember are:

I Double negation: ¬(¬p) ≡ p


I Distribution: p ∧ (q ∨ r ) ≡ p ∧ q ∨ p ∧ r
I De Morgan: ¬(p ∧ q) ≡ ¬p ∨ ¬q
I Conditional: p → q ≡ ¬p ∨ q
I Bi-conditional: p ↔ q ≡ (p → q) ∧ (q → p)
Quantifiers

Let P(x)= "x 2 ≥ 5".


I P(x) is not a proposition since its truth value is unknown.
I But if x = x0 is given, then P(x0 ) is a proposition.

Propositional function
A propositional function is a mapping P : X → {0, 1}, in which X is
a given set of parameters.

Examples
I P(x): "x is the prettiest girl in our school".
I Q(x, y ): "x loves y".
I R(x, y , z): x 2 + y 2 + z 2 ≥ 3xy + 3yz + 3xz.
Quantifiers
Definition
I Universal quantifiers (∀) : ∀x. x passes the MAD exam.
I Existential quantifiers (∃): ∃x. x wins "Best Student" award.
I Uniquely existential quantifiers (∃!): ∃!x. x 3 = 27.

Examples
Negation of Quantified Expressions

Rules

I ¬ ∀x.P(x) ≡ ∃x.¬P(x).

I ¬ ∃x.Q(x) ≡ ∀x.¬Q(x).
I Negation of universal is existential and vice versa.

Nested quatifications

You might also like