You are on page 1of 54

Logic, mathematical

Reasoning and Counting


How to contact?

tmnguyettlu@gmail.com

0983058375
OBJECTIVES

The student is expected to be able to:


• Understand mathematical reasoning and know how to construct
mathematical arguments;

• know how to work with many basic and important discrete


structures such as sets, functions;

• Understand some basic and advanced counting techniques.

- Mathematical reasoning/argument: suy luận toán học


- Discrete structures: cấu trúc rời rạc
- Counting techniques: kỹ thuật đếm
MATERIALS
 TEXTBOOK: Kenneth H. Rosen, "Discrete Mathematics and its
Applications" , 6th edition, McGraw-Hill Education Publisher.

 SUPPLEMENTARY DOCUMENTS:

• Study guide: “Mathematical Terminologies”

• Lecture videos/Slides and exercise videos

All these are available at https://elearning.thanglong.edu.vn


SCHEDULE
Chapter Contents
1 The Foundations: Logic and Proofs
(1.1  1.6)
2 Basic Structures: Sets, Functions, Sequences,
and Sums
(2.1, 2.2, 2.3)
4 Induction and Recursion
(4.1, 4.3)
5 Counting
(5.1  5.5)
7 Advanced Counting Techniques
(7.1, 7.2)
ASSESSMENT
Chapter Contents
1 The Foundations: Logic and Proofs
(1.1  1.6)
2 Basic Structures: Sets, Functions,
Sequences, and Sums
(2.1, 2.2) Midterm test – No. 1
4 Induction and Recursion
(4.1, 4.3)
5 Counting
(5.1, 5.2) Midterm test – No. 2
7 Advanced Counting Techniques
(7.1, 7.2)
ASSESSMENT
How can your mark be calculated?

01 02 03 04

MIDTERM TEST 2
MIDTERM TEST 1
Attendance

FINAL TEST
Total mark 100%
• Attendance: 13%
• Midterm Tests: 27%
• Final Test: 60%
Attendance

Work Percentages

Attending Class/Online Class 50%

Doing Online Theory Test 50%


CLASS REGULATION

DO

- Have notebook

- Have textbook

- Feel free to ask any questions.


The Foundations: Logic
and Proofs
Chapter 1, Part I: Propositional Logic
Chapter Summary
Propositional Logic
The Language of Propositions
Applications
Logical Equivalences
Predicate Logic
The Language of Quantifiers
Logical Equivalences
Nested Quantifiers
Proofs
Rules of Inference
Proof Methods
Propositional Logic Summary
The Language of Propositions
Connectives
Truth Values
Truth Tables
Applications: (giải thích nghĩa ra)
Translating English Sentences
Logical Equivalences
Important Equivalences
Showing Equivalence
Propositional Logic
Section 1.1
Section Summary
Propositions
Connectives
Negation
Conjunction
Disjunction
Implication; contrapositive, inverse, converse
Biconditional
Truth Tables
Propositions
A proposition is a declarative sentence (câu trần thuật)
that is either true or false (đúng hoặc sai), but not
both.
Question: What is a proposition?

A proposition a declarative sentence

either true or false

- Proposition: mệnh đề
- Declarative sentence: câu trần thuật
Example 1
Which of these sentences are propositions?
a) Hanoi is the capital of Vietnam. ->MĐ proposition
b) The Moon is made of green cheese. -> MĐ
c) Sit down!
d) What time is it?
Example 1
Which of these sentences are propositions?
a) Hanoi is the capital of Vietnam. (It is a proposition and it is true)

b) The Moon is made of green cheese. (It is a proposition and it is false)

c) Sit down! (It is NOT a proposition because it is NOT declarative sentences)

d) What time is it? (It is NOT a proposition because it is NOT declarative sentences)

Imperative sentence: câu mệnh lệnh


Interrogative sentence: câu nghi vấn/câu hỏi
Exclamative sentence: câu cảm thán
Example 2
Which of these sentences are propositions?
a) 1+0=1
b) 0+0=2
c) x+1=2

1 + 0 = 1: one plus zero equals/is equal to one


