0% found this document useful (0 votes)
182 views259 pages

DHTDT CTRR

Discrete structures is the study of logical principles in mathematics used to represent discrete objects. These principles are used to distinguish between valid and invalid mathematical arguments, with a major goal being to understand and construct correct mathematical reasoning. Applications include computer circuit design, program construction, and program verification.
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)
182 views259 pages

DHTDT CTRR

Discrete structures is the study of logical principles in mathematics used to represent discrete objects. These principles are used to distinguish between valid and invalid mathematical arguments, with a major goal being to understand and construct correct mathematical reasoning. Applications include computer circuit design, program construction, and program verification.
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/ 259

DISCRETE STRUCTURES

Cấu Trúc Rời Rạc

TS Nguyễn Thị Huỳnh Trâm


What is discrete structures?
Web App Software AI

HTLM C++ Visual Basic Java Python Matlab


PHP C# C Pasca
If, for, while,l switch…case, function, class

C++ Python Matlab
if (dtb<5) { if GPA<5: if GPA<5
printf("Loại yếu"); printf(“Weak") disp("Weak")
} else { else: else:
printf("Loại TB"); printf(“Average") disp("Average")
} end
Cấu trúc rời rạc là môn học nghiên cứu về các qui luật logic của
toán học để biểu diễn các đối tượng rời rạc.
What is discrete structures?
“Discrete structures” is the study of logical principles in
mathematics used to demonstrate discrete subjects
Cấu trúc rời rạc là môn học nghiên cứu về các qui luật logic của
toán học để biểu diễn các đối tượng rời rạc.
These rules are used to distinguish between valid and invalid
mathematical arguments.
Major goal of this course: understand and construct correct
mathematical arguments.
Applications to computer science:
- The design of computer circuits
- The construction of computer programs
- The verification of the correctness of programs, and in many
other ways.
- Software systems have been developed for constructing some,
but not all, types of proofs automatically.
Logical Form
Ex.

An argument (lý luận) is a sequence of statements aimed at


demonstrating the truth of an assertion (khẳng định).
The assertion at the end of the sequence is called the conclusion
The preceding statements are called premises (tiền đề)
“p”, “q”, and “r” is used to represent component sentences.
“∴” stand for the word “therefore”
“not p” refer to the sentence “It is not the case that p”.
Logical Form
Ex. Two sentences below have very different content but their
logical form is the same.
Logical Form
Fill in the blanks below so that argument Ex1 has the same form
as argument Ex2. Then represent the common form of the
arguments using letters to stand for component sentences.
Ex1: If Nam is a math major or Nam is a computer science major,
then Nam will take Discrete Structure.
Nam is a computer science major.
Therefore, Nam will take Discrete Structure

Ex2: If logic is easy or _____(1)_______ then______(2)______.


I will study hard.
Therefore, I will get an A in this course
Logical Form
The common form of the arguments is
If p or q, then r. If p or q, then r.
∴ If not r, then not p and not q. q.
Therefore, r.
Fill in the blanks below so that argument Ex1 has the same form
as argument Ex2. Then represent the common form of the
arguments using letters to stand for component sentences.
Ex1: If Nam is a math major or Nam is a computer science major,
then Nam will take Discrete Structure.
Nam is a computer science major.
Therefore, Nam will take Discrete Structure
Ex2: If logic is easy or I (will) study hard then I will get an A in this
course.
I will study hard.
Therefore, I will get an A in this course
Statements (Mệnh đề)

Definition (statement)
A statement (or proposition) is a
sentence that is true or false, but
not both.
Mệnh đề (kí hiệu là p, q, r…) là
các khẳng định có giá trị chân lý
xác định: đúng hoặc sai nhưng
không thể vừa đúng vừa sai
Statements (Mệnh đề)
A statement (or proposition) is a sentence that is true or false,
but not both.
Ex 1.

Ex 2.

Ex 3. If logic is easy or I (will) study hard then I will get an A in this


course.
I will study hard.
Therefore, I will get an A in this course
Truth Value (Chân trị)

The truth value of a proposition is true, denoted by T or 1, if it is a


true proposition (mệnh đề đúng).
The truth value of a proposition is false, denoted by F or 0, if it is a
false proposition.
Statements (Mệnh đề)

Phát biểu Nhận xét Chân trị


p : Tôi đi học Không phải là mệnh đề vì không thể xác định
q: x ≠ 0 được đúng hay sai
r1: 1 ≠ 0 Mệnh đề đúng 1
r2: 0 ≠ 0 Mệnh đề sai 0
Statements (Mệnh đề)

-Các khẳng định dưới dạng tán thán hoặc mệnh lệnh không phải là mệnh
đề vì các câu này không có chân trị nhất định.
-Khẳng định “q: x khác 0” không phải là mệnh đề. Tuy nhiên nếu thay x
= 1 thì ta có mệnh đề đúng hoặc x =0 ta có mệnh đề sai. Khi đó khẳng
định này được gọi là vị từ.
Statements (Mệnh đề)

Phát biểu Nhận xét Chân trị


p : Bây giờ là mấy giờ? Không phải là mệnh đề vì không phải
là câu trần thuật. Đây là câu hỏi
q: Hãy đọc cái này cho Không phải là mệnh đề vì không phải
kỹ là câu trần thuật. Đây là câu mệnh
lệnh
1 1 Vị từ
r2: f(x, 𝑦) = +
𝑥 𝑦−3
1 1
Cho phương trình: f(x, 𝑦) = +
𝑥 𝑦−3
Điều kiện để phương trình xảy ra là ∀𝑥 x ≠ 0 𝐯à ∀𝑦, 𝑦 ≠ 3
Toán học C++
Điều kiện để phương float fxy =0, x =0, y=0; int n = 100;
trình xảy ra là x ≠ for(x =0; x<=n; x++)
0 𝐯à 𝑦 ≠ 3 for(y =0; y<=n; y++)
Miền xác định ∀𝑥, x ≠ 0, {
∀𝑦, 𝑦 ≠ 3 if (x!=0 && y !=3)
Nếu x ≠ 0 VÀ 𝑦 ≠ 3 thì {
1 1 fxy= (1/x)+(1/(y-3))
f(x, 𝑦) = +
𝑥 𝑦−3 printf (“f(x,y) =”, fxy )
Ngược lại }
Nếu x=0 HAY y = 3 else // (x!=0 || y !=3)
thì {
Phương trình vô printf (“Phương trình VN”)
nghiệm }
}
Toán học Các nghiệm của toán học
Các lần thực hiện của ngôn
ngữ lập trình C++
Điều kiện để phương trình xảy x = 1; y =2
ra là: 1 1
f 1,2 = + =0
x ≠ 0 𝐯à 𝑦 ≠ 3 1 2−3
Miền xác định ∀𝑥, x ≠ 0, x = 2, y=1
∀𝑦, 𝑦 ≠ 3 1 1
f 2,4 = + =0
2 1−3
Nếu x ≠ 0 và 𝑦 ≠ 3 thì x = 0, y =4
1 1 1 1
f(x, 𝑦) = + f(0,4) = +
𝑥 𝑦−3
0 4−3
Ngược lại Phương trình vô nghiệm
Nếu x=0 hay y = 3 thì
Phương trình vô nghiệm x = 3, y =3
1 1
f(0,4) = +
3 3−3
Phương trình vô nghiệm
Bài tập
1) Khẳng định nào sau đây là mệnh đề
a. Trần Hưng Đạo là 1 vị tướng tài
b. x+1 là một số nguyên dương
c. 9 là một số chẵn
d. Hôm nay trời đẹp làm sao!
e. Hãy học Cấu Trúc Rời Rạc đi
Bài tập
1) Khẳng định nào sau đây là mệnh đề
a. Trần Hưng Đạo là 1 vị tướng tài
b. x+1 là một số nguyên dương
c. 9 là một số chẵn
d. Hôm nay trời đẹp làm sao!
e. Hãy học Cấu Trúc Rời Rạc đi
Bài tập
1) Khẳng định nào sau đây là mệnh đề
a. Trần Hưng Đạo là 1 vị tướng tài
b. x+1 là một số nguyên dương (vị từ)
c. 9 là một số chẵn
d. Hôm nay trời đẹp làm sao!
e. Hãy học Cấu Trúc Rời Rạc đi
Bài tập
1) Khẳng định nào sau đây là mệnh đề
a. Trần Hưng Đạo là 1 vị tướng tài.
b. x+1 là một số nguyên dương (vị từ)
c. 9 là một số chẵn.
d. Hôm nay trời đẹp làm sao! (Câu cảm thán)
e. Hãy học Cấu Trúc Rời Rạc đi
Bài tập
1) Khẳng định nào sau đây là mệnh đề
a. Trần Hưng Đạo là 1 vị tướng tài
b. x+1 là một số nguyên dương (vị từ)
c. 9 là một số chẵn
d. Hôm nay trời đẹp làm sao! (Câu cảm thán)
e. Hãy học Cấu Trúc Rời Rạc đi (Câu ra lệnh)
Compound Statements
If x ≠ 0 and 𝑦 ≠ 3 then x = 1; y =2
1 1
f(x, 𝑦) = + statement
𝑥 𝑦−3

else Vị từ If {(1 ≠ 0) and [ ! 2 = 3 ]} then

If x=0 or y = 3 then Compound statements

No solution 1 1
f 1,2 = + =0
1 2−3
Statements (mệnh đề nguyên thủy, mệnh đề sơ cấp): Không
được xây dựng từ các mệnh đề khác nhờ các liên từ hoặc trạng
từ KHÔNG (!, ¬)
Compound Statements
If x ≠ 0 and 𝑦 ≠ 3 then x = 1; y =2
1 1
f(x, 𝑦) = + statement
𝑥 𝑦−3

else Vị từ If {(1 ≠ 0) and [ ! 2 = 3 ]} then

If x=0 or y = 3 then Compound statements

No solution 1 1
f 1,2 = + =0
1 2−3
Compound Statements (mệnh đề phức hợp): Là các mệnh đề
được xây dựng từ các mệnh đề khác nhờ liên từ kết chúng lại
như: Và (AND, ‫ٿ‬ ), Hay, Hoặc (OR, V), nếu…thì.. , trạng từ
KHÔNG (!, ¬, ~, NOT)
Compound Statements
If x ≠ 0 and 𝑦 ≠ 3 then x = 1; y =2
1 1
f(x, 𝑦) = + statement
𝑥 𝑦−3

else Vị từ If {(1 ≠ 0) and [ ! 2 = 3 ]} then

If x=0 or y = 3 then Compound statements

No solution 1 1
f 1,2 = + =0
1 2−3
If ( true statement) Propositional Calculus (Phép tính
action 1 mệnh đề): nghiên cứu chân trị của các
else // false statement mệnh đề phức hợp
action 2
Logical connectives
1) Negation (Phép phủ định): If p is a statement variable, the
negation of p is “not p” or “it is not the case that p” and is
denoted ~p or p or ~p or !p

( Phủ định của mệnh đề p: “không” p hay “phủ định của” p).

Ex 1: Find the negation of the proposition and express this in


simple English: “Michael’s PC runs Linux”
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.
Logical connectives
Ex 2: Find the negation of the proposition and express this in simple
English

“Vandana’s smartphone has at least 32GB of memory”

Solution: .

The negation is
“It is not the case that Vandana’s smartphone has at least 32GB of
memory.”
This negation can also be expressed as
“Vandana’s smartphone does not have at least 32GB of memory”
or even more simply as
“Vandana’s smartphone has less than 32GB of memory.”
Logical connectives
1) Negation (Phép phủ định):

The Truth Table for the Negation of a Propostion

(Bảng chân trị) : p p


1 0
0 1

If x ≠ 0 and ! ( 𝑦 = 3) then x = 1; y =2
1 1 1 0
f(x, 𝑦) = +
𝑥 𝑦−3
Else If 1 ≠ 0 && ! (2 = 3)
If x=0 or y = 3 then
No solution 1
1 1
f 1,2 = + =0
1 2−3
Logical connectives
2) Conjunction (Phép “Và”): if p and q are statement variables,
the conjunction of p and q is “p and q”, denoted p  q. It is true
when, and only when, both p and q are true. If either p and q is
false, or if both are false, p  q is false.

