Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti - - PowerPoint PPT Presentation

discrete mathematics
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti - - PowerPoint PPT Presentation

Discrete Mathematics -- Chapter 4: Properties of the Ch t 4 P ti f th Integers: Mathematical Induction Hung-Yu Kao ( ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U


slide-1
SLIDE 1

Discrete Mathematics

Ch t 4 P ti f th

  • - Chapter 4: Properties of the

Integers: Mathematical Induction

Hung-Yu Kao (高宏宇) Department of Computer Science and Information Engineering, N l Ch K U National Cheng Kung University

slide-2
SLIDE 2

Outline

4.1 The Well-Ordering Principle: Mathematical

Induction Induction

4.2 Recursive Definitions

h i i i l i h i b

4.3 The Division Algorithm: Prime Numbers 4.4 The Greatest Common Divisor: The Euclidean

Algorithm

4 5 The fundamental Theorem of Arithmetic 4.5 The fundamental Theorem of Arithmetic

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

2

slide-3
SLIDE 3

自然數

自然數要適合五點(Peano axioms):

有一起始自然數 0。 有一起始自然數 0 任一自然數 a 必有後繼,記作 a +1。 0 並非任何自然數的後繼 0 並非任何自然數的後繼。 不同的自然數有不同的後繼。

(數學歸納公設)有一與自然數有關的命題 設此

(數學歸納公設)有一與自然數有關的命題。設此

命題對 0 成立,而當對任一自然數成立時,則對其 後繼亦成立 則此命題對所有自然數皆成立 後繼亦成立,則此命題對所有自然數皆成立。

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

3

slide-4
SLIDE 4

4.1 The Well-Ordering Principle: g p Mathematical Induction

  • The Well-Ordering Principle: Every nonempty subset of Z+

contains a smallest element. ( )

} 1 | { } | { ≥ ∈ = > ∈ =

+

x x x x Z Ζ Z

Z+ is well ordered

( )

  • The Principle of Mathematical Induction: Let S(n) denote an
  • pen mathematical statement that involves one or more

f th i bl hi h t iti i t

} 1 | { } | { ≥ ∈ > ∈ x x x x Z Ζ Z

  • ccurrences of the variable n, which represents a positive integer.

a)

If S(1) is true; and (basis step)

b)

If whenever S(k) is true, then S(k+1) is true. (inductive step)

b)

w e eve S(k) s ue, e S(k ) s

  • ue. ( duc ve s ep)

then S(n) is true for all

  • Using quantifiers

+

