Lecture Notes 5
Lecture Notes 5
• p1↔p2↔…↔pn
• For i and j with 1≤i≤n and 1≤j≤n, pi and pj are
equivalent
[p1↔p2↔…↔pn] ↔[(p1→ p2)˄(p2→ p3) ˄…
˄(pn→ p1)]
• More efficient than prove pi→ pj for i≠j with
1≤i≤n and 1≤j≤n
• Order is not important as long as we have chain
1
Example
• Show that these statements about integer n
are equivalent
– P1: n is even
– P2: n-1 is odd
– P3: n2 is even
• Show that by p1→ p2 and p2→ p3 and p3→ p1
• p1→ p2 : (direct proof) Suppose n is even, then
n=2k for some k. thus n-1=2k-1=2(k-1)+1 is odd
2
Example
• p2→ p3 : (direct proof) Suppose n-1 is odd,
then n-1=2k+1 for some k. Hence n=2k+2, and
n2=(2k+2)2=4k2+8k+4=2(2k2+4k+2) is even
• p3→ p1: (proof by contraposition) That is, we
prove that if n is not even, then n2 is not even.
This is the same as proving if n is odd, then n2
is odd (which we have done)
3
Counterexample
• To show that a statement xp(x) is false, all we
need to do is to find a counterexample, i.e.,
an example x for which p(x) is false
4
Example
• Show that “Every positive integer is the sum
of the squares of two integers” is false
• An counterexample is 3 as it cannot be written
as the sum of the squares to two integers
• Note that the only perfect squares not
exceeding 3 are 02=0 and 12=1
• Furthermore, there is no way to get 3 as the
sum of two terms each of which is 0 or 1
5
1.8 Proof methods and strategy
(( p1 p 2 p n ) q )
(( p1 q ) ( p 2 q ) ( p n q ))
10
Example
• Show that |xy|=|x||y| for real numbers
(( p1 p 2 p n ) q )
(( p1 q ) ( p 2 q ) ( p n q ))
• x≥0, y≥0: xy ≥0 |xy|=xy=|x||y|
• x≥0, y<0: xy<0 |xy|=-xy=x(-y)=|x||y|
• x<0, y ≥0:xy<0 |xy|=-xy=(-x)y=|x||y|
• x<0, y<0: xy>0 |xy|=xy=(-x)(-y)=|x||y|
11
Existence proof
• A proof of a proposition of the form xp(x)
• Constructive proof: find one element a such
that p(a) is true
• Non-constructive proof: prove that xp(x) is
true in some other way, usually using proof by
contradiction
12
Constructive existence proof
• Show that there is a positive integer that can
be written as the sum of cubes of positive
integers in two different ways
• By intuition or computation, we find that
1729=103+93=123+13
• We prove this theorem as we show one
positive integer can be written as the sum of
cubes in two different ways
13
Non-constructive existence proof
• Show that there exist irrational numbers x and y such
that xy is rational
• We previously show that 2 is irrational
2
• Consider the number 2 . If it is rational, we have two
irrational number x and y with xy is rational (x= 2 , y= 2 )
2
• On the other hand if 2 is not rational, then we let
2 y 2 2 2 2 2
x 2 , y 2 , and thus x ( 2 ) 2 2 2
• We have not found irrational numbers x and y such that
xy is rational
• Rather we show
2 that either the pair x= 2 , y= 2 or the
pair x 2 , y 2 have the desired property, but we
do not know which of these two pairs works!
14
Uniqueness proof
• Some theorems assert the existence of a unique element with
a particular property
• Need to show
– Existence: show that an element x with the desired property exists
– Uniqueness: show that if y≠x, then y does not have the desired
property
• Equivalently, show that if x and y both have the desired
property, then x=y
• Showing that there is a unique element x such that p(x) is the
same as proving the statement
x( p ( x) y (( y x) p ( y )))
15
Example
• Show that if a and b are real numbers and
a≠0, then there is a unique number r such that
ar+b=0
• Note that the real number r=-b/a is a solution
of ar+b=0. Consequently a real number r
exists for which ar+b=0
• Second, suppose that s is a real number such
that as+b=0. Then ar+b=as+b. Since a≠0, s
must be equal to r. This means if s≠r, as+b≠0
16
Basic Mathematical Structures
• Sets
• Functions
• Sequences
• Sums
17
Sets
• Used to group objects together
• Objects of a set often have similar properties
– all students enrolled at a university
– all students currently taking discrete mathematics
• A set is an unordered collection of objects
• The objects in a set are called the elements or
members of the set
• A set is said to contain its elements
18
Notation
• a A : a is an elemnet of the set A. a A : otherwise
• The set of all vowels in the English alphabet
can be written as V={a, e, i, o, u}
• The set of odd positive integers less than 10
can be expressed by O={1, 3, 5, 7, 9}
• A set may contain unrelated elements, {a, 2,
Fred, New Jersey}
• The set of positive integers<100: {1,2,3,…, 99}
19
Notation
• Set builder Notation: characterize the
elements by stating the property or properties
• The set O of all odd positive integers < 10:
O={x|x is an odd positive integer < 10}
or specify as
O {x Z | x is odd and x 10}
• The set of positive rational numbers
Q {x R | x p / q for some positive integers p and q}
20
Notation
N {1,2,3,...} the set of natural numbers
Z {...,- 2 , -1, 0 , 1,...} the set of integers
Z {1,2,3,...} the set of positive integers
Q { p / q | p Z , q Z , and q 0} the set of rational numbers
R, the set of real numbers
• The set {N, Z, Q, R} is a set containing four
elements, each of which is a set
21
Examples of Sets
Other examples:
The set of all polynomials with degree at most three: {1, x, x 2, x3, 2x+3x2,…}.
23
Venn diagram
• Rectangle: Universal set that contains all the objects
• Circle: sets
– U: 26 letters of English alphabet
– V: a set of vowels in the English alphabet
24
Empty set and singleton
• Empty (null) set: denoted by {} or Ø
• The set of positive integers that are greater
than their squares is the null set
• Singleton: A set with one element
• A common mistake is to confuse Ø with {Ø}
25
Subset
• The set A is a subset of B if and only if every
• Denote by A⊆B
element of A is also an element of B
26
Empty set and the set S itself
• Theorem: For every set S
– (i) Ø⊆S, and
– (ii)S⊆S
• Let S be a set, to show Ø⊆S, we need to show
∀x(x∈∅→x∈S) is true.
• But x∈∅ is always false, and thus the conditional
statement is always true
• An example of vacuous proof
• (ii) is left as an exercise
27
Proper subset
• A is a proper subset of B: Emphasize that A is
a subset of B but that A≠B, and write it as
A⊂B
x( x A x B ) x( x B x A)
• One way to show that two sets have
the same elements is to show that
each set is a subset of the other, i.e.,
if A⊆B and B⊆A, then A=B
x( x A x B )
28
Sets have other sets as members
• A={∅, {a}, {b}, {a,b}}
• B={x|x is a subset of the set {a, b}}
• Note that A=B and {a}∊A but a∉A
Sets are used extensively in
computing problem
•
29