Phép nối liền (và, hội, giao) của hai mệnh đề p, q được kí hiệu
bởi p  q (đọc là “p và q”), là mệnh đề được xác định bởi : p  q
đúng khi và chỉ khi p và q đồng thời đúng.
p q pq
Truth Table for p  q 1 1 1
1 0 0
0 1 0
0 0 0
Logical connectives
Find the conjunction of the propositions p and q where p is the
proposition “Rebecca’s PC has more than 16 GB free hard disk
space” and q is the proposition “The processor in Rebecca’s PC
runs faster than 1 GHz.”
Solution:

The conjunction of these propositions, p ∧ q, is the proposition


“Rebecca’s PC has more than 16 GB free hard disk space, and
the processor in Rebecca’s PC runs faster than 1 GHz.”

This conjunction can be expressed more simply as “Rebecca’s


PC has more than 16 GB free hard disk space, and its
processor runs faster than 1 GHz.”
Logical connectives
Translating from English to Symbols: But and Neither-Nor
Write each of the following sentences symbolically, letting h = “It is
hot” and s = “It is sunny.”
a. It is not hot but it is sunny.
b. It is neither hot nor sunny.
Solution
a. The given sentence is equivalent to “It is not hot and it is sunny,”

which can be written symbolically as  h ꓥ s. (~ h ꓥ s )

b. To say it is neither hot nor sunny means that it is not hot and it is not sunny.

Therefore, the given sentence can be written symbolically as  h ꓥ  s

(~h ꓥ ~ s)
p q pq
Logical connectives
1 1 1
2) Conjunction
1 0 0
0 1 0
0 0 0
If x ≠ 0 and ! ( 𝑦 = 3) then x = 1; y =2 0
1 1 If 1 ≠ 0 && ! (2 = 3)
f(x, 𝑦) = +
𝑥 𝑦−3 1 1
Else
If x=0 or y = 3 then 1
No solution 1 1
f 1,2 = + =0
1 2−3
If ( true statement)
action 1
else // false statement
action 2
p q pq
Logical connectives
1 1 1
2) Conjunction
1 0 0
0 1 0
0 0 0
If x ≠ 0 and ! ( 𝑦 = 3) then x = 1; y =3
1 1 1
f(x, 𝑦) = +
𝑥 𝑦−3 If 1 ≠ 0 && ! (3 = 3)

Else 1 0
If x=0 or y = 3 then 0
No solution Else

If ( true statement)
action 1
else // false statement
action 2
Logical connectives
3. Disjunction (phép hoặc): If p and q are statement variable, the
disjunction of p and q is “p or q”, denoted p  q. It is true when
either p is true, or q is true, or both and q are true; it is false only
when both p and q are false.

Phép hoặc (nối rời, tuyển, hợp) của hai mệnh đề p, q được kí
hiệu bởi p  q (đọc là “p hay q”), là mệnh đề được định bởi : p 
q sai khi và chỉ khi p và q đồng thời sai.
p q pq
Truth Table for p  q 1 1 1
1 0 1
0 1 1
0 0 0
p q pq p q pq
Logical connectives 1 1 1 1 1 1
1 0 0 1 0 1
0 1 0 0 1 1
0 0 0 0 0 0

x = 1; y =3 1
If x ≠ 0 and ! ( 𝑦 = 3) then If 1 ≠ 0 && ! (3 = 3)
1 1
f(x, 𝑦) = + 1 0
𝑥 𝑦−3
0
Else Else
If x=0 or y = 3 then If x=0 || y = 3
No solution
0 1
1
No solution
p q pq p q pq
Logical connectives 1 1 1 1 1 1
1 0 0 1 0 1
0 1 0 0 1 1
0 0 0 0 0 0
p q pq p q pq
Logical connectives 1 1 1 1 1 1
1 0 0 1 0 1
0 1 0 0 1 1
0 0 0 0 0 0
Logical connectives
Inclusive-Or (HAY, OR) Exclusive-Or (p XOR q)(HOẶC)
( Phép nối rời , Phép tuyển) (Phép nối rời, Phép tuyển loại)

p q pq p q pq
𝐩 ⊕q
1 1 1 0 0 0
1 0 1 0 1 1
0 1 1 1 0 1
0 0 0 1 1 0
“Students who have taken calculus or computer science can
take this class.”
“Students who have taken calculus or computer science, but
not both, can enroll in this class.”
“Soup or salad comes with an entrée,”
Truth Table (Bảng chân trị)
The Truth Table for a given statement form displays the truth values that
correspond to all possible combinations of truth values for its component
statement variables
Bảng chân trị của dạng mệnh đề E(p,q,r): là bảng ghi tất cả các trường
hợp chân trị có thể xảy ra đối với dạng mệnh đề E theo chân trị của các
biến mệnh đề p, q, r.
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r
Nếu có n biến, bảng này sẽ có 2n 1
dòng, chưa kể dòng tiêu đề. 2
3
4
5
6
7
8
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0
2 0
3 0
4 0
5 1
6 1
7 1
8 1
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0 0
2 0 0
3 0 1
4 0 1
5 1 0
6 1 0
7 1 1
8 1 1
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0 0 0
2 0 0 1
3 0 1 0
4 0 1 1
5 1 0 0
6 1 0 1
7 1 1 0
8 1 1 1
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0 0 0
2 0 0 1
3 0 1 0
4 0 1 1
5 1 0 0
6 1 0 1
7 1 1 0
8 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0

2 0 0 1
3 0 1 0
4 0 1 1 1
5 1 0 0
6 1 0 1
7 1 1 0
8 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0 0

2 0 0 1 0
3 0 1 0 0
4 0 1 1 1
5 1 0 0 0
6 1 0 1 0
7 1 1 0 0
8 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0 0
2 0 0 1 0 p q pq

3 0 1 0 0
1 1 1
4 0 1 1 1 1 0 1
5 1 0 0 0 0 1 1
6 1 0 1 0 0 0 0

7 1 1 0 0
8 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r
0 1 0
1 0 0 0 0 0
0 0 0
2 0 0 1 0 0
p q pq
3 0 1 0 0 0

4 0 1 1 1
1 1 1
1 0 1
5 1 0 0 0
0 1 1
6 1 0 1 0 0 0 0
7 1 1 0 0

8 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r
0 1 0
1 0 0 0 0 0
0 0 0
2 0 0 1 0 0
p q pq
3 0 1 0 0 0

4 0 1 1 1 1 1 1 1
1 0 1
5 1 0 0 0 1
0 1 1
6 1 0 1 0 1
0 0 0
7 1 1 0 0 1

8 1 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r
0 1 0
1 0 0 0 0 0 0
0 0 0
2 0 0 1 0 0 0
p q pq
3 0 1 0 0 0

4 0 1 1 1 1
1 1 1
1 0 1
5 1 0 0 0 1
0 1 1
6 1 0 1 0 1
0 0 0
7 1 1 0 0 1

8 1 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0
0 0 0
2 0 0 1 0 0 0 p q pq
3 0 1 0 0 0 1
1 1 1
4 0 1 1 1 1 1
1 0 1
5 1 0 0 0 1 1
0 1 1
6 1 0 1 0 1 1 0 0 0
7 1 1 0 0 1 1

8 1 1 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0
0 0 0
2 0 0 1 0 0 0 p q pq
3 0 1 0 0 0 1
1 1 1
4 0 1 1 1 1 1 1
1 0 1
5 1 0 0 0 1 1
0 1 1
6 1 0 1 0 1 1 1 0 0 0
7 1 1 0 0 1 1

8 1 1 1 1 1 1 1
Truth Table p q pq
1 1 1
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r
1 0 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 1 0
1 0 0 0 0 0 0 0 0 0 0
2 0 0 1 0 0 0 0 p q pq
3 0 1 0 0 0 1 0
1 1 1
4 0 1 1 1 1 1 1
1 0 1
5 1 0 0 0 1 1 0 0 1 1
6 1 0 1 0 1 1 1 0 0 0
7 1 1 0 0 1 1 0

8 1 1 1 1 1 1 1
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0 0 0 0 0 0 0
2 0 0 1 0 0 0 0
3 0 1 0 0 0 1 0
4 0 1 1 1 1 1 1
5 1 0 0 0 1 1 0
6 1 0 1 0 1 1 1
7 1 1 0 0 1 1 0
8 1 1 1 1 1 1 1
Truth Table
Bảng chân trị của 2 dạng mệnh đề p∨(q∧r) và (p∨q) ∧r

p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r


1 0 0 0 0 0 0 0
2 0 0 1 0 0 0 0
3 0 1 0 0 0 1 0
4 0 1 1 1 1 1 1
5 1 0 0 0 1 1 0
6 1 0 1 0 1 1 1
7 1 1 0 0 1 1 0
8 1 1 1 1 1 1 1

Hai dạng mệnh đề p∨(q∧r) và (p∨q) ∧r có bảng chân trị khác nhau =>
Thứ tự thực hiện phép nối quan trọng và sự cần thiết của các dấu ()
Logically Equivalent (Tương đương logic)
Definition: Two statement forms are called logically equivalent
if, and only if, they have identical truth values for each possible
substitution of statements for their statement variables. The
logical equivalence of statement forms E and F is denoted by
writing 𝑬 ≡ 𝑭 or E⇔ F (Hai dạng mệnh đề E và F được nói là
tương đương logic nếu chúng có cùng bảng chân trị)

Ex p q pꓥq qꓥp
p ꓥ q and q ꓥ p always have the
0 0 0 0
same truth values, hence they
0 1 0 0 are logically equivalent.
1 0 0 0
1 1 1 1
Logically Equivalent (Tương đương logic)
p q pꓥq qꓥp

0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
Logically Equivalent (Tương đương logic)
Definition: Two statement forms are called logically equivalent
if, and only if, they have identical truth values for each possible
substitution of statements for their statement variables. The
logical equivalence of statement forms E and F is denoted by
writing 𝑬 ≡ 𝑭 or E⇔ F (Hai dạng mệnh đề E và F được nói là
tương đương logic nếu chúng có cùng bảng chân trị)

Ex

Double negation ~ ~p ≡ p p ~p ~(~p)


¬ ¬p ≡ p
0 1 0
1 0 1
Logically Equivalent (Tương đương logic)
Showing Non-equivalence
To show that statement forms P and Q are not logically equivalent,
there are 2 ways:
a) Truth table – find at least one row where their truth values differ.
B) Find a counter example – concrete statements for each of the
two forms, one of which is true and the other of which is false.
Ex: Show that the following 2 statement forms are not logically
equivalent.

a) Truth Table Method p q ~p ~q p ꓥ q ~(p ꓥ q ) ~p ꓥ ~q

0 0 1 1 0 1 1
0 1 1 0 0 1 0
1 0 0 1 0 1 0
1 1 0 0 1 0 0
Logically Equivalent (Tương đương logic)
Showing Non-equivalence
To show that statement forms P and Q are not logically equivalent,
there are 2 ways:
a) Truth table – find at least one row where their truth values differ.
b) Find a counter example – concrete statements for each of the
two forms, one of which is true and the other of which is false.
Ex: Show that the following 2 statement forms are not logically
equivalent.

b) Counter example method:


Let p be the statement “0<1” and q the statement “1<0”

“Not the case that both 0<1 and 1<0” which is TRUE

“Not 0<1” and “not 1<0” which is FALSE


Logically Equivalent (Tương đương logic)
De Morgan’s Laws:

Ex: Write negations for each of the following:

a. John is 6 feet tall and he weighs at least 200 pounds.


→John is not 6 feet tall or he weighs less than 200 pounds.

b. The bus was late or Tom’s watch was slow.