∈Z n

) ( )]]] 1 ( ) ( [ [ ) ( [ n S n n k S k S n k n S ≥ ∀ ⇒ + ⇒ ≥ ∀ ∧

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

4

) ( )]]] ( ) ( [ [ ) ( [

slide-5
SLIDE 5

4.1 The Well-Ordering Principle: Mathematical Induction

P(n0) P(n0+1) P(n0+2) . . .

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

5

slide-6
SLIDE 6

Why Induction Works

More rigorously the validity of a proof by mathematical induction relies More rigorously, the validity of a proof by mathematical induction relies

  • n the well-ordering of Z+.

Let S be a statement for which we have proven that S(1) holds and for

p ( ) all n∈ Z+ we have S(n)⇒S(n+1). Claim: S(n) holds for all n∈ Z+

Proof by contradiction: Define the set F⊆ Z+ of values for which S

does not hold: F = { m | S(m) does not hold}.

If F is non empt then F must have a smallest element ( ell ordering of

If F is non-empty, then F must have a smallest element (well-ordering of

Z+), let this number be z with ¬S(z). Because we know that S(1), it must hold that z>1. Because z is the smallest value, it must hold that S(z–1), hi h di f f ll

+

( ) ( ) which contradicts our proof for all n∈ Z+: S(n)⇒S(n+1).

Contradiction: F has to be empty: S holds for all Z+.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

6

slide-7
SLIDE 7

The Well-Ordering Principle: g p Mathematical Induction

  • Ex 4.1 : For any
  • Proof

2 ) 1 ( 1

3 2 1 ,

+ = +

= + ⋅ ⋅ ⋅ + + + = ∑ ∈

n n n i

n i n Z

) 1 ( 2 ) 1 1 ( 1 1 1 2 ) 1 ( 1

1 : ) 1 ( (i) 3 2 1 : ) ( Let

+ × = + =

= = ∑ = + ⋅ ⋅ ⋅ + + + = ∑

i n n n i

i S n i n S

1 2 ) 1 ( 1 2 1

) 1 ( 3 2 1 ) 1 ( Th (iii) i.e., true, is ) ( Assume (ii) ) ( ( )

+ + = =

∑ = ∑

k k k k i i

k k i k S i k S

2 ) 1 ( 1 1 1 1

) 1 ( ) 1 ( ) ( ) 1 ( 3 2 1 : ) 1 ( Then (iii)

+ = + =

+ + = + + ∑ = + + + ⋅ ⋅ ⋅ + + + = ∑ +

k k i k i

k k i k k i k S

2 ) 2 )( 1 ( + +

=

k k

2

2

3 2 1 t

+ + +

+ + + +

n n n i

Z

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

7

2 2 1

3 2 1 , try

+ + = +

= + ⋅ ⋅ ⋅ + + + = ∈

n n i

n i n Z

slide-8
SLIDE 8

The Well-Ordering Principle: g p Mathematical Induction

  • Ex 4.3 : Among the 900 three-digit integers (100 to 999), where the

integer is the same whether it is read from left to right or from right to left are called palindromes Without actually determining all of these left, are called palindromes. Without actually determining all of these three-digit palindromes, we would like to determine their sum.

  • Solution

) 10 101 ( 10 101 10 100 : palindrome typical The

9 9 9 9

∑ ∑ + ∑ = ⎞ ⎜ ⎜ ⎛ ∑ + = + + = b a aba b a a b a aba

[ ]

45 10 1010 10 ) 101 ( 10 ) (

9 9 9 1 1

∑ ⋅ + = ∑ ⎥ ⎦ ⎤ ⎢ ⎣ ⎡ ∑ + = ∑ ∑ ∑ ⎠ ⎜ ⎜ ⎝ ∑

= = = = a b a b

a b a

[ ]

500 , 49 450 9 1010 ) (

9 1 1

= ⋅ + ∑ = ⎥ ⎦ ⎢ ⎣

= = = a a b

a

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

8

1 = a

slide-9
SLIDE 9

The Well-Ordering Principle: g p Mathematical Induction

  • Ex 4.5
  • For triangular number

t =1+2+ +i= i(i+1)/2

2 2 1

1

1

= = t

2 3 2

3 2 1

2

= = + = t

2 4 3

6 3 2 1

3

= = + + = t

2 5 4

10 4 3 2 1

4

= = + + + = t

ti=1+2+…+i= i(i+1)/2

  • We want a formula for the sum
  • f the first n triangular numbers.

P f

  • Proof

] [ ] [ ) (

) 1 ( 1 ) 1 2 )( 1 ( 1 1 ) 1 (

2

+ = ∑ + = ∑ ∑ =

+ + + +

i i t

n n n n n n n i i n

] [ ] [ ) (

6 ) 2 )( 1 ( 2 2 6 2 1 2 1 2 1

= + = ∑ + = ∑ ∑ =

+ + = = =

i i t

n n n i i i i

Ex 4.4 prove it

700 , 171 ...

6 ) 102 )( 101 ( 100 6

100 2 1

= = + + + ∴ t t t

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

9

slide-10
SLIDE 10

The Well-Ordering Principle: g p Mathematical Induction

  • Ex 4.5
  • Consider pseudocode procedures (comparisons)

P d 1 dditi d lti li ti ( dditi ll t i)

  • Procedure 1: n additions and n multiplications (additionally, counter i)
  • Procedure 2: 2 additions, 3 multiplications, and 1 division

procedure SumOfSquares1 begin procedure SumOfSquares2 begin ( 1) (2 1)/6 begin sum:= 0 for i:= 1 to n do sum := sum + i2 sum:= n*(n+1)*(2*n+1)/6 end end

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

10

slide-11
SLIDE 11

The Well-Ordering Principle: g p Mathematical Induction

  • Ex 4.8
  • n

4n n2-7 n 4n n2-7 1 4 -6 2 8

  • 3

5 20 18 6 24 29

). 7 ( 4 , 6 For

2 −

< ≥ n n n

  • Solution

2 8 -3 3 12 2 4 16 9 6 24 29 7 28 42 8 32 57

). 7 ( 4 , 6 For < ≥ n n n

) 1 2 ( ) 7 ( 4 ) 7 ( 4 4 ) 1 ( 4 : ) 1 ( 6 ), 7 ( 4 : ) (

2 2 2

k k k k k k S k k k k S + + − < + − < + = + + ≥ − <

2*6+1=13 ≥4

. true is ) ( 7 ) 1 ( ) 1 2 ( ) 7 ( ) 1 ( 4 ) ( ) ( ) ( ) ( ) (

2 2

n S k k k k ∴ − + = + + − < + ⇒

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

11

slide-12
SLIDE 12

The Well-Ordering Principle: g p Mathematical Induction

n

n

H H H

1 2 1 2 1

1 , , 1 , 1

2 1

+ ⋅ ⋅ ⋅ + + = ⋅⋅ ⋅ + = =

n H n H

n j

n

− + = ∑ ) 1 ( n, all For

Ex 4.9 : Harmonic numbers

1 ) 1 1 ( 1 : ) 1 ( Verify

1 1

1 1

H H H S

j

j

− + = = =

=

j

j=1

Proof

) 1 ( : true ) ( Assume

1 1

k H k H k S

k j

k k k j j

− + =

=

1) (k ] ) 1 ( [ : ) 1 ( Verify

1 1

1 1 1

H k H H k H k H H H k S

k k k j j

k j k j

+ − + = + − + = + = +

+ +

∑ ∑

+ = =

) 1 ( 2) (k ] 1 1 1)[ (k 1) (k

1 1 1

k H H k k H H k H

k k k k

+ + = + − + − + = + +

+ + +

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

12

. true is ) ( ) 1 ( 2) (k

1

n S k H k ∴ + − + =

+

slide-13
SLIDE 13

The Well-Ordering Principle: g p Mathematical Induction

E 4 10

Ex 4.10 :

  • The elements of An are listed in ascending order, and |An|= 2n.
  • To determine whether

we must compare r with no more than A r ∈

  • To determine whether , we must compare r with no more than

n+1 elements in An.

  • Proof

n

A r ∈

b r c c C b b B c c b b C B c c b b A S a a a a A S = = < < < ∪ = = ∴ < =

2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1

with compare (i) } , { }, , { , , } , , , { : ) 2 ( Verify s comparison 2 most at }, , { : ) 1 ( Verify

1 1 1 1 2 1

n C B C r B r b r + = + ∴ ∴ = = ∈ ∈

2

s comparison 1 1 2 most at (iii) s comparison 2 most at 2 | | | | ,

  • r

, (ii) with compare (i)

1 1 1 1

k k k k

c c c b b b c c c b b b C B A k S k S

k k k

< ⋅ ⋅ ⋅ < < < < ⋅ ⋅ ⋅ < < ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ = ∪ = +

+

2 1 2 1 2 1 2 1

}, , , , , , , , { Let : ) 1 ( Verify : true ) ( Assume

1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

13

k k

c c c b b b < < < < < < <

2 1 2 1

slide-14
SLIDE 14

The Well-Ordering Principle: g p Mathematical Induction

M th ti l i d ti l j l i i ifi ti

  • Mathematical induction plays a major role in programming verification.

Ex 4.11 :

  • The pseudocode program segment is supposed to produce the answer xyn.
  • The pseudocode program segment is supposed to produce the answer xy .
  • Proof

answer : true ) ( Assume answer : ) ( Verify xy k S xy x S

k

= = = find we now again loop while' ' the

  • f

top the return to and executed nsare instructio loop the , first time for the loop while' ' the

  • f

top the reach the program the 1, hen : ) 1 ( Verify k n w k S + = +

while n≠ 0 do begin x := x * y

1 ) 1 (k find we now again, loop while the

  • f

top the

1

k n xy x = − + =

  • =
  • n := n - 1

end answer := x

true. is ) ( ) ( answer final The and with continue will loop while' ' the And

1 1 , 1

n S xy y xy y x k n y x

k k k

∴ = = = ∴ =

+

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

14

) ( S

slide-15
SLIDE 15

The Well-Ordering Principle: g p Mathematical Induction

E 4 13

Ex 4.13 :

  • Show that for all we can express n using only 3’s and 8’s as

summands (e g 14 = 3 + 3+ 8) 14 ≥ n

  • summands. (e.g., 14 3 + 3+ 8)
  • Proof

: true ) ( Assume k S While : ) 1 ( Verify : true ) ( Assume = + k n k S k S 1 for s 8' with two s 3' five replace , s 3' five least at have sum the 14, sum, in the appears 8 no (ii) case 1 for s 3' e with thre 8 replace sum, in the appears 8

  • ne

least at (i) case + = ∴ ≥ + = k n k n Q ) 1 ( ) ( 1 for s 8 with two s 3 five replace + ⇒ ∴ + = k S k S k n

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

15

slide-16
SLIDE 16

Fibonacci Sequence

Consider the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,…

Consider the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,… which is defined by F1 = F2 = 1 and Fn+2 = Fn+1 + Fn

Clearly this sequence F1,F2,… will grow, but how fast?

C j t F ≥ (3/2)n f ll >10

Conjecture: Fn ≥ (3/2)n for all n>10 Proof by induction:

Base case: Indeed F11 = 89 ≥ (3/2)11 = 86.49756…

Inductive step for n>10:

Other base case: also F12 =144 ≥ (3/2)12 = 129.746338…

Inductive step for n>10:

Assume Fn ≥ (3/2)n and Fn+1 ≥ (3/2)n+1, then indeed

Fn+2

= Fn + Fn+1 ≥ (3/2)n + (3/2)n+1 = (3/2)n(1 + (3/2))

2

  • = (3/2)n(5/2) ≥ (3/2)n (9/4) = (3/2)n+2

By induction on n, the conjecture holds.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

16

slide-17
SLIDE 17

Other Induction Proofs

We just saw a different kind of proof by induction where

the inductive step is ∀n>10: [P(n), P(n+1) ⇒ P(n+2)] This time the basis step is proving P(11) and P(12). p p g ( ) ( )

There are many variations of proof by induction:

Strong/ Complete induction: Here the inductive step is: Assume all of P(1),…,P(n), then prove P(n+1). The basis step is P(1) for this alternative form of induction. p ( )

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

17

slide-18
SLIDE 18

Fibonacci Numbers

The sequence 1,1,2,3,5,8,13,21,34,… defined by

Fn+2= Fn+Fn+1 is the famous Fibonacci sequence.

A closed expression of Fn is

n n

5 1 1 5 1 1 ⎞ ⎜ ⎛ ⎞ ⎜ ⎛ +

n

2 5 1 5 1 2 5 1 5 1 F ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ − − ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + =

For large n, it grows like Fn ≈ 0.447214 × 1.61803n. This (1+√5)/2 ≈ 1.61803 is the Golden Ratio.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

18

slide-19
SLIDE 19

Fibonacci in Nature

Fibonacci numbers often occur in the natural world. Shape of shells:

Number of petals

  • n flowers:

htt // h tt / j / /i d ht l

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

19

http://www.research.att.com/~njas/sequences/index.html

slide-20
SLIDE 20

The Well-Ordering Principle: g p Mathematical Induction

  • Theorem 4.2: The Principle of Mathematical Induction –

Alternative Form: (or the Principle of Strong Mathematical I d ti ) Induction)

  • Let S(n) denote an open mathematical statement that involves one or

more occurrences of the variable n, which represents a positive p p integer.

a)

If S(n0), S(n0+1), …, S(n1-1), and S(n1) are true If h S( ) S( 1) S(k 1) d S(k) f

Basic step

b)

If whenever S(n0), S(n0+1), …, S(k-1), and S(k) are true for some , then S(k+1) is also true

then S(n) is true for all

1

where , n k k ≥ ∈

+

Z

n n ≥

inductive step

then S(n) is true for all

.

n n ≥

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

20

slide-21
SLIDE 21

The Well-Ordering Principle: g p Mathematical Induction

E 4 14

Ex 4.14 :

  • Show that for all , n can be written as a sum of only 3’s and 8’s.

(e g 14 = 3+3+8 15 = 3+3+3+3+3 16 = 8+8) 14 ≥ n (e.g., 14 3+3+8, 15 3+3+3+3+3, 16 8+8)

  • Proof

true are ) 16 ( and ) 15 ( ) 14 ( Verify S S S : ) 1 ( Verify 16 where true, are ) ( and ) 1 ( ), 2 ( , ), 15 ( ), 14 ( Assume true. are ) 16 ( and ), 15 ( ), 14 ( Verify + ≥ − − ⋅⋅ ⋅ k S k k S k S k S S S S S S true is ) 1 ( true is ) 2 ( , 2 14 and , 3 ) 2 ( 1 : ) 1 ( Verify + ∴ − ≤ − ≤ + − = + + k S k S k k k k k S Q ) (

14 15 16 17 18 19 20 21 22 …

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

21

slide-22
SLIDE 22

The Well-Ordering Principle: g p Mathematical Induction

E 4 15

Ex 4.15 :

  • Show that

⎧ ≤ where , 3 a

n n

  • Proof

⎩ ⎨ ⎧ ≥ ∈ + + = = = =

+

− − −

3 where all for , and , 3 , 2 , 1

3 2 1 2 1

n n a a a a a a a

n n n n

Z

1 1

3 3 2 3 3 1 (i) = ≤ = ≤ = = a a

2 1 1 2 2

(ii) 3 9 3

− − +

+ + = = ≤ =

k k k k

a a a a a

1 2 1

3 ) 3 ( 3 3 3 3 3 3 3

+ − −

= = + + ≤ + + ≤

k k k k k k k k Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

22

slide-23
SLIDE 23

Induction, another example

Towers of Hanoi: (1883) Towers of Hanoi: (1883)

We have three poles and n golden disks the disks are only allowed in pyramid shape: the disks are only allowed in pyramid shape: no big disks on top of smaller ones

How to move the disks from one pole to another? How to move the disks from one pole to another?

How many moves are requires?

Call this number M(n) Call this number M(n).

Note M(1)=1 and M(2)=3 What about M(3)? W a abou (3)?

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

23

slide-24
SLIDE 24

Inductive, Recursive

7 moves for 3 disks 7 moves for 3 disks f In general, 2 In general, 2n‐1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

24

slide-25
SLIDE 25

Making a Conjecture

To prove something by induction, you need a conjecture about the

general case M(n).

Here we have: M(1)=1, M(2)=3, M(3)=7,… Obvious conjecture… M(n) = 2n – 1 for all n > 0 Clearly, the basis step M(1)=1 holds. Feeling for general n case: Each additional disk

(almost) doubles the number of moves: M( +1) i t f t M( ) M(n+1) consists of two M(n) cases…

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

25

slide-26
SLIDE 26

Inductive Step

How to move n+1 disks, using an n-disk ‘subroutine’?

n n

M(n) moves M(n) moves

n

1 move

n

  • e

M(n) moves In sum: M(n+1) = 2 M(n)+1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

26

( ) ( )

slide-27
SLIDE 27

Proof of ToH

We just saw that for all n, we have M(n+1) = 2M(n)+1.

This enables our proof of the conjecture M(n)=2n–1.

Proof: Basis step: M(1) = 21–1 = 1 holds.

A th t M( ) 2n 1 h ld Th f t +1

Assume that M(n)=2n–1 holds. Then, for next n+1: M(n+1) = 2 M(n) + 1 = 2(2n–1) + 1 = 2n+1 – 1. Hence it holds for n+1 End of proof by induction on n Hence it holds for n+1. End of proof by induction on n.

With n=64 golden disks, and one move per second, this amounts to almost 600,000,000,000 years of work.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

27

slide-28
SLIDE 28

How to Prove Inductively

  • General strategy:

1.

Clarify on which variable you’re going to do the i d i induction

2.

Calculate some small cases n=1,2,3,…(Come up with

your conjecture) your conjecture)

3.

Make clear what the induction step n→n+1 is

4

Prove the basis step prove the inductive step

4.

Prove the basis step, prove the inductive step, and say that you proved it.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

28

slide-29
SLIDE 29

Induction in CS

Inductive proofs play an important role in computer science

because of their similarity with recursive algorithms.

Analyzing recursive algorithms often require the use of

y g g q recurrent equations, which require inductive proofs.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

29

slide-30
SLIDE 30

Structural Induction

Th th d f i d ti l b li d t t t

The method of induction can also be applied to structures

  • ther than integers, like graphs, matrices, trees, sequences

and so on.

The crucial property that must hold is the well-ordered

principle: there has to be a notion of size such that all

  • bjects have a finite size and each set of objects must have a
  • bjects have a finite size, and each set of objects must have a

smallest object.

Examples: vertex size of graphs, dimension of matrices,

depth of trees, length of sequences and so on.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

30

slide-31
SLIDE 31

L-Tiling an 2n×2n Square

Take a 2n×2n square with one tile missing Can you tile it with L-shapes? y p

Theorem: Yes, you can for all n. Example for 8×8:

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

31

Example for 8×8:

slide-32
SLIDE 32

Proving L-Tiling

Basis step of 2×2 squares is easy. Inductive step: Assuming that 2n×2n tiling is possible, tile a 2n+1×2n+1 square by looking at 4 sub-squares:

P t th 3 h l i th iddl Put the 3 holes in the middle: Put an L in the middle, and tile the sub squares and tile the sub-squares using the assumption. P f b i d ti Proof by induction on n. This is a constructive proof.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

32

slide-33
SLIDE 33

4.2 Recursive Definitions

E 4 19

  • Ex 4.19 : Fibonacci numbers

1)