5 – 3 = 2: five minus 3 equals 2
3 x 5 = 15: three times/multiplied by five equals fifteen
3/5 = 0.6: three divided by five equals zero point six
Example 2
Which of these sentences are propositions?
a) 1 + 0 = 1 (It is a proposition and it is true)
b) 0 + 0 = 2 (It is a proposition and it is false)
c) x + 1 = 2 (It is NOT a proposition because it is neither true nor false)
Truth value Giá trị chân lý
We use letters to denote propositional variables
biến mệnh đề and the conventional letters are p, q, r,
s, …
If a proposition is true, then we say that the truth
value of it is true, denoted by T.
If a proposition is false, then we say that the truth
value of it is false, denoted by F.

Propositional variables: biến mệnh đề


Truth value: giá trị chân lý
Constructing Propositions

Many
  mathematical statements are constructed by combining one or
more propositions.
(New propositions, called compound propositions mệnh đề phức
hợp)

 Compound Propositions: constructed from logical operators


(= connectives) (logical connectives) and other propositions.
 Negation ¬ Conjunction ∧
 Disjunction ∨ Exclusive or
 Implication → Biconditional ↔

Compound Propositions : mệnh đề phức hợp


Logical operators: phép toán logic
Negation
Definition 1: The negation of a proposition p, denoted by
¬p is the statement:
“It is not the case that p”.
The truth value of ¬p is the opposite of the truth value of
p.
The truth table:
p ¬p
T F
F T

Negation: Phép phủ định


¬p is read "not p”.
Negation
Example: Find the negation of the proposition
“The earth is round.”
and express this in simple English.

Solution:
The negation is
“It is not the case that the earth is round.”
This negation can be more simply expressed by
“The earth is not round.”
Conjunction
Definition 2. Let p and q be propositions. The
conjunction of propositions p and q, denoted by p ∧ q ,
is the proposition “p and q”.

The conjunction p ∧ q is true when both p and q are true


and is false otherwise.

Conjunction: Phép hội


p ∧ q is read “p and q”.
Conjunction
The truth table.
? Question: How many rows are there in the truth table
of p ∧ q ?

p q p∧q
Conjunction
Example: Find the conjunction of the propositions p
and q, where
• p: “I am at home.”
• q: “I am attending class.”

Solution: The conjunction of p and q, p ∧q, is


“I am at home and I am attending class.”
Notes
The word “but” sometimes is used instead of “and” in a
conjunction. For example,
“The sun is shining, but it is raining”
is another way of saying
"The sun is shining and it is raining“.

(In natural language, there is a subtle difference in


meaning between "and" and "but"; we will not be
concerned with this nuance here.)
Disjunction
Definition 2. Let p and q be propositions. The
Disjunction of propositions p and q, denoted by p ∨q,
is the proposition “p or q”.
The disjunction p ∨q is false when both p and q are false
and is true otherwise.

Disjunction: Phép tuyển


p ∨q is read “p or q”.
Disjunction
The truth table:

p q p ∨q
Disjunction
Example: Find the disjunction of the propositions p and
q, where
• p: “I am at home.”
• q: “I am attending class.”

Solution: The disjunction of p and q, p ∨q, is


“I am at home or I am attending class.”
Notes
There are two ways that the word or is used in English:
• in an inclusive sense (both is ok)
• in an exclusive sense (both is NOT)

The use of the connective or in a disjunction “p or q” is


in an inclusive way.

Inclusive: bao hàm


Exclusive: loại trừ
Exclusive Or
Definition
  4. The exclusive or of propositions p and q,
denoted by p q , is the proposition “p or q (but not both)”.
p q is true when exactly one of p and q is true and is false
otherwise.
The truth table

p q p ⊕q
T T F
T F T
F T T
F F F
Exclusive Or
 
Example: Let
• p: “I am at home.”
• q: “I am attending class.”
Then p q :
“I am at home or I am attending class but not both”
Inclusive or Exclusive

(a): Inclusive/Exclusive

(b) Inclusive/Exclusive

(c) Inclusive/Exclusive

(d) Inclusive/Exclusive
Implication
 Definition 5. 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 p →q: p is the hypothesis (premise)