→ The bus was not late and Tom’s watch was not slow.
→ Neither was the bus late nor was Tom’s watch slow.
Tautologies and Contradictions
Definition:
A tautology is a statement form that is always true regardless of the truth
values of the individual statements substituted for its statement variable.
A statement whose form is a tautology is a tautological statement
(Dạng mệnh đề được gọi là hằng đúng nếu nó luôn lấy giá trị 1)
A contradication is a statement form that is always false regardless of
the truth values of the individual statements substituted for its statement
variables. A statement whose form is a contradiction is a contradictory
statement. (Dạng mệnh đề gọi là hằng sai (hay mâu thuẫn) nếu nó luôn
lấy giá trị 0)
Ex:
p q p∨ ¬ p p∧ ¬ p
0 1 1 0
0 1 1 0
1 0 1 0
1 0 1 0
Tautologies and Contradictions
Logical equivalence involving tautologies and contradictions
Ex: If t is a tautology and c is a contradiction, show that

p t c pꓥt pꓥc
0 1 0 0 0
1 1 0 1 0
Summary of Logical Equivalences
Theorem 2.1.1 Logical Equivalence: Given any statement
variables p, q and r, a tautology t and a contradiction c:
Summary of Logical Equivalences
Theorem 2.1.1 Logical Equivalence: Given any statement
variables p, q and r, a tautology t and a contradiction c:

Ex: Use the laws in Theorem 2.1.1 to verify the following logical
equivalence:
Ex: Use the laws in Theorem 2.1.1 to verify the following logical
equivalence:

(p ꓦ ~q) ꓥ(p ꓦ q) Double Negative Law

(p ꓥ (~q ꓦ q) Distributive Laws

(p ꓥ t) Negation Law

p Identity Laws
Conditional Statements
Conditional (Implication, Phép kéo theo) If p and q are statement
variables, the conditional of q by p is “if p then q” or “p implies q”,
denoted p → q.

It is false when p is true and q is false; otherwise it is true.

Mệnh đề p kéo theo q của hai mệnh đề p và q ký hiệu p q p→q


bởi p → q (đọc là “p kéo theo q” hay “Nếu p thì q” 0 0 1
hay “p là điều kiện đủ của q” hay “q là điều kiện cần 0 1 1
của p”) là mệnh đề được định bởi: p → q sai khi và 1 0 0
1 1 1
chỉ khi p đúng mà q sai.
Conditional Statements
Conditional (Implication, Phép kéo theo) If p and q are statement
variables, the conditional of q by p is “if p then q” or “p implies q”,
denoted p → q.

It is false when p is true and q is false; otherwise it is true.

We call p the hypothesis (or antecedent) of the conditional and q the


conclusion (or consequent)
Ex
Conditional Statements
p q p→q The pledge many politicians make when
0 0 1 running for office is “If I am elected, then I will
0 1 1
lower taxes.” If the politician is elected, voters
1 0 0
1 1 1 would expect this politician to lower taxes.

Furthermore, if the politician is not elected, then voters will not


have any expectation that this person will lower taxes, although
the person may have sufficient influence to cause those in power
to lower taxes.
It is only when the politician is elected but does not lower taxes
that voters can say that the politician has broken the campaign
pledge
Conditional Statements
p q p→q A conditional statement that is true by virtue of
0 0 1 the fact that its hypothesis is false is often called
0 1 1
vacuously true or true by default.
1 0 0
1 1 1
“If you show up for work Monday morning, then you will get the
job” is vacuously true if you do NOT show up for work Monday
morning

In general, when the “if” part of an if-then statement is false, the


statement as a whole is said to be true, regardless of whether
the conclusion is true or false.
Conditional Statements
p q p→q A conditional statement that is true by virtue of
0 0 1 the fact that its hypothesis is false is often called
0 1 1
vacuously true or true by default.
1 0 0
In general, when the “if” part of an if-then
1 1 1
statement is false, the statement as a whole is
said to be true, regardless of whether the
conclusion is true or false.
Ex: A Conditional Statement with a False Hypothesis
If 0 = 1, then 1 = 2
Strange as it may seem, the statement as a whole is true!
Conditional Statements
p q p→q p q ~p ~pꓦq Representation of If-Then as Or
0 0 1 0 0 1 1 p → q ≡ ~p  q
0 1 1 0 1 1 1 Negation of Conditional
1 0 0 1 0 0 0 Statement
~(p → q) ≡ 𝐩 ~q
1 1 1 1 1 0 1

Ex: Rewrite the following statement in if-then form:


Either you get to work on time or you are fired.
Solution: Let ~p be “You get to work on time” and q be “You are
fired”. Also, p is “You do not get to work on time”.
~p  q Either you get to work on time or you are fired.
p→q : If you do not get to work on time, you are fired.
Conditional Statements
p q p→q p q ~p ~pꓦq Representation of If-Then as Or
0 0 1 0 0 1 1 p → q ≡ ~p  q
0 1 1 0 1 1 1 Negation of Conditional
1 0 0 1 0 0 0 Statement
~(p → q) ≡ 𝐩 ~q
1 1 1 1 1 0 1
Ex: Rewrite the following statement in if-then form:
Either you get to work on time or you are fired.
Solution: Let ~p be “You get to work on time” and q be “You are
fired”. Also, p is “You do not get to work on time”.
~p  q Either you get to work on time or you are fired.
p→q : If you do not get to work on time, you are fired.
p ~q you do not get to work on time and you are not fired
Conditional Statements
p q p→q p q ~p ~pꓦq Representation of If-Then as Or
0 0 1 0 0 1 1 p → q ≡ ~p  q
0 1 1 0 1 1 1 Negation of Conditional
1 0 0 1 0 0 0 Statement
~(p → q) ≡ 𝐩 ~q
1 1 1 1 1 0 1

Ex: Write negation for each of the following statements:


a. If my car is in the repair shop, then I cannot get to class.
b. If Sara lives in Athens, then she lives in Greece.
Conditional Statements
p q p→q p q ~p ~pꓦq Representation of If-Then as Or
0 0 1 0 0 1 1 p → q ≡ ~p  q
0 1 1 0 1 1 1 Negation of Conditional
1 0 0 1 0 0 0 Statement
~(p → q) ≡ 𝐩 ~q
1 1 1 1 1 0 1
Ex: Write negation for each of the following statements:
a. If my car is in the repair shop, then I cannot get to class.
Solution
Let p be “my car is in the repair shop” and q be “I cannot get to class”. ~q
be “I can get to class”.
p → q : If my car is in the repair shop, then I cannot get to class.
Negation of Conditional Statement is ~(p → q) ≡ 𝐩 ~q
𝐩 ~q my car is in the repair shop, and I can get to class.
Conditional Statements
p q p→q p q ~p ~pꓦq Representation of If-Then as Or
0 0 1 0 0 1 1 p → q ≡ ~p  q
0 1 1 0 1 1 1 Negation of Conditional
1 0 0 1 0 0 0 Statement
~(p → q) ≡ 𝐩 ~q
1 1 1 1 1 0 1
Ex: Write negation for each of the following statements:
b. If Sara lives in Athens, then she lives in Greece.
Solution
Let p be “Sara lives in Athens” and q be “she lives in Greece”. ~q be
“she doesn’t live in Greece”.
p → q : If Sara lives in Athens, then she lives in Greece..
Negation of Conditional Statement is ~(p → q) ≡ 𝐩 ~q
𝐩 ~q Sara lives in Athens, and she doesn’t live in Greece..
Contrapositive of a Conditional
Statement
Definition (Contrapositive) (Phản đảo): The contrapositive of a
conditional statement of the form “if p then q” is “if ~q then ~p”
Symbolically, the contrapostitive of p → q is ~q → ~p
p → q ≡ ~q → ~p
Ex: Write each of the following statements in its equivalent
contrapositive form:
a. If Howard can swim across the lake, then Howard can swim to
the island
b. If today is Easter, then tomorrow is Monday
Converse and Inverse of a
Conditional Statement
Definition (Converse) (Đảo): The converse of a conditional
statement of the form “if p then q” is “if q then p”
Symbolically, the contrapostitive of p → q is q → p
p→q q→p
Definition (Inverse) (Nghịch đảo): The inverse of a conditional
statement of the form “if p then q” is “if ~p then ~q”
Symbolically, the contrapostitive of p → q is ~p → ~q
Converse and Inverse of a
Conditional Statement

Ex: Write the converse and inverse of the following statements:


a. If Howard can swim across the lake, then Howard can swim to
the island.
Converse:
Inverse:
b. If today is Easter, then tomorrow is Monday.
Converse:
Inverse:
Only If
To say “p only if q” means that p can take place only if q takes
place also.
That is, if q does not take place, then p cannot take place.
Another way to say this is that if p occurs, then q must also occur
(using contrapositive)
Definition (Only if): If p and q are statements, “p only if q”
means “if not q then not p” or, equivalently “if p then q”
Only If
Definition (Only if): If p and q are statements, “p only if q”
means “if not q then not p” or, equivalently “if p then q”
Ex: Rewrite the following statement in if-then form in two ways,
one of which is the contrapositive of the other.
p only if q
John will break the world’s record only if he runs the mile in under four minutes.
“if not q then not p”
If John does not run the mile in under four minutes, then John will not break the world’s record.

if p then q
If John will break the world’s record then he runs the mile in under four minutes
“if p, then q” “q follows from p”
“if p, q” “p is sufficient for q”
“q if p” “a sufficient condition for q is p”
“q when p” “p is a sufficient condition for q” mean “if p then q”
“q unless ~p” “a necessary condition for p is q”
“p implies q” “q is necessary for p”
“p only if q” “q is a necessary condition for p mean “if not q then not p”
“q whenever p”
If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)

p q p→q p only if q Negation of Conditional Statement


if not q then not p ~(p → q) ≡ 𝐩 ~q
0 0 1
if p then q Representation of If-Then as Or
0 1 1
1 0 0 p → q ≡ ~p  q
1 1 1
if p then q p→q “if p, then q”
Converse (Đảo) If q then p q→p “q whenever p”
Contrapositive If not q then not p 𝑞ത → 𝑝ҧ
(Phản đảo)
Inverse If not p then not q 𝑝ҧ → 𝑞ത

What are the contrapositive, the converse, and the inverse of the
conditional statement
“The home team wins whenever it is raining?”
Solution: Because “q whenever p” is one of the ways to express
the conditional statement p → q, the original statement can be
rewritten as “If it is raining, then the home team wins.”
Consequently, the contrapositive of this conditional statement is
“If the home team does not win, then it is not raining.”
The converse is “If the home team wins, then it is raining.”
The inverse is “If it is not raining, then the home team does not
win.”
“if p, then q” “if p, q” “p implies q”
“p is sufficient for q” “p only if q”
“q if p” “a sufficient condition for q is p”
“q when p” “q whenever p”
“a necessary condition for p is q” “q is necessary for p”
“q unless ¬p “q follows from p”
Let p be the statement “Maria learns discrete mathematics” and q the
statement “Maria will find a good job.”
Express the statement p → q as a statement in English.
Solution: From the definition of conditional statements, we see that when
p is the statement “Maria learns discrete mathematics” and
q is the statement “Maria will find a good job,”
p → q represents the statement
if p, then q
“If Maria learns discrete mathematics, then she will find a good job.”
“if p, then q” “if p, q” “p implies q”
“p is sufficient for q” “p only if q”
“q if p” “a sufficient condition for q is p”
“q when p” “q whenever p”
“a necessary condition for p is q” “q is necessary for p”
“q unless ~p “q follows from p”
There are many other ways to express this conditional statement in
English. Among the most natural of these are:
q when p
“Maria will find a good job when she learns discrete mathematics.”
p is sufficient for q
“For Maria to learn discrete mathematics, it is sufficient for her to get a
good job.”
q unless ~p
“Maria will find a good job unless she does not learn discrete
mathematics.”
“if p, then q” “if p, q” “p implies q”
“p is sufficient for q” “p only if q”
“q if p” “a sufficient condition for q is p”
“q when p” “q whenever p”
“a necessary condition for p is q” “q is necessary for p”
“q unless ¬p “q follows from p”
Let p be the statement “Maria learns discrete mathematics” and q the
statement “Maria will find a good job.” Express the statement p → q as a
statement in English.
Solution:
1) “if p, q”:
2) “q if p”
3)
.
9) “q follows from p”
10) Contrapositive:
11 Converse:
12 Inverse:
Logical connectives
Biconditionals: Given statement variables p and q, the biconditional of p
and q is “p if, and only if, q” and denoted p ↔ q.