F0 = 0; F1 = 1;

2)

F = F + F 2 h ll f ≥

+

Z

2)

Fn = Fn-1 + Fn-2, 2 where all for ≥ ∈

+

n n Z

1 2 + = +

× = ∑ ∈ ∀

n n n i i

F F F n Z

  • Proof

= i

1 2 2 1 2

Assume 1 * 1 step, basis

+

× = = +

k k k i

F F F F F

2 1 2 1 2 1

Then Assume

+ + + =

+ = ×

∑ ∑ ∑

k k i k i k k i i

F F F F F F

2 1 1

) (

+ + = =

+ × = + × =

∑ ∑

k k k i i

F F F F F F

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

33

2 1 1 1

) (

+ + + +

× = + × =

k k k k k

F F F F F

slide-34
SLIDE 34

Recursive Definitions

E 4 20

  • Ex 4.20 : Lucas numbers

1)

L0 = 2; L1 = 1;

2)

Ln = Ln-1 + Ln-2,

2 where all for ≥ ∈

+

n n Z

1 1 + − +

+ = ∈ ∀

n n n

F F L n Z

3 1 2 2 1

2 1 3 , 1 1 step, basis : Proof + = + = = + = + = = F F L F F L

2 1 1 1 k k 1 k 1 1 n

) ( ) ( Then 2 k where k, 1,

  • k

1,2,3,..., n for Assume

− + − − + + −

+ + + = + = ≥ = + =

k k k k n n

F F F F L L L F F L

2 1 2 1

) ( ) (

+ + − −

+ = + + + =

k k k k k k

F F F F F F

Fn-2 Fn-1 Fn Fn+1 Fn+2 Ln-1 Ln Ln+1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

34

1 ) 1 ( 1 ) 1 ( + + − +

+ =

k k

F F

slide-35
SLIDE 35

Recursive Definitions

E 4 21 E l i

b

  • Ex 4.21 : Eulerian numbers

1 , 1 , ) 1 ( ) (

, 1 1 , 1 ,

k k m k a k a k m a

k m k m k m

< ≥ − ≤ ≤ + + − =

− − −

m=1 m=2 m=3 1 1 1 1 4 1

Row sum

1=1! 2=2! 6=3!

  • Proof

! , , , , , 1

1 , , , ,

m a k a m k a a

m k k m k m k m

= ∑ < = ≥ = =

− =

m=3 m=4 m=5 1 4 1 1 11 11 1 1 26 66 26 1 6 3! 24=4! 120=5!

  • Proof

] 3 ) 1 [( ] 2 [ ] ) 1 [( ] ) 1 ( ) 1 [(

2 1 1 1 , 1 , , 1

⋅ ⋅ ⋅ + + − + + + + + = + + ∑ − + = ∑

= − = +

a a m a ma a a m a k a k m a

m m m m m m k m m k k m m k k m

] ) 1 ( 2 [ ] [ ] ) 1 ( [ ] 2 [ ] ) 1 ( 3 [ ] ) [( ] [ ] ) [(

1 , 1 , , , , 1 , 1 , 2 , 2 , 3 , 2 , 1 , 1 , , , 1 ,

⋅ ⋅ ⋅ + − + + + = + + + + + − + +

− − − − − −

a m a ma a a m a ma a a m a

m m m m m m m m m m m m m m m m m m m m m m

Induction on m

! ) 1 ( ) 1 ( ] [ ] 2 ) 1 [(

1 , 1 , 1 , 2 , 2 ,

+ = ∑ + = + + + − +

− = − − − −

m m a m a ma a a m

m k k m m m m m m m m m

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

35

)! 1 ( ) ( + = m

slide-36
SLIDE 36

4.3 The Division Algorithm: Prime g Numbers

D fi iti 4 1 If b di id d it b| if

d b Z b

  • Definition 4.1: If we say b divides a, and write b|a, if

there is an integer n such that a = bn, then b is divisor of a, or a is multiple of b.

, and , ≠ ∈ b Z b a

We also say for b nonzero: b divides a or b is a factor of a

  • Theorem 4.3:

, and , , integers three the

  • f

two divides and , If e) all for | | d) | )] | ( ) | [( c) )] | ( ) | [( b) 0) (a | and | 1 a) z y x a z y x x bx a b a c a c b b a b a a b b a a a + = ∈ ⇒ ⇒ ∧ ± = ⇒ ∧ ≠ Ζ ) ( | then each divides If 1 For g) ) ,

  • f

