0% found this document useful (0 votes)
9 views312 pages

DisMath 复习

The document covers the fundamentals of Discrete Mathematics, focusing on logic and proof, including propositional logic, logical equivalences, predicates, and quantifiers. It explains concepts such as propositions, truth tables, compound propositions, and the rules of inference. Additionally, it introduces set theory and its operations, providing a comprehensive overview of the subject matter.

Uploaded by

amir.bakbergennn
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)
9 views312 pages

DisMath 复习

The document covers the fundamentals of Discrete Mathematics, focusing on logic and proof, including propositional logic, logical equivalences, predicates, and quantifiers. It explains concepts such as propositions, truth tables, compound propositions, and the rules of inference. Additionally, it introduces set theory and its operations, providing a comprehensive overview of the subject matter.

Uploaded by

amir.bakbergennn
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/ 312

Review of

Discrete Mathematics
Discrete Mathematics

Chapter 1: Logic and Proof

1.1 Propositional Logic


1.2 Propositional Equivalences
Yan Huang
School of Computer Science and Engineering
South China University of Technology
Agenda
▪ Ch1.1 Propositional Logic
▪ Proposition
▪ Propositional Operator
▪ Compound Proposition
▪ Applications
▪ Ch1.2 Propositional Equivalences
▪ Logical Equivalences
▪ Using De Morgan's Laws
▪ Constructing New Logical Equivalences
Propositions
▪ Proposition (also called statement) is a declarative sentence
(declares a fact) that is either true or false, but not both
▪ Truth value of a proposition is either True/False (T/F) to indicate
its correctness

▪ Example:
▪ Keep quiet

Not declarative
▪ 1 hour has 50 minutes

False
▪ 1+1=3 False
▪ x+2=4 Can be either true or false
Can be turned into proposition when x is defined
4
Propositions
▪ Proposition Variable is letters denote propositions
▪ Conventional letters are p,q,r,s,……P,Q ,……
▪ Proposition Logic is the area of logic that deals with
propositions
▪ Logic Operators
Formal Name Nickname Symbol
Negation Operator NOT ¬
Conjunction Operator AND ⋀
Disjunction Operator OR ⋁
Exclusive-OR Operator XOR ⨁
Conditional Statement Imply →
Biconditional Statement Equivalent 5
Proposition Logic
Conditional Statement (imply)
▪ Example: p → q and its Contrapositive are equivalent
▪ Given p → q
Converse and Inverse are equivalent
“If it rains, the floor is wet”
▪ Situation 1 (¬p → ¬q) Inverse
If it does not rain, the floor is not wet
▪ Situation 2 (q → p ) Converse
If the floor is wet, it rains
▪ Situation 3 (¬q → ¬p) ✓ Contrapositive
If the floor is not wet, it does not rain

6
Proposition Logic
Truth Table
▪ Truth Table displays the relationships between the truth values of
propositions
▪ Example:
▪ Truth Table of Negation Operation

P ¬P
T F
F T

Operand Column Result Column

7
Proposition Logic
Truth Table
Conditional Biconditional
Statement Statement
NOT AND OR XOR (imply) (equivalent)
p q ¬p p ⋀q p⋁q p ⊕q p→q p q

T T F T T F T T

T F F F T T F F

F T T F T T T F

F F T F F F T T

8
Compound Proposition
▪ Compound Propositions are formed from existing propositions using proposition logical
operators
▪ Example: Beijing is the capital of China and 1+1=2

▪ How can we determine the truth values of the complicated compound propositions
involving any number of propositional variables?
▪ Example:
What is the truth value for every situations? p → ¬q s⋀q⨁p

9
Compound Proposition

▪ Precedence of Logical Operator

Precedence Operator
1 ¬ NOT
2 ⋀ AND
3 ⋁ ⨁ OR XOR
4 → Imply
5 Equivalent

▪ Example:

✓ ✓
▪ p⋁q⋀r ▪ ¬s ⋀ f ▪ a f→b


▪ p ⋁ ( q ⋀ r) ▪ (¬ s )⋀ r ▪ (a f) →b
▪ (p ⋁ q) ⋀ r ▪ ¬(s ⋀ f ) ▪ a (f→b )

10
Compound Proposition

▪ Truth tables can be used to determine the truth values of the


complicated compound propositions

▪ Algorithm:

1. Write down all the combinations of the compositional variables

2. Find the truth value of each compound expression that occurs in the
compound proposition according to the operator precedence

11
Compound Proposition

2. Write down all the combinations of the compositional variables

12
Compound Proposition

2. Write down all the combinations of the compositional variables

13
Compound Proposition

2. Find the truth value of each compound expression


that occurs in the compound proposition according to
the operator precedence

14
Compound Proposition

2. Find the truth value of each compound expression


that occurs in the compound proposition according to
the operator precedence

15
Compound Proposition

2. Find the truth value of each compound expression


that occurs in the compound proposition according to
the operator precedence

16
Compound Proposition

2. Find the truth value of each


compound expression that occurs in
the compound proposition according
to the operator precedence

17
Compound Proposition

2. Find the truth value of


each compound expression
that occurs in the compound
proposition according to the
operator precedence
18
Translating English Sentences
▪ Algorithm:
1. Remove the connective operators
2. Let a variable for each complete concept
3. Use the operators to connect the variables
4. Adding brackets in suitable positions will be helpful

▪ Example:
▪ You can access the Internet from campus only if you are a computer science major or you
are not a freshman
p →(q ⋁ ¬ s )
▪ p: “You can access the Internet from campus”
▪ q: “You are a computer science major”
▪ s: “You are a freshman”

19
Types of Proposition
▪ Tautology P ¬P P ⋁ ¬P
▪ A compound proposition which is always true T F T
▪ Example: P ⋁ ¬P F T T