It is true if both p and q have the same truth values and is false if p and q
have opposite truth values.

The words if and only if are sometimes abbreviate iff


(Phép kéo theo hai chiều): Mệnh đề p kéo
p q p↔q
theo q và ngược lại của hai mệnh đề p và q,
p →q
ký hiệu bởi p  q (đọc là “p nếu và chỉ nếu q”
q→p
hay “p khi và chỉ khi q” hay “p là điều kiện
cần và đủ của q” hay “p tương đương với q”), 0 0 1
là mệnh đề xác định bởi: 0 1 0
p  q đúng khi và chỉ khi p và q có cùng 1 0 0
chân trị
1 1 1
Logical connectives
p q p↔q
p →q
q→p “p is necessary and sufficient for q”
0 0 1 “if p then q, and conversely”
0 1 0 “p iff q”
1 0 0
“p if and only if”
1 1 1
Ex: Rewrite the following statement as a conjunction of two if-then
statements.
This computer program is correct if, and only if, it produces
correct answers for all possible sets of input data.
Logical connectives

Ex: Rewrite the following statement as a conjunction of two if-then


statements.
This computer program is correct if, and only if, it produces
correct answers for all possible sets of input data.

If this computer program is correct, then it produces the correct


answers for all possible sets of input data; and if this program
produces the correct answers for all possible sets of input data,
then it is correct
Necessary and Sufficient Conditions
Definition (Necessary and Sufficient Conditions)
If r and s are statements,
“p is a sufficient condition for q” mean “if p then q”
“p is a necessary condition for q” mean “if not p then not q”
- In other words, to say “p is a sufficient condition for q” means
that the occurrence of r is sufficient to guarantee the occurrence of
s
- On the other hand, to say “p is a necessary condition for q”
means that if r does not occur, then s cannot occur either: The
occurrence of r is necessary to obtain the occurrence of s
Necessary and Sufficient Conditions
Note that due to the equivalence between a statement and its
contrapositive: r is a necessary condition for s also means “if s
then r”.
Consequently: r is a necessary and sufficient condition for s
means “r, if and only if, s”.
Ex: “If John is eligible to vote, then he is at least 18 years old.”
The truth of the condition “John is eligible to vote” is sufficient to
ensure the truth of the condition “John is at least 18 years old.
In addition, the condition “John is at least 18 years old” is
necessary for the condition “John is eligible to vote” to be true. If
John were younger than 18, then he would not be eligible to vote.
Necessary and Sufficient Conditions
Converting a Sufficient Condition to If-Then Form
Rewrite the following statement in the form “If A then B”:
Pia’s birth on U.S. soil is a sufficient condition for her to be a U.S.
citizen.
Solution
“p is a sufficient condition for q” mean
“if p then q
If Pia was born on U.S. soil, then she is a U.S. citizen.
.
Necessary and Sufficient Conditions
Converting a Necessary Condition to If-Then Form
Use the contrapositive to rewrite the following statement in two
ways:
George’s attaining age 35 is a necessary condition for his being
president of the United States
Solution
“p is a necessary condition for q” mean “if not p then not q”
Version 1: If George has not attained the age of 35, then he
cannot be president of the United States.
Version 2: If George can be president of the United States, then
he has attained the age of 35.
Ex “p is necessary and sufficient for q”
“if p then q, and conversely”
“p iff q”
“p if and only if”

Let p be the statement “You can take the flight,”


q be the statement “You buy a ticket.”

Then p ↔ q is the statement


“You can take the flight if and only if you buy a ticket.
Statement Form (Dạng mệnh đề)
A statement form (or propositional form) is an expression made up
of statement variable (such as p, q, and r) and logical conectives
(such as ; ; ; →; ) that becomes a statement when actual
statements are substituted for the component statement variable.
Biểu thức đại số Biểu thức logic
1 1 Dạng mệnh đề E(p, q, r) =(p∧q) ∨((¬r→p)
Hàm số f(x, 𝑦) = +
𝑥 𝑦−3

Hằng số: 3; 3.5;… Hằng mệnh đề: 1, 0

Biến số: x,y… Biến mệnh đề p,q,r,…


:
Các phép toán: (); +; -;x; /.. Các phép nối: (); ; ; ; →; 
thao tác trên hằng số và thao tác trên các hằng mệnh đề và biến
các biến số theo một thứ tự mệnh đề theo một thứ tự nhất định như
nhất định. trên.
Dạng mệnhForm
Statement đề (Dạng mệnh đề)
Biểu thức đại số Biểu thức logic

Khi thay thế các biến x,y Khi thay thế các biến mệnh đề trong
trong hàm số bằng hằng số dạng mệnh đề bằng chân trị của các biến
(VD x =1, y=2) thì kết quả mệnh đề (VD p: 0, q: 0, r:1)thì kết quả
thực hiện các phép toán trong thực hiện các phép nối thao tác sẽ là
biểu thức sẽ là hằng số (VD chân trị của dạng mệnh đề (VD E(0,0,1)
f(1,2)=0) :
Phép VÀ Phép HAY Phép HOẶC Phép PHỦ ĐỊNH
p q pq p q pq p q pq p 𝑝ҧ
𝐩 ⊕q 1 0
1 1 1 1 1 1 0 0 0 0 1
1 0 0 1 0 1 0 1 1
0 1 0 0 1 1 1 0 1
0 0 0 0 0 0 1 1 0
Phép kéo theo Phép kéo theo 2 chiều
(NẾU … THÌ…, IF…THEN) (IF…ONLY IF, IFF, KHI VÀ CHỈ KHI
p q p→q P Q P↔Q
P →QQ→P
0 0 1 0 0 1
0 1 1 0 1 0
1 0 0 1 0 0
1 1 1 1 1 1
“if p, then q” “q follows from p”
“if p, q” “p is sufficient for q”
“q if p” “a sufficient condition for q is p”
“q when p” “p is a sufficient condition for q” mean “if p then q”
“q unless ~p” “a necessary condition for p is q”
“p implies q” “q is necessary for p”
“p only if q” “q is a necessary condition for p mean “if not q then not p”
“q whenever p”
If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)

p q p→q p only if q Negation of Conditional Statement


if not q then not p ~(p → q) ≡ 𝐩 ~q
0 0 1
if p then q Representation of If-Then as Or
0 1 1
1 0 0 p → q ≡ ~p  q
1 1 1
Summary of Logical Equivalences
Theorem 2.1.1 Logical Equivalence: Given any statement
variables p, q and r, a tautology t and a contradiction c:
Summary of Logical Equivalences
Theorem 2.1.1 Logical Equivalence: Given any statement
variables p, q and r, a tautology t and a contradiction c:

12. If – then law


p → q  ~p  q Representation of If-Then as Or
 ~q → ~ p Contrapositive
Logically Equivalent (Tương đương logic)
12. If – then laws
p → q  ~p  q
 ~q → ~ p
Ví dụ: Nếu trời mưa thì đường trơn
 Nếu đường không trơn thì trời không mưa
Use De Morgan’s laws to express the negations of “Miguel has a
cellphone and he has a laptop computer” and “Heather will go to the
concert or Steve will go to the concert.
Logically Equivalent (Tương đương logic)
Use De Morgan’s laws to express the negations of “Miguel has a
cellphone and he has a laptop computer”
Solution:
Let p be “Miguel has a cellphone” and
q be “Miguel has a laptop computer.”

Then “Miguel has a cellphone and he has a laptop computer” can be


represented by p ∧ q.

By the first of De Morgan’s laws, ¬(p ∧ q) is equivalent to ¬p ∨ ¬q.


Consequently, we can express the negation of our original statement as
“Miguel does not have a cellphone or he does not have a laptop computer
¬p ∨ ¬q
Logically Equivalent (Tương đương logic)
Use De Morgan’s laws to express the negations of “Heather will go to
the concert or Steve will go to the concert.

Solution:
Let r be “Heather will go to the concert” and s be “Steve will go to the
concert.”

Then “Heather will go to the concert or Steve will go to the concert”


can be represented by r ∨ s.

By the second of De Morgan’s laws, ¬(r ∨ s) is equivalent to ¬r ∧ ¬s.


Consequently, we can express the negation of our original statement as
Heather will not go to the concert and Steve will not go to the concert.
¬r ∧ ¬s
De Morgan ~ (p  q)  ~ p  ~ q
~ (p  q)  ~ p  ~ q
Distributive Law p  (q  r)  (p  q)  (p  r)
p  (q  r)  (p  q)  (p  r)
If - then law p → q  ~p  q
 ~q → ~ p
VD Cho p, q, r là các biến mệnh đề. Chứng minh rằng:
(~p → r)  (q→ r)  (p → q) → r If ( true statement)
Giải: (~p → r)  (q → r) action 1
else // false statement
 ( p  r )  (~ q  r) (if - then) action 2
 ( p ~ q )  r (distributive law)
 ~(~p  q )  r (De Morgan)
 ~( p → q )  r (if – then law)
 ( p → q ) → r (if – then law)
Valid and Invalid Arguments
If Socrates is a man, then Socrates is mortal.
Socrates is a man.
Socrates is mortal.

An Argument (argument form) is a sequence of statements


(statement forms).
All statements in an argument (argument form), except for the
final one, are call premises (or assumptions or hypothesis).
The final statement (statement form) is called the conclusion.
The symbol , which is read “therefore”, is normally placed just
before the conclusion
Valid and Invalid Arguments

If Socrates is a man, then Socrates is mortal.


Socrates is a man.
Socrates is mortal.
An argument form is called valid if, and only if, whenever
statements are substituted that make all the premises true, the
conclusion is also true.
Valid and Invalid Arguments
Argument: a sequence of statements ending in a conclusion.
An argument form is called valid if, and only if, whenever
statements are substituted that make all the premises true, the
conclusion is also true.

If Socrates is a man, then Socrates is mortal.


Socrates is a man.
Socrates is mortal.
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
Valid and Invalid Arguments
Valid and Invalid Arguments
Qui tắc khẳng định
Qui tắc tam đoạn luận rời

Qui tắc phủ định Qui tắc tam đoạn luận

Qui tắc đơn giản

Qui tắc nối liền

A rule of inference is a form of argument that is valid


Valid and Invalid Arguments

Use modus ponens or modus tollens to fill in the blanks of the


following arguments so that they become valid inferences.
a. If there are more pigeons than there are pigeonholes, then at
least two pigeons roost in the same hole.
There are more pigeons than there are pigeonholes.
________________________________________________
b. If 870,232 is divisible by 6, then it is divisible by 3.
870,232 is not divisible by 3.
___________________________________________
Valid and Invalid Arguments
Allows you to discard extraneous
information to concentrate on the
particular property of interest

Anton is a junior.
(More generally) Anton is a junior or Anton is a senior
Ana knows numerical analysis and Ana knows graph algorithms.
(In particular) Ana knows graph algorithms.
So if you are looking for someone who knows graph algorithms to
work with you on a project, and you discover that Ana knows both
numerical analysis and graph algorithms, would you invite her to
work with you on your project?
Valid and Invalid Arguments

When you have two possibilities and you can rule one out, the other must
be the case

Suppose you know that for a particular number x, x – 3 = 0 or x + 2 = 0


If you also know that x is not negative, then x ≠ -2, so
by elimination you can conclude that x = 3.
Valid and Invalid Arguments

Many arguments in mathematics contain chains of if-then statements.


From the fact that one statement implies a second and the second implies the
third, you can conclude that the first statement implies the third.

If 18,486 is divisible by 18, then 18,486 is divisible by 9.


If 18,486 is divisible by 9, then the sum of the digits of 18,486 is divisible by 9.
If 18,486 is divisible by 18, then the sum of the digits of 18,486 is divisible by 9.
Valid and Invalid Arguments

It often happens that you know one thing or another is true. If you can show that in
either case a certain conclusion follows, then this conclusion must also be true. r
Ex: Suppose you know that x is a nonzero real number.
The trichotomy property of the real numbers says that any number is positive,
negative, or zero. Thus (by elimination) you know that x is positive or negative.
You can deduce that x2 > 0 by arguing as follows:
x is positive or x is negative.
If x is positive, then x2 > 0.
If x is negative, then x2 > 0.
x2 > 0.
Valid and Invalid Arguments
Qui tắc khẳng định
Qui tắc tam đoạn luận rời

Qui tắc phủ định Qui tắc tam đoạn luận

Qui tắc đơn giản

Qui tắc nối liền

p → (q → r ) ps p → (q → r ) t→q
ps s p q→r
t→q
 p  q→r  t→r
s Modus Ponens Transitivity
Elimination
 r →t t →r  r →t Contrapositive
Valid and Invalid Arguments
Ex: You are about to leave for school in the morning and discover
that you don’t have your glasses. You know the following
statements are true:
a. If I was reading the newspaper in the kitchen, then my glasses
are on the kitchen table.
b. If my glasses are on the kitchen table, then I saw them at
breakfast.
c. I did not see my glasses at breakfast.
d. I was reading the newspaper in the living room or I was reading
the newspaper in the kitchen.
e. If I was reading the newspaper in the living room then my
glasses are on the coffee table.
So, where are your glasses?
Valid and Invalid Arguments
Here is a sequence of steps you might use to reach the answer,
together with the rules of inference that allow you to draw the
conclusion of each step:
Let RK = I was reading the newspaper in the kitchen.
GK = My glasses are on the kitchen table.
SB = I saw my glasses at breakfast.
RL = I was reading the newspaper in the living room.
GC = My glasses are on the coffee table.
a. If I was reading the newspaper in the kitchen, then my glasses
are on the kitchen table. RK → GK
b. If my glasses are on the kitchen table, then I saw them at
breakfast. GK → SB
c. I did not see my glasses at breakfast. ~SB
d. I was reading the newspaper in the living room or I was reading
the newspaper in the kitchen. RL ꓦ RK
e. If I was reading the newspaper in the living room then my
glasses are on the coffee table. RL → GC
Valid and Invalid Arguments
Ví dụ
2) Gọi p và q là các mệnh đề
p: “Minh giỏi Toán”
q: “Minh yếu Anh Văn”
Hãy viết lại mệnh đề sau dưới dạng hình thức trong đó sử dụng các
phép nối
Minh giỏi Toán nhưng yếu Anh Văn
p nhưng yếu Anh Văn
p nhưng q
p∧q
Bài tập
2) Gọi p và q là các mệnh đề
p: “Minh giỏi Toán”
q: “Minh yếu Anh Văn”
Hãy viết lại các mệnh đề sau dưới dạng hình thức trong đó sử dụng
các phép nối
a. Minh giỏi Toán nhưng yếu Anh Văn
b. Minh yếu cả Toán lẫn Anh Văn
c. Minh giỏi Toán hay Minh vừa giỏi Anh văn vừa yếu Toán
d. Nếu Minh giỏi Toán thì Minh giỏi Anh Văn
e. Minh giỏi Toán và Anh Văn hay Minh yếu Toán nhưng giỏi Anh
Văn.
2) Gọi p và q là các mệnh đề
p: “Minh giỏi Toán”
q: “Minh yếu Anh Văn”
a. Minh giỏi Toán nhưng yếu Anh Văn: p ‫𝒒 ٿ‬
b. Minh yếu cả Toán lẫn Anh Văn: ¬ p ‫𝒒 ٿ‬
c. Minh giỏi Toán hay Minh vừa giỏi Anh văn vừa yếu Toán: p v (¬ q
‫)𝒑¬ ٿ‬
d. Nếu Minh giỏi Toán thì Minh giỏi Anh Văn
p→¬q
a. Minh giỏi Toán và Anh Văn hay Minh yếu Toán nhưng giỏi Anh
Văn.
(p ‫ )𝒒¬ ٿ‬v (¬ p ‫)𝒒¬ ٿ‬
3) Gọi p, q, r là các mệnh đề
p: “Bình đang học Toán”
q: “Bình đang học Tin Học
r: “Bình đang học Anh Văn”
Hãy viết lại các mệnh đề sau dưới dạng hình thức trong đó sử dụng các
phép nối
a. Bình đang học Toán và Anh Văn nhưng không học Tin Học
b. Bình đang học Toán và Tin Học nhưng không học cùng lúc Tin Học
và Anh Văn
c. Không đúng là Bình đang học Anh Văn mà không học Toán
d. Không đúng là Bình đang học Anh văn hay Tin Học mà không học
Toán.
e. Bình không học Tin Học lẫn Anh Văn nhưng đang học Toán
4) Hãy lấy phủ định các mệnh đề sau
a) Ngày mai nếu trời mưa hoặc trời tạnh thì tôi sẽ không ra ngoài
b) 15 chia hết cho 3 nhưng không chia hết cho 4
c) Hình tứ giác này không phải hình chữ nhật mà cũng không phải
hình thoi
d) Nếu An không đi làm ngày mai thì sẽ bị đuổi việc
e) Mọi tam giác đều có các góc bằng 600
Bài tập
1) Chứng minh tính đúng đắn của các luật logic trên bằng bảng
chân trị
2) Có bao nhiêu cách đặt dấu () khác nhau vào dạng mệnh đề p
q r. Lập bảng chân trị cho từng trường hợp
3) Lập bảng chân trị cho mệnh đề sau (p  q), p →(p  q)
Mệnh đề sau có phải là hằng đúng hay không
(p → q) →[(q → r) →(p → r)]
4) Chứng minh các tính chất sau bằng bảng chân trị
BÀI TẬP
5) Dùng các qui luật logic để chứng minh các mệnh đề dưới đây
6) Chứng minh tính đúng sai của các kết luận sau

