0% found this document useful (0 votes)
311 views

Discrete Structures Cấu Trúc Rời Rạc: TS Nguyễn Thị Huỳnh Trâm

The document discusses discrete structures and logical forms. It defines discrete structures as the study of logical principles in mathematics used to represent discrete objects. It provides examples of logical forms and their representation using letters. Compound statements are defined as statements constructed from other statements using logical connectives like AND and OR.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
311 views

Discrete Structures Cấu Trúc Rời Rạc: TS Nguyễn Thị Huỳnh Trâm

The document discusses discrete structures and logical forms. It defines discrete structures as the study of logical principles in mathematics used to represent discrete objects. It provides examples of logical forms and their representation using letters. Compound statements are defined as statements constructed from other statements using logical connectives like AND and OR.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 111

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(“Week") disp("Week")
} 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 Jane is a math major or Jane is a computer science major,
then Jane will take Math 150.
Jane is a computer science major.
Therefore, Jane will take Math 150

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 Jane is a math major or Jane is a computer science major,
then Jane will take Math 150.
Jane is a computer science major.
Therefore, Jane will take Math 150
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
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
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
0 1 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 0 0
1 0 0 0 0 0 0 p q pq
2 0 0 1 0 0 0
1 1 1
3 0 1 0 0 0
1 0 1
4 0 1 1 1 1
0 1 1
5 1 0 0 0 1 0 0 0
6 1 0 1 0 1

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
0 1 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 0 0
1 0 0 0 0 0 0 p q pq
2 0 0 1 0 0 0
1 1 1
3 0 1 0 0 0 1
1 0 1
4 0 1 1 1 1 1 1
0 1 1
5 1 0 0 0 1 1 0 0 0
6 1 0 1 0 1 1 1

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
0 1 0
p q r q∧r p∨(q∧r) p∨q (p∨q) ∧r 0 0 0
1 0 0 0 0 0 0 0 p q pq
2 0 0 1 0 0 0 0
1 1 1
3 0 1 0 0 0 1 0
1 0 1
4 0 1 1 1 1 1 1
0 1 1
5 1 0 0 0 1 1 0 0 0 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
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:
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 “if p, then q”
“p is sufficient for q”
0 0 1 “if p, q”
“a sufficient condition for q is p”
“q if p”
0 1 1 “a necessary condition for p is q”
“q when p”
1 0 0 “q whenever p”
“q unless ¬p”
“q is necessary for p”
1 1 1 “p implies q”
“q follows from p”
p → q ≡ ~p  q “p only if q”
p → q ≡ p 𝑞ത 𝑝ҧ  q
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 f
ired”. 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 f
ired”. 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: 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
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ịc đả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”
Ex: Rewrite the following statement in if-then form in two ways,
one of which is the contrapositive of the other.
John will break the world’s record only if he runs the mile in
under four minutes. → If John does not run the mile in under four
minutes, then John will not break the world’s record.
p q p→q if p the q p→q
0 0 1 Converse (Đảo) If q then p q→p
0 1 1 Contrapositive(Phản đảo) If not q then not p 𝑞ത → 𝑝ҧ
1 0 0 Inverse If not p then not q 𝑝ҧ → 𝑞ത
1 1 1

Representation of If-Then as Or
p → q ≡ ~p  q
Negation of Conditional Statement
~(p → q) ≡ 𝐩 ~q
if p then q p→q “if p, then q”
Converse (Đảo) If q then p q→p “q whenever p”
“if p, q”
Contrapositive If not q then not p 𝑞ത → 𝑝ҧ
“p is sufficient for q”
(Phản đảo)
“q if p”
Inverse If not p then not q 𝑝ҧ → 𝑞ത “q when p”
“a necessary condition
for p is 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.”
if p then q p→q “if p, then q”
Converse (Đảo) If q then p q→p “q whenever p”
“if p, q”
Contrapositive If not q then not p 𝑞ത → 𝑝ҧ
“p is sufficient for q”
(Phản đảo)
“q if p”
Inverse If not p then not q 𝑝ҧ → 𝑞ത “q when p”
“a necessary condition
for p is 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.”
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”
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
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.”
“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
p is sufficient for q
“For Maria to get a good job, it is sufficient for her to 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: 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
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 Convert:
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.
Necessary and Sufficient Conditions
Definition (Necessary and Sufficient Conditions)
If r and s are statements,
“r is a sufficient condition for s” mean “if r then s”
“r is a necessary condition for s” mean “if not r then not s”
- In other words, to say “r is a sufficient condition for s” means that
the occurrence of r is sufficient to guarantee the occurrence of s
- On the other hand, to say “r is a necessary condition for s”
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.
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.
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
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.
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”
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 ‫)𝒒¬ ٿ‬
Bài tậ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
Bài tập
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
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) :
Độ ưu tiên các phép toán

