View
217
Download
0
Embed Size (px)
Citation preview
EE1J2 - Slide 1
EE1J2 – Discrete Maths Lecture 12
Number theory Mathematical induction Proof by induction Examples
EE1J2 - Slide 2
Integers and Number Theory
Recall that the ℤ denotes the set of integers {…-2, -1, 0, 1, 2…}
We take for granted the fact that it x and y are integers, then x + y and x y are also integers
Mathematicians say that the set of integers is closed under addition and multiplication
Number Theory is concerned with properties of the integers with the operations ‘+’ and ‘’
EE1J2 - Slide 3
Properties of + and ℤ together with + and has several properties
which we take for granted: If x=a and y=b then x+a=y+b and xy=ab a+b= b+a and a b=b a (Commutative Laws) (a+b)+c=a+(b+c) and (a+b)+c=a+(b+c)
(Associative Laws) a (b+c)=a b + a c (Distributive Law)
EE1J2 - Slide 4
Properties of + and (cont.) There exist unique integers 0 and 1 such that
a , ℤ a+0=0+a=a and a 1=1a=a 0 is called the additive identity 1 is called the multiplicative identity
For every a there is an integer –a such that a+(-a)=(-a)+a=0 (-a is the additive inverse of a)
If a b=a c and a0, then b=c
EE1J2 - Slide 5
{ ,+, ℤ }
Sometimes use the notation { ,+, ℤ } as a reminder that number theory is concerned not just with the integers, but also with + and
{ ,+, ℤ } is a common domain of discourse for Predicate Logic
EE1J2 - Slide 6
Example
Suppose P(x) = ‘x is even’ Then,
x:(P(x) P(x2))
x:(P(x2) P(x))
are statements in Predicate Logic for which the domain of discourse is { ,+, ℤ }
EE1J2 - Slide 7
Proofs in Number Theory
Consider the statement x:(P(x) P(x2)) A formal proof of the validity of this statement
requires many steps (see, for example, Anderson, p 106)
In practice many of these steps are missed out and a typical ‘acceptable’ proof might look as follows:
EE1J2 - Slide 8
Proof of x:(P(x) P(x2))
Let x be even Then there exists yℤ such that x=2y (this is
the definition of an even number) Therefore x2=(2y)2=(2y) (2y)
=2(2y2) So, if z= 2y2 then x2=2z Therefore x2 is even.
EE1J2 - Slide 9
Proof of x:(P(x2) P(x))
In this case we’ll use ‘Equivalence of Contrapositive’
I.e. a b b a So, proving P(x2) P(x) is equivalent to
proving P(x) P(x2)
EE1J2 - Slide 10
Proof of P(x) P(x2) Assume P(x). In other words x is odd Then there exists yℤ such that x=2y+1 So, x2=(2y+1)2=4y2 + 4y + 1 Let z=2y2 + 2y Then x2=2z + 1, so x2 is odd. I.e. P(x2) is
true So P(x) P(x2), hence P(x2) P(x)
EE1J2 - Slide 11
Mathematical Induction
Let P(n) be the predicate
This is true for particular values of n, e.g:
2
1321
nnnnP
2
)14(4104321
2
)13(36321
2
)12(2321
EE1J2 - Slide 12
Mathematical Induction
Want to show that P(n) is true for all integers n I.e.: n:P(n) The easiest way to prove such a statement is to
use the method of proof by induction
EE1J2 - Slide 13
Mathematical Induction
If P(1) is true
…and for all k, P(k) P(k+1)
Then P(n) is true for all values of n This is the principle of mathematical
induction
nPnkPkPkP :1:1
EE1J2 - Slide 14
Proof by Induction Intuitively…
1. Show that P(k) P(k+1) for any k
2. Show that P(1) is true
3. Then from 1 and 2, P(2) is true
4. …and from 1 and 3, P(3) is true
5. …and from 1 and 4, P(4) is true
6. etc
EE1J2 - Slide 15
Example 1
Case n=1: , so P(1) is true Now assume P(k) is true
Need to show P(k+1) is true I.e. need to show that
1,
2
1321:
n
nnnnSnP
2
11111
S
2
211
kkkS
EE1J2 - Slide 16
Example 1 (continued)
2
212
121
12
1
1
1211
kk
kkk
kkk
kkS
kkkS
Step 1: Write S(k+1) in terms of S(k)
Step 2: Use the fact that P(k) is true
Step 3: Manipulate to get the right formula
EE1J2 - Slide 17
Example 1 (concluded)
So, Therefore P(k+1) is true Therefore, by the principle of mathematical
induction, n:P(n)
2
211
kkkS
EE1J2 - Slide 18
Example 2 Let P(n) be the predicate defined by:
P(n): ‘n3-n is divisible by 3’
Show that n:P(n) Case n=1: n3-n=1-1=0, which is divisible
by 3. Hence P(1) is true Now assume that P(k) holds Need to prove that P(k+1) holds
EE1J2 - Slide 19
Example 2 (continued)
Case n=k+1: (k+1)3 - (k+1) = (k3+3k2+3k+1) - (k+1)
= (k3-k)+(3k2+3k)
= (k3-k) + 3(k2+k)
Divisible by 3 since P(k) is true Clearly
divisible by 3
EE1J2 - Slide 20
Example 2 (concluded)
Hence if k3-k is divisible by 3, then (k+1)3-(k+1) is also divisible by 3
In other words, k:(P(k) P(k+1)) Also, P(1) is true Therefore, by mathematical induction,
n:P(n)
EE1J2 - Slide 21
Example 3
Let P(n) be the predicate ‘if S is a finite set such that |S| = n, then |P(S)|=2n’
Claim: n:P(n) This is another way of saying that for any
finite set S, |P(S)| = 2|S| (See lecture 7, slide18)
EE1J2 - Slide 22
Example 3 (continued) Case n=1: If |S|=1, then S has just one
element, x say. Then S = {x}
In this case P(S)={,S}, so |P(S)|=2=21=2|S|
Hence P(1) is true Now assume P(k) is true for some k In other words, if S is a set such that |S| = k,
then |P(S)|=2k
EE1J2 - Slide 23
Example 3 (continued) Let Sk+1 be a set such that |Sk+1|=k+1
Write Sk+1 = {x1, x2,…,xk+1}
= Sk {xk+1}, where Sk= {x1, x2,…,xk}
We can write P(Sk+1) = Pk Pk+1, where:
Pk is the set of subsets of S which don’t include xk+1
Pk+1 is the set of subsets of S which do include xk+1
But Pk=P(Sk), so | Pk|=|P(Sk)|=2k by assumption
EE1J2 - Slide 24
Example 3 (continued) Now consider Pk+1, the set of subsets which
include xk+1
Every subset in Pk+1 must arise by taking a subset of Sk and adding xk+1 to it
…so | Pk+1| = |P(Sk)| = 2k
Hence | P(Sk+1)| = |Pk| |Pk+1|
= 2k + 2k = 2 2k = 2k+1
EE1J2 - Slide 25
Example 3 (concluded)
Hence P(1) is true, and if P(k) is true then P(k+1) is also true
Hence, by mathematical induction, n:P(n)
EE1J2 - Slide 26
Notes Mathematical induction can only be used to prove arguments
for which the domain of discourse is the positive, whole numbers.
For example, if P(b) is the predicate: the roots of the equation x2+bx+1 are given by
Then b:P(b) is true, but cannot be proved by induction 2
42
bbx