a) b)

c) d)
7) “If compound X is boiling, then its temperature must be at least 150°
C.” Assuming that this statement is true, which of the following must
also be true?
a. If the temperature of compound X is at least 150°C, then compound X is
boiling.
b. If the temperature of compound X is less than 150°C, then compound X i
s not boiling.
c. Compound X will boil only if its temperature is at least 150°C.
d. If compound X is not boiling, then its temperature is less than 150°C.
e. A necessary condition for compound X to boil is that its temperature be at
least 150°C.
f. A sufficient condition for compound X to boil is that its temperature be at
least 150°C
8) Rewrite each of the statements in a and b as a conjunction
of two if-then statements.
a. This quadratic equation has two distinct real roots if, and only if,
its discriminant is greater than zero
b. This integer is even if, and only if, it equals twice some integer.
9) Rewrite the statements in a and b in if-then form in two
ways, one of which is the contrapositive of the other. Use the
formal definition of “only if.”
a. The Cubs will win the pennant only if they win tomorrow’s game.
b. Sam will be allowed on Signe’s racing boat only if he is an expert
sailor.
10) In a–c, rewrite the statements in if-then form.
a Payment will be made on fifth unless a new hearing is granted.
b. Ann will go unless it rains.
c. This door will not open unless a security code is entered
d. Catching the 8:05 bus is a sufficient condition for my being on
time for work.
e. Having two 45° angles is a sufficient condition for this triangle
to be a right triangle
11) Use the contrapositive to rewrite the statements in a and b
in if-then form in two ways.
a. Being divisible by 3 is a necessary condition for this number to be
divisible by 9.
b. Doing homework regularly is a necessary condition for Jim to
pass the course.
12) In 1–4 (a) use the logical equivalences p → q ≡ ~p ꓦ q and p
↔ q ≡ (~p ꓦ q) ꓥ (~q ꓦ p) to rewrite the given statement forms
without using the symbol → or ↔, and (b) use the logical
equivalence p ꓦ q ≡ ~(~p ꓥ ~q) to rewrite each statement form
using only ꓥ and ~.
1. p ꓥ ~q → r 2. p ꓦ ~q → r ꓦ q
3. (p → r) ↔ (q → r) 4. (p → (q → r)) ↔ ((p ꓥ q) → r)
13. Note that “a sufficient condition for s is r” means r is a
sufficient condition for s and that “a necessary condition for
s is r” means r is a necessary condition for s. Rewrite the
statements in a and b in if then form.
a. A sufficient condition for Jon’s team to win the championship is
that it win the rest of its games.
b. A necessary condition for this computer program to be correct
is that it not produce error messages during translation.
Tập hợp (Set)
Định nghĩa: Tập hợp là một bộ sưu tập gồm các vật.
Mỗi vật được gọi là một phần tử của tập hợp.
Kí hiệu: A, B , X,…
Nếu x là phần tử của tập hợp A, ta kí hiệu x  A
Ví dụ:
N ={0,1,2,…} là tập hợp các số tự
nhiên.
Z = {0,1,-1,2,-2,…} tập hợp các số
nguyên.
Q = {m/n | m,n  Z, n≠0 } tập hợp
các số hữu tỉ.
R: tập hợp các số thực.
C: Tập hợp các số phức.
TDTS: Tập các sinh viên trường TDT
Vị từ (Predicate)
Định nghĩa Vị từ là một khẳng định p(x,y,..), trong đó x,y...là các biến
thuộc tập hợp A, B,… cho trước sao cho:
- Bản thân p(x,y,..) không phải là mệnh đề.
- Nếu thay x,y,… thành giá trị cụ thể thì p(x,y,..) là mệnh đề.
Ví dụ. Các phát biểu sau là vị từ (chưa là mệnh đề)
- p(n) = “n +1 là số nguyên tố”.
- q(x,y) = “x2 + y = 1” .
- r(x,y,z) = “x2 + y2 >z”.
Khi thay các giá trị cụ thể của n,x,y,z thì chúng là các mệnh đề.
Ví dụ: p(n) = “n +1 là số nguyên tố”.
n = 1 ➔ p(1) = “1+1 là số nguyên tố” → p(1) có chân trị là 1
n = 3 ➔ p(1) = “3+1 là số nguyên tố” → p(3) có chân trị là 0
Predicates Statements
In logic, predicates can be obtained by removing some or all of
the nouns from a statement. For instance, let P stand for “is a
student at TDTU” and let Q stand for “is a student at.” Then both P
and Q are predicate symbols
Statement Mệnh đề (Có thể xác Nam is a student at TDTU
định được chân trị 1 hoặc 0)
Predicate variables P(x) Biến vị từ P(x) = “x is a student at TDTU”
P is predicate symbols ký hiệu vị
từ

Predicate variables:
Q(x, y) = “x is a student at y”
When concrete values are substituted in place of predicate
variables, a statement results.
Predicates Statements
For simplicity, we define a predicate to be a predicate symbol
together with suitable predicate variables.
In some treatments of logic, such objects are referred to as
propositional functions or open sentences.
• Definition (Predicate)

A predicate is a sentence that contains a finite number of


variables and becomes a statement when specific values are
substituted for the variables

The domain of a predicate variable is the set of all values that


may be substituted in place of the variable

r(x,y,z) = “x2 + y2 >z”.


Predicates Statements
When an element in the domain of the variable of a one-variable
predicate is substituted for the variable, the resulting statement is
either true or false. The set of all such elements that make the
predicate true is called the truth set of the predicate.

Definition (Truth Set)

If P(x) is a predicate and x has domain D, the truth set is the set
of all elements of D that make P(x) true when they are substituted
for x. The truth set of P(x) is denoted {x ∈ 𝐷|𝑃 𝑥 }
Predicates Statements
Definition (Truth Set)

If P(x) is a predicate and x has domain D, the truth set is the set of
all elements of D that make P(x) true when they are substituted for
x. The truth set of P(x) is denoted {x ∈ 𝐷|𝑃 𝑥 }
Ex : p(n) = “n +1 là số nguyên tố”.
n = 1 ➔ p(1) = “1+1 là số nguyên tố” → p(1) có chân trị là 1
n = 3 ➔ p(1) = “3+1 là số nguyên tố” → p(3) có chân trị là 0

p(n) ={n ∈ 𝑍 + |𝑃 𝑛 }= {n ∈ 𝑍 + |n +1 là số nguyên tố}={1,2,4,6,10…}