n combinatio linear called is y ( y), ( | )] | ( ) | [( f) integer. remaining the divides then , , , g , ) x c x c x c a c a c n i c b c bx c bx a c a b a a y y + + + ∈ ≤ ≤ + + ⇒ ∧ Ζ

  • Proof

) ( | then , each divides If . , 1 For g)

2 2 1 1 n n i i

x c x c x c a c a c n i + ⋅ ⋅ ⋅ + + ∈ ≤ ≤ Ζ

and | and | If f) an c am b c a b a = = ⇒ y) ( | ) ( ) ( ) ( y c bx a ny mx a y an x am c bx + ∴ + = + = + ∴

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

36

slide-37
SLIDE 37

The Division Algorithm: Prime Numbers

N b th i ti l li bl t l i d li

Number theory is now an essential applicable tool in dealing

with computer and Internet security.

Primes are the positive integers that have only two positive

divisors, namely, 1 and n itself. All other positive integers are called composite.

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

37

Sacks spiral, 1994 Ulam spiral, 1963

slide-38
SLIDE 38

The Division Algorithm: Prime Numbers

L 4 1 If d i it th th i i

+

Lemma 4.1: If and n is composite, then there is a prime

p such that p|n.

Proof

+

∈ Z n

Proof

If no such a prime Let S be the set of all composite integers that have no prime divisors. By Well-Ordering Principle, S has a least element m. If m is composite, then m=m1m2, 1<m1<m, 1<m2<m. Since

, m1 is prime or divisible by a prime, so exists a prime p,

S m1 ∉

,

1

p y p , p p, p|m1.

Since p|m1 and m=m1m2, so p|m. (contradiction, Theorem 4.3 (d))

S m1 ∉

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

38

slide-39
SLIDE 39

The Division Algorithm: Prime Numbers

Th 4 4 Th i fi it l i (E lid B k IX)

Theorem 4.4: There are infinitely many primes. (Euclid, Book IX) Proof

If not If not Let p1 , p2, …, pk be the finite list of all primes. Let B = p1 p2 …pk+1.

Let B p1 p2 …pk 1.

Since B > pi , , B is not a prime. So B is composite, pj|B, . (Lemma 4.1)

k i ≤ ≤ 1

k j ≤ ≤ 1

j

Since pj|B and pj|p1 p2 …pk, so pj|1. (Contradiction, Theorem 4.3

(e))

integer. remaining the divides then , and , , integers three the

  • f

two divides and , If e) a z y x a z y x + =

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

