DisMath 复习
DisMath 复习
Discrete Mathematics
Discrete Mathematics
▪ 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
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 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
▪ Algorithm:
2. Find the truth value of each compound expression that occurs in the
compound proposition according to the operator precedence
11
Compound Proposition
12
Compound Proposition
13
Compound Proposition
14
Compound Proposition
15
Compound Proposition
16
Compound Proposition
17
Compound Proposition
▪ 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
▪ Universal Quantification
▪ i.e. all, none
▪ Existential Quantification
▪ i.e. some, few, many
▪ Unique Quantification
▪ i.e. exactly one
▪ 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),
▪ 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),
▪ 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
Yan Huang
School of Computer Science and Engineering
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
2.1 Sets