q(n) = “n là số nguyên tố”.
q(x) ={x ∈ 𝑍 + |q 𝑥 }= {x ∈ 𝑍 + |n là số nguyên tố}={2,3,5,7,11…}
Tập hợp (Set)
Định nghĩa: Tập hợp là một bộ sưu tập gồm các vật.
Mỗi vật được gọi là một phần tử của tập hợp.
Kí hiệu: A, B , X,…
Nếu x là phần tử của tập hợp A, ta kí hiệu x  A
Ví dụ:
N ={0,1,2,…} là tập hợp các số tự
nhiên.
Z = {0,1,-1,2,-2,…} tập hợp các số
nguyên.
Q = {m/n | m,n  Z, n≠0 } tập hợp các
số hữu tỉ.
R: tập hợp các số thực.
C: Tập hợp các số phức.
TDTS: Tập các sinh viên trường TDT
Example
Let Q(n) be the predicate “n is a factor of 8.” Find the truth set of
Q(n) if
a. the domain of n is the set Z+ of all positive integers
{1, 2, 4, 8} because these are exactly the positive integers that
divide 8 evenly
b. the domain of n is the set Z of all integers.
Example
Let Q(n) be the predicate “n is a factor of 8.” Find the truth set of
Q(n) if
a. the domain of n is the set Z+ of all positive integers
{1, 2, 4, 8} because these are exactly the positive integers that
divide 8 evenly

b. the domain of n is the set Z of all integers.

the domain of n is the set Z of all integers


{-8,-4,-2,-1,1, 2, 4, 8} because these are exactly the integers that
divide 8 evenly
Các phép toán trên vị từ
Cho trước các vị từ p(x), q(x) theo một biến x  A. Khi ấy, ta
cũng có các phép toán tương ứng như trên mệnh đề

- Phủ định p(x)


- Phép nối liền p(x)q(x)
- Phép nối rời p(x)q(x)
- Phép kéo theo p(x)→q(x)
- Phép kéo theo hai chiều p(x)  q(x)
Logic vị từ
Khi xét một vị từ p(x) với x  A. Ta có các trường hợp sau
TH1. Khi thay x bởi 1 phần tử a tùy ý thuộc A, ta có p(a) đúng.
VD Cho các vị từ p(x) sau với xR
p(x) = “x2 +1 >0” đúng với mọi x

TH2. Với một số giá trị a  A, ta có p(a) đúng


p(x) = “x2 -2x+1=0” chỉ đúng với x = 1.

TH3. Khi thay x bởi 1 phần tử a tùy ý thuộc A, ta có p(a) sai.


p(x) = “x2 -2x+3=0” sai với mọi x .
Lượng từ hóa vị từ một biến
Định nghĩa. Cho p(x) là một vị từ theo một biến xác định trên A. Ta định
nghĩa lượng từ hóa của p(x) như sau:
Vị từ “Với mọi x thuộc A, p(x)
“x  A, p(x)” : lượng từ phổ dụng (Universal Quantifier)
là mệnh đề đúng khi và chỉ khi p(a) luôn đúng với mọi giá trị a  A.
Khi tất cả các phần tử của không gian có thể được liệt kê ra, chẳng hạn
như x1, x2,…xn thì lượng từ với mọi giống như phép hội P(x1) ꓥ P(x2) ꓥ
… ꓥ P(xn) vì phép hội này là đúng nếu và chỉ nếu P(x1), P(x2) , …, P(xn)
đều đúng
VD: Diễn đạt câu “Tất cả sinh viên khoa CNTT đều đã học toán rời
rạc” dùng lượng từ “với mọi”
Đặt S(x) là câu “x là sinh viên khoa CNTT”
P(x) là câu “x đã học toán rời rạc”
∀𝑥 𝑆(𝑥) → 𝑃(𝑥) hoặc ∀𝑥 𝑃(𝑥)
The Universal Quantifier: ∀
One sure way to change predicates into statements is to assign
specific values to all their variables.
Ex: If x represents the number 35, the sentence “x is divisible by
5” is a true statement

Another way to obtain statements from predicates is to add


quantifiers.
Quantifiers are words that refer to quantities such as “some” or
“all” and tell for how many elements a given predicate is true.
The symbol ∀ denotes “for all” (or “for any”, “for every”, “for
each”) and is called the universal quantifier.
The Universal Quantifier: ∀
Definition (Universal Quantifier).
Let Q(x) be a predicate and D the domain of x. A universal
statement is a statement of the form ““x  D, Q(x)””
It is defined to be true iff Q(x) is true for every x in D
It is defined to be false iff Q(x) is false for at least one x in D
A value for x for which Q(x) is false is called a counterexample
Truth and Falsity of Universal Statements
a. Let D = {1, 2, 3, 4, 5}, and consider the statement
∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥
Show that this statement is true.
Check that “𝑥 2 ≥ 𝑥 ” is true for each x in D.
12 ≥ 1, 22 ≥ 2, 32 ≥ 3, 42 ≥ 4, 52 ≥ 5 Hence “∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥
” is true.
The Universal Quantifier: ∀
Truth and Falsity of Universal Statements
Ex1:
Let D = {1, 2, 3, 4, 5}, and consider the statement ∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥
Show that this statement is true.
Solution Check that “𝑥 2 ≥ 𝑥 ” is true for each x in D.
12 ≥ 1, 22 ≥ 2, 32 ≥ 3, 42 ≥ 4, 52 ≥ 5 Hence “∀𝑥 ∈ 𝐷, 𝑥 2 ≥ 𝑥” is
true.
This method is called the method of exhaustion (vét cạn).

Ex2: Consider the statement ∀𝑥 ∈ 𝑅, 𝑥 2 ≥ 𝑥


Find a counterexample to show that this statement is false.
Lượng từ hóa vị từ một biến
Định nghĩa. Cho p(x) là một vị từ theo một biến xác định trên A. Ta định
nghĩa các mệnh đề lượng từ hóa của p(x) như sau:
Vị từ “Tồn tại (ít nhất ) một x thuộc A
Có (ít nhất) một x thuộc A
Đối với một x nào đó” làm cho p(x) đúng
“x  A, p(x)”  : lượng từ tồn tại (the existential quantifier)
là mệnh đề đúng khi và chỉ khi có ít nhất một giá trị x = a0 nào đó sao
cho mệnh đề p(a0) đúng.
VD: Diễn đạt câu “Chỉ có một sinh viên khoa CNTT đã học toán
rời rạc”
P(x) là câu “x đã học toán rời rạc”
𝑥 𝑃(𝑥)
The Existential Quantifier: 
Ex: “There is a student in CTRR” can be written as
 a person p such that p is a student in CTRR.
Or, more formally,
 p P such that p is a student in CTRR.
where P is the set of all people.

The words such that are inserted just before the predicate.
Some alternative expressions for “there exists” are “there is a”,
“we can find a”, “there is at least one”, “for some”, and “for at
least one”.
The Existential Quantifier: 
Sentences that are quantified existentially are defined as
statements by giving them the truth values specified in the
following definition.

Definition (Existential Statement).


Let Q(x) be a predicate and D the domain of x. A existential
statement is a statement of the form ““x  D such that Q(x)””
It is defined to be true iff Q(x) is true for at least one x in D
It is defined to be false iff Q(x) is false for all x in D
Definition (Universal Quantifier).
Let Q(x) be a predicate and D the domain of x. A universal
statement is a statement of the form ““x  D, Q(x)””
It is defined to be true iff Q(x) is true for every x in D
It is defined to be false iff Q(x) is false for at least one x in D

Definition (Existential Statement).


Let Q(x) be a predicate and D the domain of x. A existential
statement is a statement of the form ““x  D such that Q(x)””
It is defined to be true iff Q(x) is true for at least one x in D
It is defined to be false iff Q(x) is false for all x in D
Lượng từ Khi nào đúng Khi nào sai
x p(x) p(x) đúng với mọi x Có một giá trị x để p(x) là sai
x p(x) Có một x sao cho p(x) là đúng p(x) sai với mọi x
Lượng từ hóa vị từ một biến
Lượng từ Khi nào đúng Khi nào sai
x p(x) p(x) đúng với mọi x Có một giá trị x để p(x) là sai
x p(x) Có một x sao cho p(x) là đúng p(x) sai với mọi x

Tìm giá trị chân lý của các lượng từ hóa sau


- “x  R, x2 + 3x + 1  0”
- “x  R, x2 + 3x + 1  0”
- “x  R, x2 + 1  2x”
- “x  R, x2 + 1 < 0”
The Existential Quantifier: 
Truth and Falsity of Existential Statements.
Ex:
a. Show that the following statement is true.
∃𝑚 ∈ 𝑍 + 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑚2 = 𝑚
Observe that 12 = 1 . Thus “m2 = m” is true for at least one integer
m. Hence “∃𝑚 ∈ 𝑍 + 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑚2 = 𝑚” is true
b. Let E = {5, 6, 7, 8}. Show that the following statement is false.
∃𝑚 ∈ 𝐸 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑚2 = 𝑚
Note that m2 = m is not true for any integer m from 5 through 8:
52=25 ≠ 5, 62=36 ≠ 6, 72=49 ≠ 7, 82=64 ≠ 8,
Hence “∃𝑚 ∈ 𝑍 + 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑚2 = 𝑚” is false
Formal Versus Informal Language
Rewrite the following formal statements in a variety of equivalent
but more informal ways. Do not use the symbol ∀ or .
a. ∀ x ∈ R, x2  0.
All real numbers have non-negative squares.

Every/Any real number has a non-negative square.

The square of each real number is non-negative.


b. ∀ x ∈ R, x2 ≠ -1.

All real numbers have squares that are not -1.


No real numbers have squares equal to -1.
Formal Versus Informal Language
Rewrite the following formal statements in a variety of equivalent
but more informal ways. Do not use the symbol ∀ or .
c.  m ∈ Z+ such that m2 = m.
There is a positive integer whose square is itself.

We can find at least one positive integer equal to its own square.
Some positive integer equals its own square.
Universal Conditional Statements
A reasonable argument can be made that the most important
form of statement in mathematics is the universal conditional
statement: x if P(x) then Q(x).
Familiarity with statements of this form is essential if you are to
learn to speak mathematics

Ex: Rewrite the following statement informally, without quantifiers


or variables: ∀ x ∈ R, if x > 2 then x2  4
If a real number is greater than 2, then its square is greater than 4.
Whenever a real number is greater than 2, its square is greater
than 4.
The squares of all real numbers greater than 2 are greater than 4
Equivalent Forms of Universal Statements
By narrowing U to be the domain D consisting of all values of the
variable x that make P(x) true,

Ex: Rewrite the statement “All squares are rectangles” in the two
forms:
∀ x, if____________then______________
∀ __________x, _____________
Equivalent Forms of Universal Statements
By narrowing U to be the domain D consisting of all values of the
variable x that make P(x) true,

Ex: Rewrite the statement “All squares are rectangles” in the two
forms:
∀ x, if x is a square then x is a rectangles
∀ square x, x is a rectangle
Equivalent Forms of Existential Statements
By narrowing U to be the domain D is the set of all x for which
P(x) is true.

Ex: A prime number is an integer whose only positive integer


factors are itself and 1. Consider the statement “There is an
integer that is both prime and even.”
Let Prime(n) be “n is prime” and Even(n) be “n is even”. Use the
notation Prime(n) and Even(n) to rewrite this statement in the
following two forms:
n such that____________^______________
__________ n such that ________________
Equivalent Forms of Existential Statements
By narrowing U to be the domain D is the set of all x for which
P(x) is true.

Ex: A prime number is an integer whose only positive integer


factors are itself and 1. Consider the statement “There is an
integer that is both prime and even.”
Let Prime(n) be “n is prime” and Even(n) be “n is even”. Use the
notation Prime(n) and Even(n) to rewrite this statement in the
following two forms:
n such that Prime(n) ^ Even(n)
 a prime number n such that Even (n)
Implicit Quantification
Mathematical writing contains many examples of implicitly quantified
statements. Some occur, through the presence of the word a or an. Others
occur in cases where the general context of a sentence supplies part of its
meaning. 3.1.7. Implicit Quant