39

integer. remaining the divides then a

slide-40
SLIDE 40

The Division Algorithm: Prime Numbers

  • Theorem 4.5: The Division Algorithm, if , with b > 0, then there exist

Z ∈ b a ,

unique

  • Proof

. , with , b r r qb a r q < ≤ + = ∈Z

r | (b) , i.e. , | (a) > / = a b r a b

We call r the remainder when a is divided by b, and q the quotient when a is divided by b.

(1) q, r exist

φ ≠ ∈ = > > − ∈ − = b b b b S S a t a tb a Z t tb a S ) 1 ( ) 1 ( h 1 l d If (ii) , then , and If (i) } , | { Let r , | (b) > / a b b r , | (c) < / a b φ ≠ > − ∴ ≤ ≤ − + − = − − = − − = ≤ S tb a a b b b a b a a tb a a t a , and 1 ) 1 ( ) 1 ( then , 1 let and If (ii) Q b S S P i i l ) O d i W ll ( l l h φ S S b q a c qb a c b r b r a b b q a b r qb a r r S S ∈ + − = ⇒ − = + = > / + = = − − = < ∴ ≠ f l t l t th i i t di t , ) 1 ( then , If (ii) . | ing contradict , ) 1 ( then , If (i) Principle) Ordering Well ( , element least a has φ Q

(2) q, r are unique

b r S r < ∴ .

  • f

element least the is ing contradict

2 2 1 1

if i t di t | | | let , and

  • ther

are there If b b| r b q r b q a r's q's + = + =

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

40

2 1 2 1 2 1 1 2 2 1

and if ing contradict , | | | r r q q q q b r r q b|q = = ∴ ≠ < − = − ⇒

slide-41
SLIDE 41

The Division Algorithm: Prime Numbers

Ex 4.25

  • If the dividend a =170 and the divisor b = 11, then the quotient q =

15 and the remainder r = 5 (170=15*11+5) 15, and the remainder r = 5. (170=15*11+5)

  • If the dividend a = 98 and the divisor b = 7, then the quotient q = 14,

and the remainder r = 0. (98=14*7) f h di id d d h di i b h h i

  • If the dividend a = -45 and the divisor b = 8, then the quotient q = -6,

and the remainder r = 3. (-45=(-6)*8+3 or -45=(-5)*8-5?)

  • Let

+

∈Z b a,

If a = qb, then -a = (-q)b. So, the quotient is -q, and the remainder is 0. If a = qb + r, then -a = (-q)b - r = (-q - 1)b + (b - r). So, the quotient

is -q -1, and the remainder is b - r. q ,

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

41

slide-42
SLIDE 42

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

42

slide-43
SLIDE 43

The Division Algorithm: Prime Numbers

Ex 4.27 : Write 6137 in the octal system (base 8)

Here we seek nonnegative integers r0 , r1 , r2, …, rk , 0< rk <8,

such that 6137= (rk… r2 r1 r0)8.

  • 2

2 1

8 8 8 6137 ⋅ + ⋅ ⋅ ⋅ + ⋅ + ⋅ + =

k k

r r r r

2 3 4 1 2 1

1 8 7 8 7 8 3 8 1 ) 8 8 ( 8 + ⋅ + ⋅ + ⋅ + ⋅ = ⋅ + ⋅ ⋅ ⋅ + ⋅ + + =

− k k

r r r r

remainders

8 6137

8

) 13771 ( 1 8 7 8 7 8 3 8 1 = + + + +

8 767 1(r0) 8 95 7(r1) 8 11 7(r2)

2

8 1 3(r3) 0 1(r4)

How about base 2 and base 16?

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

43

slide-44
SLIDE 44

The Division Algorithm: Prime Numbers

Ex 4.29 : Two’s Complement Method: binary representation of

negative integers

One’s Complement: interchange 0’s and 1’s. Add 1 to the prior result.

E l 6 1010 0001 1001 0110 6 ≡ → + → ≡

Example: Example: How do we perform the subtraction 33 – 15 in base 2

with patterns of 8-bits? 6 1010 0001 1001 0110 6 − ≡ → + → ≡ with patterns of 8 bits?

  • 100010010

(-15) 11110001 (33) 00100001 +

00001111 (+15)

General formula: x – y = x + [(2n – 1) – y + 1] – 2n

100010010

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

44

One’s complement of y

slide-45
SLIDE 45

The Division Algorithm: Prime Numbers

E 4 31 If

d i i h h i i h

+

Ex 4.31 : If and n is composite, then there exists a prime p such

that p|n and

Proof

+

∈Z n

. n p ≤

Composite n = n1n2 We claim that one of n1 , n2 must be less than or equal to If not then

d

, n

If not, then

tion) (contradic and

2 1 2 1

n n n n n n n n n n = > = > >

So, assume

(i) If n1 is prime, the statement is true.

.

1

n n ≤

( )

1

p , (ii) If n1 is not prime, there exists a prime p < n1 where p|n1. (Lemma 4.1) then

So p|n and

. n p ≤ .

1

n n p ≤ <

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

45

p|

slide-46
SLIDE 46

4.4 The Greatest Common Divisor: The Euclidean Algorithm

Definition 4.3: For , a positive integer c is called a greatest

common divisor of (最大公因數gcd(a,b) )

Z ∈ b a,

if ,b a

c d b a d b a c b c c|a | have we , and

  • f

divisor common any for (b) ) ,

  • f

