Title: ?? ?? Discrete Mathematics
1?? ??Discrete Mathematics
Hyogon Kim ??? 303 hyogon_at_korea.ac.kr / 3204
2?? ??
- ??
- Discrete Mathematics(7/e), R. Johnsonbaugh,
Prentice Hall, 2008 - ?? ??
- 2 Midterms 30 (9? ?, 10? ?)
- 4 Quizzes 25 (23? ??, from Homework)
- 1 Final 25 alpha
- 6 HWs/PGs 1218
- Plagiarism policy
- ?? ?? widen.korea.ac.kr ? Courses ? ????
38/28 Ch 1
30 Ch 1 Hw 1 Ch 1, 2
9/4 Ch 2
6 Ch 2
11 Ch 3
13 Ch 3 Hw 2 Ch 3, 4
18 Ch 4 Quiz 1 Ch 1, 2
20 Ch 4
25 Ch 5
27 Ch 5 Hw 3 Ch 5, 6
10/2 Ch 6
4 Ch 6 Quiz 2 Ch 3, 4
9 Ch 7
11 Ch 7 Hw 4 Ch 7, 8
16 Wed Exam 1 Ch 16
18 Ch 8
23 Ch 8
25 Ch 9
430 Ch 9
11/1 Ch 9 Hw 5 Ch 9, 10
6 Ch 10 Quiz 3 Ch 7, 8
8 Ch 10
13 Ch 11
15 Ch 11 Hw 6 Ch 11, 12
20 Wed Exam 2 Ch 710
22 Ch 12
27 Ch 12
29
12/4 - Quiz 4 Ch 11, 12
6 - Final All chapters
5Discrete Mathematics 7th
edition, 2009
- Chapter 1
- Sets and logic
- Chapter 2
- Proofs
61.1 Sets
- Set a collection of distinct unordered objects
- Members of a set are called elements
- How to determine a set
- Listing
- Example A 1,3,5,7
- Description
- Example B x x 2k 1, 0 lt k lt 3
7Finite and infinite sets
- Finite sets
- Examples
- A 1, 2, 3, 4
- B x x is an integer, 1 lt x lt 4
- Infinite sets
- Examples
- Z integers , -3, -2, -1, 0, 1, 2, 3,
- S x x is a real number and 1 lt x lt 4 1,
4
8Some important sets
- The empty set ? has no elements.
- Also called null set or void set.
- Universal set the set of all elements about
which we make assertions. - Examples
- U all natural numbers
- U all real numbers
- U x x is a natural number and 1lt xlt10
9Cardinality
- Cardinality of a set A (in symbols A) is the
number of elements in A - Examples
- If A 1, 2, 3 then A 3
- If B x x is a natural number and 1lt xlt 9
- then B 9
- Infinite cardinality
- Countable (e.g., natural numbers, integers)
- Uncountable (e.g., real numbers)
10Subsets , Power set
- X is a subset of Y if every element of X is also
contained in Y - (in symbols X ? Y)
- Equality X Y if X ? Y and Y ? X
- X is a proper subset of Y if X ? Y but Y ? X
- Observation ? is a subset of every set
- The power set of X is the set of all subsets of
X, in symbols P(X), - i.e. P(X) A A ? X
- Example if X 1, 2, 3,
- then P(X) ?, 1, 2, 3, 1,2, 1,3,
2,3, 1,2,3 - Theorem 2.1.4 If X n, then P(X) 2n.
11Set operations
- Given two sets X and Y
- The union of X and Y is defined as the set
- X ? Y x x ? X or x ? Y
- The intersection of X and Y is defined as the set
- X ? Y x x ? X and x ? Y
- Two sets X and Y are disjoint if X ? Y ?
- The difference of two sets
- X Y x x ? X and x ? Y
- The difference is also called the relative
complement of Y in X - Symmetric difference
- X ? Y (X Y) ? (Y X)
- The complement of a set A contained in a
universal set U is the set Ac U A
12Venn diagrams
- A Venn diagram provides a graphic view of sets
- Set union, intersection, difference, symmetric
difference and complements can be identified
U
A
B
13Properties of set operations
- Theorem 2.1.10
- Let U be a universal set, and A, B and C subsets
of U. - The following properties hold
- a) Associativity (A ? B) ? C A ? (B ? C)
- (A ? B) ? C A ? (B
?C) - b) Commutativity A ? B B ? A
- A ? B B ? A
- c) Distributive laws A?(B?C) (A?B)?(A?C)
- A?(B?C) (A?B)?(A?C)
- d) Identity laws A?UA A??
A - e) Complement laws A?Ac U
A?Ac ?
14Properties of set operations
- f) Idempotent laws A?A A A?A A
- g) Bound laws A?U U A?? ?
- h) Absorption laws A?(A?B) A A?(A?B) A
- i) Involution law (Ac)c A
- j) 0/1 laws ?c U Uc ?
- k) De Morgans laws for sets
- (A?B)c Ac?Bc (A?B)c Ac?Bc
151.2 Propositions
- Logic the study of correct reasoning
- Statements as a single datum having (binary)
truth value - Representing facts digitally
- Q what about statements that have degree of
truth value? - How can we manipulate them to derive new things?
- Use of logic
- In mathematics
- to prove theorems
- In computer science
- to prove that programs do what they are supposed
to do - AI / DB Theorem prover
- Software engineering Program correctness
16Propositions
- A proposition is a statement or sentence that can
be determined to be either true or false. - Examples
- John is a programmer" is a proposition
- I wish I were wise is not a proposition (?)
- Well, you can still assign some value
- Computers dont really care
17Connectives
- If p and q are propositions, new compound
propositions can be formed by using connectives - Most common connectives
- Conjunction AND. Symbol
- Inclusive disjunction OR Symbol v
- Exclusive disjunction OR Symbol v
- Negation Symbol
- Implication Symbol ?
- Double implication Symbol ?
18Truth table
- Truth table of conjunction
- , and, ???
- Truth table of Negation
- , not, ??
p q p q
T T T
T F F
F T F
F F F
p p
T F
F T
- Truth table of (inclusive) disjunction
- v, or, ???
- Truth table of exclusive disjunction
- Either p or q (but not both), ?, exclusive or
p q p v q
T T T
T F T
F T T
F F F
p q p v q
T T F
T F T
F T T
F F F
19More compound statements
- Let p, q, r be simple statements
- We can form other compound statements, such as
- (p?q)r
- p?(qr)
- (p)?(q)
- (p?q)(r)
- and many others
- Example
- truth table of (p?q)r
p q r (p ? q) r
T T T T
T T F F
T F T T
T F F F
F T T T
F T F F
F F T F
F F F F
201.3 Conditional propositions (????) andlogical
equivalence (??)
- A conditional proposition
- If p then q , "p only if q"
- In symbols p ? q
- Truth table
- p antecedent or hypothesis (??)
- sufficient condition (?? ??) for q
- q consequent or conclusion (??)
- necessary condition (????) for p
p q p ? q
T T T
T F F
F T T
F F T
21Logical equivalence
- logically equivalent
- ??
- two truth tables are identical.
- converse
- ?
- converse of p ? q is q ? p
- contrapositive
- ??
- contrapositive of the p ? q is q ? p.
- logically equivalent
p q p ? q p ? q
T T T T
T F F F
F T T T
F F T T
p q p ? q q ? p
T T T T
T F F F
F T T T
F F T T
p q p ? q q ? p
T T T T
T F F T
F T T F
F F T T
22Logical equivalence
- double implication
- ???
- p if and only if q
- p ? q
- logically equivalent to
- (p ? q)(q ? p)
- tautology
- ?? ??
- truth table contains only true values for every
case - contradiction
- ?? ??
- truth table contains only false values for every
case
p q p ? p v q
T T T
T F T
F T T
F F T
p q p ? q (p ? q) (q ? p)
T T T T
T F F F
F T F F
F F T T
p p (p)
T F
F F
23De Morgans laws for logic
- The following pairs of propositions are logically
equivalent - (p ? q) and (p)(q)
- (p q) and (p) ? (q)
241.4 Arguments and rules of inference
- Deductive reasoning the process of reaching a
conclusion q from a sequence of propositions
p1, p2, , pn. - The propositions p1, p2, , pn are called
- premises (??) or hypothesis (??).
- The proposition q that is logically obtained
through the process is called the conclusion.
25Rules of inference
- 1. Law of detachment or modus ponens
- (mode that affirms)
- p ? q
- p
- Therefore, q
- 2. Modus tollens
- (mode that denies)
- p ? q
- q
- Therefore, p
- 3. Rule of Addition
- p
- Therefore, p ? q
- 4. Rule of simplification
- p q
- Therefore, p
- 5. Rule of conjunction
- p
- q
- Therefore, p q
- 6. Rule of hypothetical syllogism
- p ? q
- q ? r
- Therefore, p ? r
- 7. Rule of disjunctive syllogism
- p ? q
- p
- Therefore, q
26Rules of inference for quantified statements
- 1. Universal instantiation
- ?x?D, P(x)
- d ? D
- Therefore P(d)
- 2. Universal generalization
- P(d) for any d ? D
- Therefore ?x, P(x)
- 3. Existential instantiation
- ? x ? D, P(x)
- Therefore P(d) for some d ?D
- 4. Existential generalization
- P(d) for some d ?D
- Therefore ? x, P(x)
271.5 Quantifiers (????)
- A propositional function P(x) is a statement
involving a variable x - For example P(x) 2x is an even integer
- Domain of a propositional function
- if x is an element of a set D, D is called the
domain of P(x) - For example, x is an element of the set of
integers - the domain D of P(x) must be defined
- (cf.) P(x) x is an even integer
- if D is a set of even integers
- if D is a set of odd integers
28Universal quantifier
- universal quantifier
- for every
- ?x P(x) P(x) for every x in a domain D
- True if P(x) is true for every x ? D
- False if P(x) is not true for some x ? D
- Example
- Let P(n) be the propositional function n2 2n is
an odd integer ?n ? D all integers - P(n) is true only when n is an odd integer,
- false if n is an even integer.
29Existential quantifier, Counter example
- existential quantifier
- for some
- ?x P(x) P(x) for some x in a domain D
- true if there exists an element x in the domain D
for which P(x) is true. - counter example
- ?x P(x) is false if ?x?D such that P(x) is false.
- The value x that makes P(x) false is called a
counter example to the statement ?x P(x). - Example
- P(x) "every x is a prime number", for every
integer x. - But if x 4 (an integer) this x is not a primer
number. Then 4 is a counter example to P(x)
being true.
30Generalized De Morgans laws for Logic
- If P(x) is a propositional function,
- then each pair of propositions in a) and b)
below - have the same truth values
- a) (?x P(x)) and ?x P(x)
- "It is not true that for every x, P(x)
holds" is equivalent to - "There exists an x for which P(x) is not
true - b) (?x P(x)) and ?x P(x)
- "It is not true that there exists an x for
which P(x) is true" is - equivalent to "For all x, P(x) is not true"
311.6 Nested Quantifiers
- Nested quantifier multiple quantifier
- Example
- ?x?y P(x,y)
- For every x in D, there is y in D such that
P(x,y) is true - ?x?y (xlty)
- For every x, there exist y such that xlty. D
integer - ?x?y L(x,y)
- L(x,y) x loves y
- Everybody(x) loves somebody(y)
- E.g. False there is someone who loves nobody
- ?x?y P(x,y)
- For every x in D and for every y in D, P(x,y) is
true. - ?x?y ((xgt0) (ygt0))?(xy gt 0)), D real number
- If there is at least one x and at least y such
that P(x,y) is false - Like in ?x?y ((xgt0) (ylt0))?(xy ? 0)), D
real number - Counter example x1, y-1
32Nested Quantifier
- Example
- ?x?y P(x,y)
- There is at least on x such that P(x,y) is true
for every y in D - ?x?y (x?y), D positive integer
- x 1
- ?x?y (x?y), D positive integer
- False for every x, there is at least one
positive integer y (ex. yx1) - ?x?y P(x,y)
- There is at least one x in D and at least one y
in D such that P(x,y) is true. - ?x?y ((xgt1) (ygt1) (xy6))
- ?x?y ((xgt1) (ygt1) (xy7))
33Nested Quantifier
342.1 Mathematical systems, direct proofs and
counterexamples
- A mathematical system consists of
- Undefined terms
- Definitions
- Axioms
35Undefined terms, Definitions
- Undefined terms are the basic building blocks of
a mathematical system. These are words that are
accepted as starting concepts of a mathematical
system. - Example in Euclidean geometry we have undefined
terms such as - Point
- Line
- A definition (??) is a proposition constructed
from undefined terms and previously accepted
concepts in order to create a new concept. - Example In Euclidean geometry the following are
definitions - Two triangles are congruent if their vertices can
be paired so that the corresponding sides are
equal and so are the corresponding angles. - Two angles are supplementary if the sum of their
measures is 180 degrees.
36Axioms, Theorems
- An axiom (??) is a proposition accepted as true
without proof within the mathematical system. - There are many examples of axioms in mathematics
- Example In Euclidean geometry the following are
axioms - Given two distinct points, there is exactly one
line that contains them. - Given a line and a point not on the line, there
is exactly one line through the point which is
parallel to the line. - A theorem (??) is a proposition of the form p ?
q which must be shown to be true by a sequence of
logical steps that assume that p is true, and use
definitions, axioms and previously proven
theorems.
37Lemmas and corollaries
- A lemma (????) is a small theorem which is used
to prove a bigger theorem. - A corollary (????) is a theorem that can be
proven to be a logical consequence of another
theorem. - Example from Euclidean geometry "If the three
sides of a triangle have equal length, then its
angles also have equal measure."
38Types of proof
- A proof is a logical argument that consists of a
series of steps using propositions in such a way
that the truth of the theorem is established. - Direct proof p ? q
- A direct method of attack that assumes the truth
of proposition p, axioms and proven theorems so
that the truth of proposition q is obtained.
39Direct proof example
- If n is even, then n2Â is even.
- Suppose n is even.Â
- Then by definition of even there is an integer
m for which n 2m. - If we square both sides, we get n2 4m2 22m2.
- 2m2 is an integer because m is an integer, so by
definition of even, n is even.
402.2 More methods of proof
- Proof by contradiction
- Proof by contrapositive
- Proof by cases
- Proofs of equivalence
- Existence proofs
41Indirect proof
- The method of proof by contradiction (a.k.a.
indirect proof) of a theorem p ? q consists of
the following steps - Assume p is true but q is false
- (p ? q) ? p ? q
- 2. Using p, q, axioms, previously derived
theorems and rules of inference, derive r (r),
a contradiction - In particular, r could be p
- 3. Conclude q cannot be false, hence p ? q
- The only difference is the negated conclusion in
our assumptions - Use when direct proof is difficult
42Special case proof by contrapositive
- If rp in the proof by contradiction, it is
called the proof by contrapositive - Since in effect we have shown (q) ? (p), which
is logically equivalent to p ? q - Example Show for every n ? Z, if n2 is even,
then n is even. - Suppose n2 is even, but n is odd.
- Then there exists an integer k s.t. n 2k1.
- If we square both sides we obtain n2 4k2 4k
1 2(2k2 2k)1. - But the equation tells us n2 is odd, a
contradiction. - We have proved that for every n ? Z, if n2 is
even, then n is even.
43Proof by contradiction example
- Prove ?2 is irrational.
- Suppose ?2 is rational.
- Then there exist integers p and q such that ?2
p/q. - Assume the fraction p/q is in lowest terms so
that p and q are not both even. - Squaring both sides gives 2 p2/q2
- Multiplying by q2 gives 2q2 p2.
- It means p2 is even, then p is even (!).
- Therefore, there exists an integer k s.t. p 2k.
- Substituting into 2q2 p2 gives q2 2k2.
- Therefore, q is even.
- Thus both p and q are both even, contradicting
our assumption. - Therefore, ?2 is irrational.
44Others
- Proof by cases
- Prove (p1 ? p2 ? p3 ? ? pn) ? q
- Instead prove (p1 ? q) ? ? (pn ? q)
- Also called exhaustive proof
- Use when the number of cases to prove is small
- Proof of equivalence
- Prove p ? q
- Prove p ? q and q ? p
- Existence proof
- Prove ?x P(x)
- Just find one x that satisfies above and that is
it - Sometimes it is not so easy to find that x
452.3 Resolution proofs
- Due to J. A. Robinson (1965)
- A clause is a compound statement with terms
separated by or, and each term is a single
variable or the negation of a single variable - Example p ? q ? (r) is a clause
- (p ? q) ? r ? (s) is not a
clause - Hypotheses and conclusion are written as clauses
- If a hypothesis is not a clause, it must be
replaced by an equivalent expression that is
either a clause or the and of clauses - Only one rule
- If (p ? q) and (p ? r) are both true then (q ?
r) is true - Can be checked by truth table but think
- If (p ? q) ? (p ? r), wouldnt (q ? r) follow?
46Resolution example
- Prove a ? b, a ? c, c ? d ? b ? d
- Resolution procedure
- a ? b, a ? c ? b ? c
- c ? b, c ? d ? b ? d
- Special cases
- If p ? q and p ? q is true
- If p and p ? r are true, ?r is true
47Resolution example -- Prolog
- (just click on likes.p and make queries
- Sam's likes and dislikes in food
-
- Considering the following will give some
practice - in thinking about backtracking.
- ?- likes(sam,dahl).
- ?- likes(sam,chop_suey).
- ?- likes(sam,pizza).
- ?- likes(sam,chips).
- ?- likes(sam,curry).
- likes(sam,Food) - indian(Food), mild(Food).
- likes(sam,Food) - chinese(Food).
- likes(sam,Food) - italian(Food).
- likes(sam,chips).
- indian(curry).
- indian(dahl).
- indian(tandoori).
482.4 Mathematical induction
- Useful for proving statements of the form ?n?A
S(n) - N is the set of positive integers or natural
numbers, - A is an infinite subset of N
- S(n) is a propositional function
49Mathematical Induction
- Suppose we want to show that for each positive
integer n the statement S(n) is either true or
false. - 1. Verify that S(1) is true.
- 2. Let n be an arbitrary positive integer.
- Let i be a positive integer such that i lt n.
- 3. Show that S(i) true implies that S(i1) is
true, - i.e. show S(i) ? S(i1).
- 4. Then conclude that S(n) is true for all
positive integers n.
50Mathematical induction terminology
- Basis step
- Verify that S(1) is true.
- Inductive step
- Assume S(i) is true.
- Prove S(i) ? S(i1).
- Conclusion
- Therefore S(n) is true for all positive integers
n.
51(No Transcript)