For example, in an algebra course in which the letter x is always used to


indicate a real number, the predicate

If x > 2 then x2 > 4


is interpreted to mean the same as the statement

∀ real numbers x, if x > 2 then x2 > 4.


Mathematicians often use a double arrow to indicate implicit quantification
symbolically. For instance, they might express the above statement as
Implicit Quantification
Notation: Let P(x) Q(x) be a predicate and suppose the common
domain of x is D.
The notation P(x) Q(x) means that every element in the truth
set of P(x) is in the truth set of Q(x), or, equivalently,
∀x, P(x)→Q(x)
The notation P(x) Q(x) means P(x) and Q(x) have identical truth
sets, or, equivalently, ∀x, P(x) Q(x)

Let Q(n) be “n is a factor of 8”, R(n) be “n is a factor of 4”,


S(n) be “n < 5 and n ≠ 3”, and suppose the domain of n is Z+, the
set of positive integers. Use the and symbols to indicate
true relationship among Q(n), R(n), and S(n).
Implicit Quantification
The notation P(x) Q(x) means that every element in the truth
set of P(x) is in the truth set of Q(x), or, equivalently,
∀x, P(x)→Q(x)
The notation P(x) Q(x) means P(x) and Q(x) have identical truth
sets, or, equivalently, ∀x, P(x) Q(x)

1. The truth set of Q(n) is {1,2,4,8}


and the truth set of R(n) is {1,2,4}.
2.
Thus it is true that every element in the truth set of R(n) is in the
truth set of Q(n), or, ∀ n in Z+, R(n) → Q(n) so
Or, equivalently,
Implicit Quantification
The notation P(x) Q(x) means that every element in the truth
set of P(x) is in the truth set of Q(x), or, equivalently,
∀x, P(x)→Q(x)
The notation P(x) Q(x) means P(x) and Q(x) have identical truth
sets, or, equivalently, ∀x, P(x) Q(x)

2. The truth set of S(n) is {1,2,4} which is


the same truth set of R(n)
1.
or, ∀ n in Z+, R(n) ↔ Q(n) so
Or, equivalently,
Tarski’s World
Tarski’s World is a computer program developed by information
scientists Jon Barwise and John Etchemendy to help teach the
principles of logic.
It is described in their book The Language of FirstOrder Logic,
which is accompanied by a CD-ROM containing the program.
Tarski’s World, named after the great logician Alfred Tarski.
The program for Tarski’s World provides
pictures of blocks of various sizes, shapes,
and colors, which are located on a grid.
Shown in Figure 3.1.1 is a picture of an
arrangement of objects in a two-dimensional
Tarski world
Tarski’s World
The configuration can be described
using logical operators and — for the
two-dimensional version — notation
such as:
Triangle(x), meaning “x is a triangle,”
Blue(y), meaning “y is blue,” and
RightOf(x, y), meaning “x is to the right
of y (but possibly in a different row).”

Individual objects can be given names such as a, b, or c


Tarski’s World
Determine the truth or falsity of the
following statements. The domain for
all variables is the set of objects in
the Tarski’s world shown on the right.
Phủ định của mệnh đề lượng từ
Phủ định của mệnh đề lượng từ hóa vị từ p(x,y,..) có được bằng các
thay  thành , thay  thành  và vị từ p(x,y,..) thành  p(x,y,..).
Với vị từ theo 1 biến ta có : ∀𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∃𝑥 ∈ 𝐴, 𝑝 𝑥
∃𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∀𝑥 ∈ 𝐴, 𝑝 𝑥
VD: Hãy phủ định câu
a)“Tất cả sinh viên khoa CNTT đều đã học toán rời rạc”
b)“Có 1 sinh viên khoa CNTT đã học toán rời rạc”
Gọi P(x) là câu “x đã học toán rời rạc”
a) ∀𝑥 𝑃(𝑥) ⇔ ∃𝑥 ~𝑃(𝑥)
Phủ định của câu là “Không phải tất cả các sinh viên khoa CNTT đều đã
học môn TRR” → Có một sinh viên lớp này chưa học môn TRR
b) ∃𝑥 𝑃(𝑥) ⇔ ∀𝑥 ~𝑃(𝑥)
Phủ định của câu b là “Không có một sinh viên nào của khoa CNTT đã
học môn TRR” → “Mọi sinh viên của khoa CNTT đều chưa học môn
TRR”
Negations of Quantified Statements
Theorem: Negation of a Universal Statement
The negation of a statement of the form
∀x in D, P(x)
Is logically equivalent to a statement of the form
∃x in D such that ~P(x)
Symbolically, ~(∀x in D, P(x))≡ ∃x in D such that ~P(x)

That is, the negation of a universal statement (“all are”) is


logically equivalent to an existential statement (“some are not” or
“there is at least one that is not”).
Negations of Quantified Statements
Theorem: Negation of an Existential Statement
The negation of a statement of the form
∃x in D such that P(x)
Is logically equivalent to a statement of the form
∀x in D, ~P(x)
Symbolically, ~(∃x in D such that P(x))≡∀x in D, ~P(x)
That is, the negation of an existential statement (“some are”) is logically
equivalent to a universal statement (“none are” or “all are not”).

Write formal negations for the following statements:


a. ∀primes p, p is odd.
b. ∃a triangle T such that the sum of the angles of T equals 200o.
Negations of Quantified Statements
Theorem: Negation of an Existential Statement
The negation of a statement of the form
∃x in D such that P(x)
Is logically equivalent to a statement of the form
∀x in D, ~P(x)
Symbolically, ~(∃x in D such that P(x))≡∀x in D, ~P(x)
Write formal negations for the following statements:
a. ∀primes p, p is odd.
∃ a prime p such that p is not odd.
b. ∃ a triangle T such that the sum of the angles of T equals 200o.
∀ triangles T, the sum of the angles of T does not equal 200°
Negations of Universal Conditional
Statements

Ex: Write a formal negation for statement (a) and an informal


negation for statement (b):
a. ∀ people p, if p is blond then p has blue eyes.
b. If a computer program has more than 100,000 lines, then it
contains a bug
Negations of Universal Conditional
Statements

Ex: Write a formal negation for statement (a) and an informal


negation for statement (b):
a. ∀ people p, if p is blond then p has blue eyes.
∃ a person p such that p is blond and p does not have blue eyes
Negations of Universal Conditional Statements

Ex: Write a formal negation for statement (a) and an informal


negation for statement (b):
b. If a computer program has more than 100,000 lines, then it
contains a bug
There is at least one computer program that has more than
100,000 lines and does not contain a bug.
The Relation among ∀, ∃, ꓥ and ꓦ
∀𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∃𝑥 ∈ 𝐴, 𝑝 𝑥

∃𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∀𝑥 ∈ 𝐴, 𝑝 𝑥

The negation of a “for all” statement is a “there exists”

statement, and the negation of a “there exists” statement is a

“for all” statement


The Relation among ∀, ∃, ꓥ and ꓦ
These facts are analogous to De Morgan’s laws, which state that the

negation of an “and” statement is an “or”statement and that the

negation of an “or” statement is an “and” statement.

If Q(x) is a predicate and the domain D of x is the set {x1, x2 ,…, xn},

then

Similarly, if Q(x) is a predicate and D = {x1, x2 ,…, xn}, then

Ex: Let Q(x) be “x.x = x” and suppose D = {0, 1}.


Then ∀𝑥 ∈ 𝐷, Q(x) can be rewritten as ∀ binary digits x, x.x = x.
This is equivalent to 0.0=0 and 1.1=1, which can be rewritten in
symbols as Q(0)ꓥQ(1).
The Relation among ∀, ∃, ꓥ and ꓦ
If Q(x) is a predicate and the domain D of x is the set {x1, x2 ,…, xn},

then

Similarly, if Q(x) is a predicate and D = {x1, x2 ,…, xn}, then

Ex: Let Q(x) be “x+x = x” and suppose D = {0, 1}.


Then ∃𝑥 ∈ 𝐷 such that Q(x)
can be rewritten as
∃ a binary digits x, such that x+x = x.
p q pq
This is equivalent to 1 1 1

0+0=0 and 1+1=1, 1 0 1


0 1 1
which can be rewritten in symbols as Q(0) ꓦ Q(1). 0 0 0
The Relation among ∀, ∃, ꓥ and ꓦ
If Q(x) is a predicate and the domain D of x is the set {x1, x2 ,…, xn},

then

Similarly, if Q(x) is a predicate and D = {x1, x2 ,…, xn}, then

-These facts are analogous to De Morgan’s laws, which state that

the negation of an “and” statement is an “or”statement and that the

negation of an “or” statement is an “and” statement.

-This similarity is not accidental. In a sense, universal statements are

generalizations of “and” statements, and existential statements are

generalizations of “or” statements.


Vacuous Truth of Universal Statements
Vacuous Truth of Universal Statements
Vacuous Truth of Universal Statements
p=

∀𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∃𝑥 ∈ 𝐴, 𝑝 𝑥
~p =
p 𝑝ҧ
1 0
0 1

p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
Variants of Universal Conditional Statements

Write a formal and an informal contrapositive, converse, and inverse for


the following statement: If a real number is greater than 2, then its
square is greater than 4. The formal version: ∀ x ∈ R, if x > 2 then x2 > 4

• Contrapositive: ∀ x ∈ R, if x2 ≤ 4 then x ≤ 2

If the square of a real number is less than or equal to 4, then the number
is less than or equal to 2.
Converse:
Inverse:
Variants of Universal Conditional Statements

If a real number is greater than 2, then its square is greater than 4. The
formal version: ∀ x ∈ R, if x > 2 then x2 > 4

Contrapositive: ∀ x ∈ R, if x2 ≤ 4 then x ≤ 2

If the square of a real number is less than or equal to 4, then the number is
less than or equal to 2.
Converse: ∀ x ∈ R, if x2 > 4 then x > 2

If the square of a real number is greater than 4, then the number is greater
than 2.
Inverse: ∀ x ∈ R, if x ≤ 2 then x2 ≤ 4
If a real number is less than or equal to 2, then the square of the number is
less than or equal to 4.
Variants of Universal Conditional Statements
Let P(x) and Q(x) be any predicates, let D be the domain of x, and consider
the statement:

Any particular x in D that makes “if P(x) then Q(x)” true also makes “if ~Q(x)
then ~P(x)” true (by the logical equivalence between p → q and ~q → ~p).
It follows that “if P(x) then Q(x)” is true for all x in D iff “if ~Q(x) then ~P(x)” is
true for all x in D.

If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)


Variants of Universal Conditional Statements

If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)


Necessary and Sufficient Conditions,
Only if

Rewrite the following statements as quantified conditional sta


tements. Do not use the word necessary or sufficient:
a. Squareness is a sufficient condition for rectangularity.
b. Being at least 35 years old is a necessary condition for being
President of the United States
Necessary and Sufficient Conditions,
Only if

Rewrite the following statements as quantified conditional


statements. Do not use the word necessary or sufficient:
a. Squareness is a sufficient condition for rectangularity.

∀x, if x is a square, then x is a rectangle.


Informal: If a figure is a square, then it is a rectangle.
Necessary and Sufficient Conditions,
Only if

b. Being at least 35 years old is a necessary condition for being


President of the United States.
 person x, if x is younger than 35, then x cannot be president of
the United States.
 person x, if x is president of the United States, then x is at least
35 years old.
Necessary and Sufficient Conditions,
Only if

c. A product of two numbers is 0 only if one of the numbers is 0.


If it is not the case that one of two numbers is 0, then the product
of the numbers is not 0
If neither of two numbers is 0, then the product of the numbers is
not 0
If a product of two numbers is 0, then one of the numbers is 0
Lượng từ hóa vị từ hai biến
Statements with Multiple Quantifiers
Interpreting Multiply-Quantified
Statements
Lượng từ hóa vị từ hai biến
Statements with Multiple Quantifiers
Định nghĩa. Cho p(x, y) là một vị từ theo hai biến x, y xác định trên
AB. Ta định nghĩa các mệnh đề lượng từ hóa của p(x, y) như sau:
“x  A,y  B, p(x, y)” = “x  A, (y  B, p(x, y))”
“x  A, y  B, p(x, y)” = “x  A, (y  B, p(x, y))”
“x  A, y  B, p(x, y)” = “x  A, (y  B, p(x, y))”
“x  A, y  B, p(x, y)” = “x  A, (y  B, p(x, y))”