divisor common a is ( | and (a)

  • Questions
  • Does a greatest common divisor of a and b always exist?

| , y ( )

  • Does a greatest common divisor of a and b always exist?
  • What would we deal with greatest common divisors for large integers a

and b ?

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

46

slide-47
SLIDE 47

The Greatest Common Divisor: The Euclidean Algorithm

Theorem 4.6: For all , there exists a unique that is the

greatest common divisor of a and b.

f

+

∈Z b a,

} | { l t Gi bt t bt S b

+

Z Z

+

∈Z c

  • Proof

. ,

  • f

divisor common greast a is that claim We : Existence (i) Principle) Ordering

  • (Well

element least a has } , , | { let , , Given b a c c S bt as t s bt as S b a > + ∈ + = ∈

+

Z Z , , | If | 4.3(f)) (Theorem then , and if , , c r r qc a a c c d by d|ax d|b d|a by ax c S c < < + = / ∴ + + = ∈ Q | similarly, , |

  • f

element least the is ng contrdicti , ) ( ) 1 ( ) ( then b c a c S c S r b qy a qx by ax q a qc a r ∴ ∈ ∴ − + − = + − = − = 4 3(b)) (Theorem | and n the divisors common greast the are both , If : s Uniquenes (ii) | similarly, , |

2 1 1 | 2 2 1

c c c c c c c c b c a c ∴ ∴

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

47

4.3(b)) (Theorem

2 1

c c = ∴

slide-48
SLIDE 48

The Greatest Common Divisor: The Euclidean Algorithm

  • The greatest common divisor of a and b is denoted by gcd(a, b).
  • gcd(a, b) = gcd(b, a)
  • Also

a a = ≠ ∈ 0) gcd(a then a if Z

  • Also,
  • gcd(a, b) = the smallest positive integer of the linear combination of a and

b d b ll d l ti l i h d( b) 1

a a ≠ ∈ 0) gcd(a, then , a if , Z

  • a and b are called relatively prime when gcd(a, b)=1
  • i.e,
  • gcd(a, b)=c gcd(a/c, b/c)=1

. 1 with , = + ∈ by ax y x Z

  • Ex 4.33
  • gcd(42 70) = 14 42x+70y=14
  • gcd(42, 70) = 14, 42x+70y=14
  • One solution x=2, y=-1
  • x=2-5k, y=-1+3k

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

48

slide-49
SLIDE 49

The Greatest Common Divisor: The Euclidean Algorithm

  • Theorem 4.7: Euclidean Algorithm: Let Set r0 = a and r1 = b

and apply the division algorithm n times as follows:

. ,

+

∈Z b a

and apply the division algorithm n times as follows:

r r r r q r r r r r q r < < + = < < + =

1 2 2 1 1

r r r r q r r r r r q r < < + = < < + =

⋅ ⋅ ⋅ 3 4 4 3 3 2 2 3 3 2 2 1 n n n n n n n n n

r q r r r r r q r = < < + =

− − − − − 1 1 1 1 2

Then rn, the last nonzero remainder, equals gcd(a, b)

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

49

slide-50
SLIDE 50

The Greatest Common Divisor: The Euclidean Algorithm

  • Proof

d ) ( | d | If ,

  • f

divisor any for , | Verify (i) ) , gcd( at verify th To b b a c r c b a r

n n =

| | and | Next ) (e) 4.3 Theorem ( | then and ), , ( | and | If

, 2 1 1 2 2 1 1 1 1

r c r c r c r r q r r c r r q r b r a r r c r c ⇒ + = + = = = Q

r r q r r r q r + = + =

3 2 2 1 2 1 1

| and | Verify (ii) | down Continuing | | and | Next

3 2 1

b r a r r c r c r c r c

n n n

⇒ ⇒

r r q r + + =

⋅ ⋅ ⋅ 4 3 3 2

) (e) 4.3 Theorem ( equation last the From

, 1 1 2 2 | 1 |

r r q r r r r r

n n n n n n n n

+ = ∴

− − − − −

Q

n n n n n n n

r q r r r q r = + =

− − − − 1 1 1 2

) gcd( ) , ( | [ ] | [ up, Continuing

1 | ] 1 2 | 1 | 2 3 |

b a r b r a r r r r r r r r r r r r r

n n n n n n

= ∴ = = ⇒ ∧ ⇒ ∧

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

50

) , gcd( b a rn = ∴

slide-51
SLIDE 51

The Greatest Common Divisor: The Euclidean Algorithm

Ex 4.34 : find the gcd(250,111), and express the results as a linear

combination of these integers.

  • Solution

< < + ⋅ = 111 28 28 111 2 50 2

  • Solution

< < + ⋅ = < < + ⋅ = < < + ⋅ = 27 1 1 27 1 28 28 27 27 28 3 111 111 28 28 111 2 50 2

250 111

= ∴ + ⋅ = 1 ) 111 , 250 gcd( 1 7 2 27

222 28 *2

⋅ − + − = ⋅ + − = ⋅ − − = ⋅ − = ) ( ] 111 2 250 [ 4 111 ) 1 ( 28 4 111 ) 1 ( 28] 3 111 [ 1 28 27 1 28 1

84 27 27 *3 *1

Z ∈ + + = − ⋅ + ⋅ = k k k ] 250 9 [ 111 ] 111 250[4 1 unique not is it fact, In ) 9 ( 111 4 250

27 1 *1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

51

Z ∈ + − + − = k k k ], 250 9 [ 111 ] 111 250[4 1 1. 111) gcd(250, 111)

  • gcd(-250,

111)

  • gcd(250,

111) gcd(-250, = = = =

slide-52
SLIDE 52

The Greatest Common Divisor: The Euclidean Algorithm

Ex 4.35 : the integers 8n+3 and 5n+2 are relatively prime.

  • Solution

1 3 1 2 ) 1 2 ( ) 1 3 ( 1 2 5 2 5 1 3 ) 1 3 ( ) 2 5 ( 1 3 8 + < + < + + + = + + < + < + + + = + n n n n n n n n n n 1 1 2 1 2 1 2 ) 1 2 ( 1 1 3 ) ( ) ( < < + ⋅ = + + < < + + = + n n n n n n n n 1 ) 2 5 , 3 8 gcd( 1 = + + + ⋅ = n n n n

(8n+3)(-5) + (5n+2)(8) = -15 + 16 = 1

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

52

slide-53
SLIDE 53

The Greatest Common Divisor: The Euclidean Algorithm

  • An algorithm: a list of precise instructions designed to solve a particular

type of problem, not just one special case.

E 4 36 U

E lid l ith t d l d (i d d )

Ex 4.36 : Use Euclidean algorithm to develop a procedure (in pseudocode)

that will find gcd(a, b) for all a, b ∈ Z+

procedure gcd(a,b: positive integers) p g ( , p g ) begin r:= a mod b d:= b while r > 0 do c:= d d:= r r:= c mod d end return(d) d { d( b) d}

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

53

end {gcd(a,b) = d}

slide-54
SLIDE 54

The Greatest Common Divisor: The Euclidean Algorithm

Ex 4.37 : Griffin has two unmarked containers. One container holds 17

  • unces and the other holds 55 ounces. Explain how Griffin can use his two

containers to measure exactly one ounce containers to measure exactly one ounce.

  • Solution

17 4 , 4 17 3 55 < < + ⋅ = ] 7 1 3 55 [ 4 17 4 4 17 1 4 1 , 1 4 4 17 ⋅ − − = ⋅ − = < < + ⋅ = 55 4 17 13 ] [ ⋅ − ⋅ =

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

54

slide-55
SLIDE 55

The Greatest Common Divisor: The Euclidean Algorithm

Ex 4.38 : On the average, Brian debug a Java program in six minutes, but

it takes 10 minutes to debug a C++ program. If he works for 104 minutes and doesn’t waste any time how many programs can be debug in each and doesn t waste any time, how many programs can be debug in each language.

  • Solution

= + ⇒ = + 52 5 3 104 10 6 y x y x + ≤ ≤ + − + − = − ⋅ + ⋅ = ⇒ − ⋅ + ⋅ = ⇒ = 3 52 5 104 ) 3 52 ( 5 ) 5 104 ( 3 ) 52 ( 5 104 3 52 ) 1 ( 5 2 3 1 1 ) 5 , 3 gcd( k y k x k k Q ⎧ = = = ≤ ≤ ∴ + − = ≤ − = ≤ 2 14 : 18 3 52 , 5 104

5 104 3 52

y x k k k y k x Q ⎪ ⎩ ⎪ ⎨ ⎧ = = = = = = = = = ⇒ 8 , 4 : 20 5 , 9 : 19 2 , 14 : 18 y x k y x k y x k

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

55

slide-56
SLIDE 56

The Greatest Common Divisor: The Euclidean Algorithm

  • Theorem 4.8: If the Diophantine equation ax + by = c has an

integer solution x = x0, y = y0 if and only if gcd(a, b) divides c.

  • Definition 4 4: For

c is called a common multiple of a b

, , ,

+

∈Z c b a

+

∈Z c b a

  • Definition 4.4: For c is called a common multiple of a, b

if c is a multiple of both a and b. Furthermore, c is the least common multiple of a, b if it is the smallest of all positive integers that are common l i l f b W d b l ( b)

, , , ∈Z c b a

multiples of a, b. We denote c by lcm(a, b).

  • Theorem 4.9: Let with c = lcm(a, b). If d is a common multiple
  • f a and b, then c|d.

, , ,

+

∈Z c b a

, |

  • Proof

) , ( lcm , | If ma c b a c c r r qc d d c = ∴ = < < + = / Q | multiple common least the is that claim the contradict , but ) ( , also d c c c r r a qm n r qma na na d ∴ < < = − ⇒ + = =

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

56

. | d c ∴

slide-57
SLIDE 57

The Greatest Common Divisor: The Euclidean Algorithm

Theorem 4.10: For ab = lcm(a, b).gcd(a, b)

Ex 4.40 : By Theorem 4.10 we have

, ,

+

∈Z b a

  • (a) For all If a and b are relatively prime,

then lcm(a, b) = ab.

  • (b) The computations in Examples 4 36 (a = 168 b = 456) establish the

, ,

+

∈Z b a

  • (b) The computations in Examples 4.36 (a = 168, b = 456) establish the

fact that gcd(168,458) = 24. As a result we find that lcm(a, b)?

  • Solution

192 , 3 ) 456 , 168 ( lcm 24 ) 456 , 168 gcd(

24 456 168

= = ∴ =

Q

24

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

57

slide-58
SLIDE 58

4.5 The Fundamental Theorem of Arithmetic

Lemma 4.2: If and p is prime, then

. | | | b p a p ab p ∨ ⇒

, ,

+

∈Z b a

  • Proof

| | | p p p

| (ii) | (i) a p a p / ) ( ) ( 1 1 ) , gcd( prime is | ( ) b ab y p bx ay px a p p p = + = + ∴ = ∴ Q | and | ) ( ) ( , 1 ab p p p b ab y p bx ay px = + = + ∴ Q

y) ( | )] | ( ) | [( c bx a c a b a + ⇒ ∧

Lemma 4.3:

(f)) 4.3 (Theorem | b p ∴

. 1 some for | | and prime is If . Let

2 1

n i a p a a a p p a

i n i

≤ ≤ ⇒ ∈

⋅ ⋅ ⋅

+

Z

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

58

2 1 i n i

slide-59
SLIDE 59

The Fundamental Theorem of Arithmetic

Ex 4.41 : Show that is irrational.

Proof

2

4 2) (Lemma | 2 | 2 2 2 1 ) , gcd( and , , where , 2 not If

2 2 2 2

⇒ ⇒ = ⇒ = ∴ = ∈ = ⇒

+

a a a b b a b a

a b a

Z i ) ( di ) d( | | 4.2) (Lemma | 2 | 2 , 2 4 2 2 4.2) (Lemma | 2 | 2 2 2

2 2 2 2 2 2 2

⇒ = ⇒ = = ⇒ = ∴ ⇒ ⇒ = ⇒ = ∴ b b b b c b c a b c a a a a b

b

tion) (Contradic 2 ) , gcd( | 2 | 2 ≥ ∴ ∧ b a b a Q

p prime every for irrational is p

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

59

slide-60
SLIDE 60

The Fundamental Theorem of Arithmetic

  • Theorem 4.11: Every integer n > 1 can be written as a product of primes

y g p p uniquely, up to the order of the primes. ( )

  • Proof

k k

s s s

p p p n ⋅ ⋅ ⋅ =

2 2 1 1

existence (i) m m m m m m m m m m ) 1 ( primes

  • f

product as written be can , and , composite) is ( primes.

  • f

product a as e expressibl not integer smallest the is not, If existence (i)

2 1 2 1

< < = Q Q n- n m m m m true) are 1 , 2,3,4, for form, ve (alternati Induction al Mathematic use : uniqueness (ii) primes

  • f

product a as e expressibl be can ) , 1 (

2 1

⋅⋅ ⋅ = ∴ < < Q

j r t t t r k j i r t r t t k k

q p q q q p n p q q q p p p q p q q q p p p n

s s s

4.3) (Lemma | | | and , primes are , where Suppose

1 2 2 1 1 1 1 2 1 , 2 1 2 2 1 1 2 2 1 1

⇒ ⋅ ⋅ ⋅ ⇒ < ⋅ ⋅ ⋅ < < < ⋅ ⋅ ⋅ < < ⋅ ⋅ ⋅ = ⋅ ⋅ ⋅ = Q

. | | and prime is If

2 1 i n

a p a a a p p ⇒

⋅ ⋅ ⋅

i i j j j r

q p q p q p i if p q q p q p q p q q q p p

j

j find t can' we , 1 similarly, primes are and ) ( | | |

1 1 1 1 1 , 1 1 1 2 1 1 1

= ∴ = < = ∋ > = = ⇒ Q Q

. |

i

a p ⇒

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

60

i i i i r t r t t k k

t s t s q p r k n n q q q p p p n

s s s p n

, , , , hypothesis induction By

1 1 1 2 2 1 1 1 2 2 1 1 1 1 1

= = = = ∴ < ⋅ ⋅ ⋅ = ⋅ ⋅ ⋅ = = ⇒

− −

Q

slide-61
SLIDE 61

The Fundamental Theorem of Arithmetic

Ex 4.44 : How many positive divisors do 29,338,848,000 have? How

Ex 4.44 : How many positive divisors do 29,338,848,000 have? How

many of the positive divisors are multiples of 360? How many of the positive divisors are perfect squares?

  • Solution

For (i)

2 1

p p p n

k

s s s

  • Solution

11 7 5 3 2 000 , 848 , 338 , 29 ) 1 ( ) 1 )( 1 ( is

  • f

divisors positive

  • f

number The For (i)

3 3 5 8 2 1 2 2 1 1

= + ⋅ ⋅ ⋅ + + ⋅ ⋅ ⋅ = s s s n p p p n

k k k

76 5 1) 1)(1 1)(3 1 1)(3 2 5 )( 1 3 8 ( 5 3 2 360 (ii) 1728 1) 1)(1 1)(3 1)(3 5 )( 1 8 ( answer

2 3

= = + + + + + = ∴ (0,2,4) choices 3 have we , 5 For ) (0,2,4,6,8 choices 5 have we , 8 For (iii) 76 5 1) 1)(1 1)(3 1 1)(3 2 5 )( 1 3 8 ( answer

2 1

= = = + + + − + − + − = ∴ s s 60 1 2 2 3 5 answer (0) choices 1 have we , 1 For (0,2) choices 2 have we , 3 For

5 4 , 3

∴ = = s s s

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

61

60 1 2 2 3 5 answer = ⋅ ⋅ ⋅ ⋅ = ∴

slide-62
SLIDE 62

The Fundamental Theorem of Arithmetic

Ex 4.46 : Can we find three consecutive positive integers whose product is

a perfect square, i.e., m(m+1)(m+2) = n2 , ?

  • Solution

+

∈Z n m,

  • Solution

) 4 4 S ti f 21 E i ( ) 2 , 1 gcd( 1 ) 1 , ( gcd fact that the Use exist , such Suppose + + = = + m m m m n m square perfect a also is ) 1 ( square perfect a is | and ), 2 ( | , | then ), 1 ( | if , prime any For ) 4.4 Section

  • f

21 Exercise (

2 2

+ ∴ + / / + ∴ m n n p m p m p m p p Q ) 1 ( 1 2 ) 2 ( square perfect a also is ) 2 ( square perfect a also is ) 1 ( square perfect a is

2 2 2

+ = + + < + < + ∴ + ∴ m m m m m m m m m n Q Q integers. positive e consecutiv such three no are e that ther conclude we So, square perfect a be cannot ) 2 ( + ∴ m m

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

62

slide-63
SLIDE 63

Supplementary Exercise 34

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

63

slide-64
SLIDE 64

Exercise (2009)

4-1 :18, 24

4-2 :14, 19 4 2 :14, 19 4-3 :4, 10 4-4 :10 14 4-4 :10, 14 4-5 :8

Discrete Mathematics Discrete Mathematics – – CH4 CH4 2009 Spring 2009 Spring

64