▪ Contradiction
P ¬P P ∧ ¬P
▪ A compound proposition which is always false T F F
▪ Example: P ∧ ¬P F T F

▪ Contingency
▪ A compound proposition which is neither a P P ∧ ¬P P ⊕ (P ∧ ¬P)
T F T
tautology nor a contradiction
F F F
▪ Example: P ⊕(P ∧ ¬P)
20
Logically Equivalence

▪ Definition
Two propositions P and Q are logically equivalent if P Q is a
tautology

▪ Notation: P ⇔ Q or P ≡ Q

21
22
23
24
Discrete Mathematics

Chapter 1: Logic and Proof

1.3 Predicates and Quantifiers

1.4 Nested Quantifiers


Yan Huang
School of Computer Science and Engineering
South China University of Technology

Thanks to Dr Patrick Chan for providing the Slides


Agenda

▪ Ch1.3 Predicates and Quantifiers


▪ Predicates
▪ Quantifiers
▪ Quantifiers with Restricted Domains
▪ Precedence of Quantifiers
▪ Logical Equivalences Involving Quantifiers
▪ Translation
▪ Ch1.4 Nested Quantifiers
▪ Nested Quantifiers
Predicates
▪ Predicate is a function of proposition
▪ Example: Convention:
• lowercase variables denote objects
• UPPERCASE variables denote predicates

Propositional Function Variable Predicate


/Predicate x is greater than 3
P(x) :
Refer to

▪ The truth value of proposition function can


only be determined when the values of
variables are known
Predicates
▪ General case
▪ A statement involving the n variables x1, x2, …,
xn can be denoted by
P(x1, x2, …, xn)
▪ A statement of the form P(x1, x2, …, xn) is the
value of the propositional function P at the
n-tuple (x1, x2, …, xn)
▪ P is also called a n-place predicate or a
n-ary predicate
Quantifiers
▪ Quantification expresses the extent to which a
predicate is true over a range of elements

Peter Paul Mary


▪ For example
▪ Using Propositional Logic
▪ p: Peter has iPhone iPhone
▪ q: Paul has iPhone
▪ r: Mary has iPhone Our class
Assume our class only contains three students
▪ Using Predicate
▪ P(x) : x has iPhone ▪ Using Quantifier
▪ P(Peter) ▪ P(x) : x has iPhone
▪ P(Paul) ▪ For all x, P(x) is true
▪ P(Mary) ▪ Domain consists of
all student in this class
Quantifiers
▪ Four aspects should be mentioned in Quantification
Peter Paul Mary
1. Quantifier
(e.g. all, some…)
2. Variable
3. Predicate Our class
4. Domain P(x) : x has iPhone
For all x, P(x) is true
Domain consists of all student in this class

▪ The area of logic that deals with predicates


and quantifiers is called the Predicate
Calculus
Quantifiers
▪ Universes of Discourse (U.D.s)
▪ Also called the domain of discourse
▪ Refers to the collection of objects being
discussed in a specific discourse
▪ Example:
▪ P(x) : “x breaths oxygen“
▪ Domain consists of humans
P(x) is true for all x?
▪ Domain consists of creatures
P(x) is true for all x?
Quantifiers

▪ Three types of quantification will be focused:

▪ Universal Quantification
▪ i.e. all, none

▪ Existential Quantification
▪ i.e. some, few, many

▪ Unique Quantification
▪ i.e. exactly one

▪ Can be expressed by using Universal Quantification and


Existential Quantification
Quantifiers
Universal Quantifiers (ALL)
▪ Definition
Universal quantification of P(x) is the statement “P(x)
is true for all values of x in the domain”
▪ Notation: ∀x P(x)
▪ ∀ LL, reversed “A”
▪ Read as
▪ "for all x P(x)"
▪ "for every x P(x)"

▪ Truth value
▪ True when P(x) is true for all x
▪ False otherwise
▪ An element for which P(x) is false is called a counterexample
Quantifiers
Universal Quantifiers
▪ When all of the elements in the universe of discourse can be listed one by
one (discrete) (e.g. x1,x2,…,xn),

∀x P(x) ≡ P(x1) ∧P(x2) ∧ ... ∧ P(xn)

▪ For example
▪ Our class has three students: John, Peter and Mary
▪ Every student in our class has attended the class
Quantifiers
Existential Quantifiers (SOME)
▪ Definition
Existential quantification of P(x) is the proposition
“There exists an element x in the domain
such that P(x) is true”
▪ Notation: ∃ x P(x)
▪ ∃ XIST, reversed “E”
▪ Read as
▪ “There is an x such that P(x)”
▪ “There is at least one x such that P(x)”
▪ "For some x P(x)"

▪ Truth value
▪ False when P(x) is false for all x
▪ True otherwise
Quantifiers
Existential Quantifiers
▪ When all of the elements in the universe of discourse can be listed
one by one (discrete) (e.g. x1,x2,…,xn),

∃ x P(x) ≡ P(x1) ∨ P(x2) ∨ ... ∨ P(xn)

▪ For example
▪ Our class has three students: John, Peter and Mary
▪ Any student in our class has attended the class
??
???

Yes No
P(x): x is a good student
Discrete Mathematic

Chapter 1: Logic and Proof

1.5 Rules of Inference


1.6 Introduction to Proofs

Yan Huang
School of Computer Science and Engineering

South China University of Technology

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Discrete Mathematic

Chapter 2: Set Theory

2.1 Sets

2.2 Set Operations


Yan Huang
School of Computer Science and Engineering
South China University of Technology

Thanks to Dr Patrick Chan for providing the Slides


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
r (R) s (R) t (R)
R is relfecxive √ √ √
R is symmetric √ √ √
R is transitive √ × √ 179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311

You might also like