DHTDT CTRR
DHTDT CTRR
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.
-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 đề)
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
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
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).
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):
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 pq
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:
b. To say it is neither hot nor sunny means that it is not hot and it is not sunny.
(~h ꓥ ~ s)
p q pq
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 pq
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 pq
Truth Table for p q 1 1 1
1 0 1
0 1 1
0 0 0
p q pq p q pq
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 pq p q pq
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 pq p q pq
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 pq p q pq
𝐩 ⊕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
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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 pq
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
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
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.
“Not the case that both 0<1 and 1<0” which is TRUE
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 ꓥ 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.
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
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.
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 pq p q pq p q pq 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
Solution:
Let r be “Heather will go to the concert” and s be “Steve will go to the
concert.”
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
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
p → (q → r ) ps p → (q → r ) t→q
ps 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)
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
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.
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 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.
∃𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∀𝑥 ∈ 𝐴, 𝑝 𝑥
If Q(x) is a predicate and the domain D of x is the set {x1, x2 ,…, xn},
then
then
then
∀𝑥 ∈ 𝐴, 𝑝 𝑥 ⇔ ∃𝑥 ∈ 𝐴, 𝑝 𝑥
~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
• 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.
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 AB.
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
∀𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∃𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦
∃𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∀𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦
∃𝑥 ∈ 𝐴, ∃𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦 ⇔ ∀𝑥 ∈ 𝐴, ∀𝑦 ∈ 𝐵, 𝑝 𝑥, 𝑦
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