1) Ngoặc ()
2) Phủ định
3) Và
4) Hay
5) Kéo theo →
6) Kéo theo hai chiều
Ví dụ:
1) p q →rhiểu là (p q) →r
2) p (q r)  q hiểu là (p (q r))  (q)
Logically Equivalent (Tương đương logic)
p q p→q p q p↔q p q ¬p E: F:
p →qq→p p→q ¬ p∨q
0 0 1 0 0 1 0 0 1 1 1
0 1 1 0 1 0 0 1 1 1 1
1 0 0 1 0 0 1 0 0 0 0
1 1 1 1 1 1 1 1 0 1 1
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ị)
Logically Equivalent (Tương đương logic)
p q p→q p q p↔q p q ¬ p E: F:
p →qq→p p→q ¬ p∨q
0 0 1 0 0 1 0 0 1 1 1
0 1 1 0 1 0 0 1 1 1 1
1 0 0 1 0 0 1 0 0 0 0
1 1 1 1 1 1 1 1 0 1 1

Hai dạng mệnh đề p→q và ¬ p∨q có cùng bảng chân trị. Ta nói 2
mệnh đề này tương đương logic.
Note: Two statements are called logically equivalent if, and only if,
they have logical equivalent forms when identical component
statement variables are used to replace identical component
statements
Chú ý: Nếu E và F tương đương logic thì dạng mệnh đề E ⇔ F
luôn lấy giá trị là 1 dù các biến có lấy giá tri nào đi nữa.
Logically Equivalent
(Tương đương logic)
p q p→q p q p↔q p q ¬ p E: F: ¬
p →qq→p p→q p∨q
0 0 1 0 0 1 0 0 1 1 1
0 1 1 0 1 0 0 1 1 1 1
1 0 0 1 0 0 1 0 0 0 0
1 1 1 1 1 1 1 1 0 1 1
Hai dạng mệnh đề p→q và ¬ p∨q có cùng bảng chân trị. Ta nói 2
mệnh đề này tương đương logic.
Chú ý: Nếu E và F tương đương logic thì dạng mệnh đề E↔ F
luôn lấy giá trị là 1 dù các biến có lấy giá tri nào đi nữa.
Logically Equivalent (Tương đương logic)
11. Luật về phép kéo theo
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
p q p→q if p the q p→q
0 0 1 Converse (Đảo) If q then p q→p
0 1 1 Contrapositive(Phản đảo) If not q then not p 𝑞ത → 𝑝ҧ
1 0 0 Inverse If not p then not q 𝑝ҧ → 𝑞ത
1 1 1

p → q ≡ 𝑝ҧ  q

p → q ≡ p 𝑞ത
2. Luật De Morgan  (p  q)   p   q
 (p  q)   p   q
5. Luật phân phối p  (q  r)  (p  q)  (p  r)
p  (q  r)  (p  q)  (p  r)
11. Luật về phép kéo theo 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
Giải: (p → r)  (q → r)
 ( p  r )  ( q  r) (luật 11. về phép kéo theo)
 ( p  q )  r (luật phân phối)
 ( p  q )  r (De Morgan)
 ( p → q )  r (luật 11. về phép kéo theo)
 ( p → q ) → r (luật 11. về phép kéo theo)
Phép chứng minh đảo đề
• Ứng dụng luật về phép kéo theo p → q  q →  p
• Để CM p → q đúng, ta CM q →  p đúng.
• Ví dụ:
• Cho n là số tự nhiên. CM nếu n2 là số chẵn thì n là số chẵn.
• Ta CM nếu n là số lẻ thì n2 là số lẻ.

Phép chứng minh phản ví dụ p q p→q


• Ứng dụng luật về phép kéo theo kết hợp luật De Morgan
0 0 1
• p → q  p  q
•  (p → q)  p  q. 0 1 1
• Để CM p → q sai, ta CM p đúng, q sai. 1 0 0
• “Phản ví dụ” = “trường hợp làm MĐ sai”
1 1 1
• Ví dụ: Cho n là số tự nhiên. “Nếu n chia hết cho 4 thì n
2
cũng chia hết cho 4”.
Để CM phát biểu trên sai ta tìm 1 số n nào đó không thoả.
(chẳng hạn n = 6).
Phép chứng minh phản chứng
• Để CM p đúng ta CM nếu p sai thì suy ra điều vô lý hay mâu
thuẫn.
• VD:
• CM căn bậc hai của 2 là số vô tỷ. ( 2= 1.414213)
• Giải:
• Giả sử căn 2 là số hữu tỷ, tức là 21/2 = m/n
(dạng tối giản) với m,n là các số nguyên và UCLN(m,n)=1.
• (m/n)2 = 2. Hay m2 = 2n2. Nên m chẵn
• Khi đó m=2k. Suy ra n2 = 2k2. Nên n cũng chẵn.
• Như vậy UCLN(m,n)>1 (mâu thuẫn).
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

You might also like