VD: Diễn đạt câu


“Mọi người đều có chính xác một người bạn tốt nhất”
Đặt B(x,y) là câu “y là bạn tốt nhất của x”
∀𝑥 ∃𝑦 ∀𝑧 𝐵 𝑥, 𝑦 ꓥ ((z≠y) → ¬𝐵(𝑥, 𝑧))
Lượng từ hóa vị từ hai biến
Mệnh đề Khi nào đúng Khi nào sai
x y p(x,y) p(x,y) đúng với mọi cặp Có một cặp (x,y) đối với
y x p(x,y) (x,y) nó p(x,y) là sai
x y p(x,y) Với mọi x, có một y sao Có một x sao cho p(x,y) là
cho p(x,y) là đúng sai với mọi y
x y p(x,y) Có một x sao cho p(x,y) Với mọi x, có một y sao
đúng với mọi y cho p(x,y) là sai
x y p(x,y) Có một cặp (x,y) sao cho p(x,y) đúng với mọi cặp
y x p(x,y) p(x,y) là đúng (x,y)

VD
Mệnh đề “x  R, y  R, x + 2y < 1” đúng hay sai?
Mệnh đề sai vì tồn tại x0 = 0, y0 = 1  R mà x0 + 2y0  1.
Lượng từ hóa vị từ hai biến
Định lý. Cho p(x, y) là một vị từ theo hai biến x, y xác định trên AB.
Khi đó: 1) “x  A, y  B, p(x, y)”  “y  B, x  A, p(x, y)”
2) “x  A, y  B, p(x, y)”  “y  B, x  A, p(x, y)”
3) “x  A, y  B, p(x, y)”  “y  B, x  A, p(x, y)”
Chiều đảo của 3) nói chung không đúng.
Mệnh đề Khi nào đúng Khi nào sai
x y p(x,y) p(x,y) đúng với mọi cặp Có một cặp (x,y) đối với
y x p(x,y) (x,y) nó p(x,y) là sai
x y p(x,y) Với mọi x, có một y sao Có một x sao cho p(x,y) là
cho p(x,y) là đúng sai với mọi y
x y p(x,y) Có một x sao cho p(x,y) Với mọi x, có một y sao
đúng với mọi y cho p(x,y) là sai
x y p(x,y) Có một cặp (x,y) sao cho p(x,y) đúng với mọi cặp
y x p(x,y) p(x,y) là đúng (x,y)
Interpreting Multiply-Quantified
Statements
A college cafeteria line has four
stations:
The salad station offers a choice of
green salad or fruit salad;
The main course station offers
spaghetti or fish;
The dessert station offers pie or
cake;
The beverage station offers milk,
soda, or coffee.
Three students, Uta, Tim, and Yuen, go through the line and make
the following choices:
Uta: green salad, spaghetti, pie, milk
Tim: fruit salad, fish, pie, milk, coffee
Yuen: spaghetti, fish, pie, soda
Interpreting Multiply-Quantified
Statements
Write each of following statements
informally and find its truth value.
a. ∃ an item I such that ∀ students
S, S chose I.
b. ∃ a student S such that ∀ items I,
S chose I.
c. ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that
S chose I.
d. ∀ students S and ∀ stations Z, ∃ an item I in Z such that S
chose I
Interpreting Multiply-Quantified
Statements

a. ∃ an item I such that ∀


students S, S chose I.
There is an item that was chosen by
every student. This is true; every
student chose pie.
b. ∃ a student S such that ∀ items I, S chose I.
There is a student who chose every available item. This is false;
no student chose all nine items.
Interpreting Multiply-Quantified
Statements
c. ∃ a student S such that ∀ stations
Z, ∃ an item I in Z such that S chose I.
There is a student who chose at least
one item from every station. This is true;
both Uta and Tim chose at least one
item from every station
d. ∀ students S and ∀ stations Z, ∃ an item I in Z such that S
chose I
Every student chose at least one item from every station. This is
false; Yuen did not choose a salad.
Translating from Informal to Formal
Language
Most problems are stated in informal language, but solving
them often requires translating them into more formal terms.
Example: The reciprocal (số nghịch đảo) of a real number a is
a real number b such that ab = 1. The following 2 statements
are true. Rewrite them formally using quantifiers and variables:
a. Every nonzero real number has a reciprocal.
∀ nonzero real numbers u, ∃ a real number v such that uv = 1.
b. There is a real number with no reciprocal.
∃ a real numbers c such that ∀ real number d, cd ≠ 1
Ambiguous Language
You are visiting a computer microchips factory. The factory
guide tells you:
There is a person supervising every detail of the production
process.
“there is” – existential quantifier; “every” – universal quantifier.
Which of the following best describes its meaning?
There is one single person who supervises all the details of
the production process.
For any particular production detail, there is a person who
supervises the detail, but there might be different supervisors
for different details.
Ambiguous Language
You are visiting a computer microchips factory. The factory
guide tells you:
There is a person supervising every detail of the production
process.
“there is” – existential quantifier; “every” – universal quantifier.
Which of the following best describes its meaning?
There is one single person who supervises all the details of
the production process.
For any particular production detail, there is a person who
supervises the detail, but there might be different supervisors
for different details.
Ambiguous Language
Once you interpreted the sentence in one way, it may have been
hard for you to see that it could be understood in the other way.
Perhaps you had difficulty even though the two possible meanings
were explained.
Although statements written informally may be open to multiple
interpretations, we cannot determine their truth or falsity without
interpreting them one way or another
Therefore, we have to use context to try to ascertain their
meaning as best we can.
Phủ định của mệnh đề lượng từ
Phủ định của mệnh đề lượng từ hóa vị từ p(x,y,..) có được bằng các
thay  thành , thay  thành  và vị từ p(x,y,..) thành p(x,y,..).
Với vị từ theo 1 biến ta có : ~∀𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∃𝑥 ∈ 𝐴, ~𝑝 𝑥
~∃𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∀𝑥 ∈ 𝐴, ~𝑝 𝑥

Phủ định các lượng từ


Phủ định Mệnh đề Khi nào phủ định là Khi nào là sai
tương đương đúng
~∃𝑥 P(x) ∀𝑥 ~P(x) P(x) sai với mọi x Có một x để P(x) là
đúng
~∀𝑥 P(x) ∃𝑥 ~P(x) Có một x để P(x) sai P(x) đúng với mọi x
Order of Quantifiers

In a statement containing both ∀ and ∃, changing the order of the


quantifiers usually changes the meaning of the statement.
However, if one quantifier immediately follows another quantifier of
the same type, then the order of the quantifiers does not affect the
meaning.
Negations of Multiply-Quantified
Statements
Phủ định của mệnh đề lượng từ
Vị từ theo 2 biến. ∀𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∃𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦

∀𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∃𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦
∃𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∀𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦
∃𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∀𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦

Ví dụ phủ định các mệnh đề sau


a) “x  A, 2x + 1  0”
“x  A, 2x + 1 > 0”

b) “ > 0,  > 0, x  R,  x – a <  → f(x) – f(a) < ”.


“ > 0,  > 0, x  R,  x – a <   (f(x) – f(a)  )”.
Negations of Multiply-Quantified
Statements
Negations of Multiply-Quantified
Statements
Negations of Multiply-Quantified
Statements

∀ triangle x, ~(∀ square y, x is to the right of y).


∀ triangle x, ∃ a square y such that x is not to the right of y.
The negation is true because no matter what triangle is chosen, it is not
to the right of square g or square j, which are the only squares in this
Tarski world.
Order of Quantifiers

In a statement containing both ∀ and ∃, changing the order of the


quantifiers usually changes the meaning of the statement.
However, if one quantifier immediately follows another quantifier of
the same type, then the order of the quantifiers does not affect the
meaning.
Order of Quantifiers
Order of Quantifiers

Statement (a) says that if someone gives


you one of the squares from the Tarski
world, you can find a triangle that has a
different color. This is true.
If someone gives you square g or h (which
are gray), you can use triangle d (which is
black);
if someone gives you square e (which is black), you can use either
triangle f or i (which are gray);
And if someone gives you square j (which is blue), you can use
triangle d (which is black) or triangle f or I (which are gray).
Order of Quantifiers

(b) says that there is one particular triangle in


the Tarski world that has a different color
from every one of the squares in the world.
This is false.
Two of the triangles are gray, but they cannot
be used to show the truth of the statement
because the Tarski world contains gray
squares.
The only other triangle is black, but it cannot be used either because there
is a black square in the Tarski world.
Thus one of the statements is true and the other is false, and so they have
opposite truth values.
Formal Logical Notation
In some areas of computer science, logical statements are
expressed in purely symbolic notation.
The notation involves using predicates to describe all properties
of variables and omitting the words such as in existential
statements
Ví dụ.
Xét các câu sau, trong đó hai câu đầu là tiền đề và câu thứ ba là kết luận
đúng. Toàn bộ tập hợp ba câu này được gọi là một suy lí
a) “Tất cả sư tử đều hung dữ” b) “Một số sư tử không uống cafe”
c) “Một số sinh vật hung dữ không uống cafe”
Giả sử rằng không gian là tập hợp toàn bộ các sinh vật, hãy diễn đạt các
câu trong suy lý trên bằng cách dung P(x), Q(x),R(x) và các lượng từ
Gọi
P(x) là câu x là sư tử ; Q(x) là câu x hung dữ ; R(x) là câu x uống café
a) x , (P(x) →Q(x) b) x, (P(x) ꓥ ~ R(x)) c) x, (Q(x) ꓥ ~R(x))
Câu b không thể viết là x, (P(x) →~ R(x)) bởi (P(x) →~ R(x)) là đúng
bất cứ khi nào x không phải là sư tử, do đó x, (P(x) →~ R(x)) là đúng
chừng nào còn có ít nhất một sinh vật không phải là sư tử, thậm chí mặc
dù tất cả các sư tử đều uống cafe
Formalizing Statements in a Tarski’s
World
Formalizing Statements in a Tarski’s
World

Representation of If-Then as Or
p → q  ~p  q
Formalizing Statements in a Tarski’s
World
Formalizing Statements in a Tarski’s
World
Formalizing Statements in a Tarski’s
World
Formal Logical Notation
Prolog
Prolog
Prolog
Prolog
Prolog
Arguments with Quantified Statements
The rule of universal instantiation:
If some property is true of everything in the set, then it is true of
any particular thing in the set.
Universal instantiation is the fundamental tool of deductive
reasoning
The rule of universal instantiation can be combined with modus
ponens to obtain the valid form of argument called universal
modus ponens.
Recognizing Universal Modus Ponens
Use of Universal Modus Ponens in a
Proof
Use of Universal Modus Ponens in a
Proof
Use of Universal Modus Ponens in a
Proof
Use of Universal Modus Ponens in a
Proof
Universal Modus Tollens
Recognizing Universal Modus Tollens
An Argument with “No
An Argument with “No
Creating Additional Forms of
Argument
Creating Additional Forms of
Argument
Evaluating an Argument for Tarski’s
World
Evaluating an Argument for Tarski’s
World
Evaluating an Argument for Tarski’s
World
Evaluating an Argument for Tarski’s
World
Fallacies

For an argument to be valid, every argument of the same form


whose premises are all true must have a true conclusion.
It follows that for an argument to be invalid means that there is an
argument of that form whose premises are all true and whose
conclusion is false.
Proving Validity of Arguments with
Quantified Statements
Using Diagrams to Test for Validity
Using Diagrams to Show Invalidity
Using Diagrams to Show Invalidity
Using Diagrams to Test for Validity

If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)


Using Diagrams to Test for Validity

If not q then not p if p the q if q the p If not p then not q

(Phản đảo) (Đảo) (Nghịch Đảo)


Remark on the Converse and Inverse
Errors
Remark on the Converse and Inverse
Errors
End of File

You might also like