q is the conclusion (sequence).

Conditional statement : phép kéo theo


p →q is read “if p then q”
Hypothesis /premise: giả thiết
Conclusion /sequence: kết luận
If I have more money than Bill Gates,
then I buy you a new car.

In what cases this promise is ok?

p q p →q
T T T
T F F
F T T
F F T
Different Ways of Expressing p →q
if p, then q p implies q p only if q
if p, q q if p
q when p q whenever p
p is sufficient for q q is necessary for p

sufficient necessary

p q

p is sufficient for q: p là điều kiện đủ của q


q is necessary for p: q là điều kiện cần của p
Implication
Example: Write each of these statements in the form
“if p, then q”:
a) Maria will find a good job when she learns discrete
mathematics.
b) It is necessary to have a valid password to log on to the
server.
Solution:
Converse, Contrapositive, and Inverse
From p →q we can form new conditional statements .
 q →p is the converse of p →q
¬ p → ¬ q is the inverse of p →q
 ¬q → ¬ p is the contrapositive of p →q

Example: Find the converse, inverse, and contrapositive of


“If I have more money than Bill Gates, then I buy you a new car.”
Solution:
Converse:
Inverse:
Contrapositive:
Biconditional
 Definition 6. 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.

p q p ↔q
T T T
T F F
F T F
F F T

Biconditional statement : phép tương đương


p ↔ q is read “p if and only if q”
Biconditional
Example. If p denotes “I pass the exam.”
and q denotes “I study hard.”
then p ↔q denotes
“I pass the exam if and only if I study hard.”
Expressing the Biconditional
Some alternative ways “p if and only if q” is expressed
in English:

 p is necessary and sufficient for q


 if p then q , and conversely
 p iff q
Section Summary
p q ¬p p∧q p ∨q p ⊕q p →q p ↔q

T T F T T F T T

T F F F T T F F

F T T F T T T F

F F T F F F T T
Section Summary
Propositions
Logic operators
Negation
Conjunction
Disjunction
Implication; contrapositive, inverse, converse
Biconditional
Truth Tables
Precedence of Logical Operators
Operator Precedence
 1
 2
3

 4
5

p q  r is equivalent to
(p q)  (r)
If the intended meaning is p (q  r )
then parentheses must be used.
Example Truth Table
Construct a truth table for

 How many rows are there in a truth table of


Number of rows = 2^3 =8 ( p,
q, r mỗi mđ có 2 TH failse or
true)
 How many rows are there in a truth table with n propositional
variables?

Number of rows = 2^n


Example Truth Table
Construct a truth table for
p q r r pq p  q → r
T T T F T F
T T F T T T
T F T F T F
T F F T T T
F T T F T F
F T F T T T
F F T F F T
F F F T F T
Example Truth Table
Construct a truth table for (p  q) → r
p q r r pq (p  q) → r
T T T F T F
T T F T T T
T F T F T F
T F F T T T
F T T F T F
F T F T T T
F F T F F T
F F F T F T
Truth Tables For Compound Propositions
Construction of a truth table:
Rows
 Need a row for every possible combination of values for
the atomic propositions.
Columns
Need a column for the compound proposition (usually
at far right)
Need a column for the truth value of each expression
that occurs in the compound proposition as it is built
up.
Example Truth Table
 Construct a truth table for

p q p Vq (p v q) -> p
t T
t F
f T
f F
Translating English Sentences
Steps to convert an English sentence to a statement in
propositional logic
Identify atomic (nhỏ nhất, kh phân chia được nữa)
propositions and represent using propositional variables.
Determine appropriate logical connectives
“If I go to the park (atomic) or to the country (atomic nữa),
I will not go shopping.” Sau đây là các bước identify atomic
proposition.
p: I go to the park If p or q then not
q: I go to the country. r.
r: I will go shopping.
Example
Problem: Translate the following sentence into
propositional logic:
“You can access the Internet from campus 9->p) if you
are a computer science major (->q) or you are not a
freshman (->r).”
Solution:
p if (q or r)
(q v not r) -> p
THANK YOU
FOR YOUR ATTENTION

ANY QUESTIONS?

You might also like