matdis 3.4

27
Backward Reasoning Examples 14, 15 page 95 Rewrite the proof using Forward Reasoning

Upload: claudia-primasiwi

Post on 29-Jun-2015

68 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Matdis 3.4

Backward Reasoning

Examples 14, 15 page 95

Rewrite the proof using

Forward Reasoning

Page 2: Matdis 3.4

Backward Reasoning Example 14 page 95

Given x, y are two distinct positive real numbers.

Prove that (x+y)/2 > xy

Proof: (x+y)/2 > xy

(x+y)2/4 > xy

(x+y)2 > 4xy

x2 + 2xy + y2 > 4xy

x2 – 2xy + y2 > 0

(x – y)2 > 0

x y

Rewrite the proof using Forward Reasoning

Page 3: Matdis 3.4

Given x, y are two distinct positive real numbers.

Prove that (x+y)/2 > xy

Forward Reasoning :

x y

(x – y)2 > 0

x2 – 2xy + y2 > 0

x2 + 2xy + y2 > 4xy

(x+y)2 > 4xy

(x+y)2/4 > xy

(x+y)/2 > xy

Page 4: Matdis 3.4

Chapter 2.3.

page 146 no. 7, 8

page 148 no. 69

PR u/ 25-3-2013Buat ringkasan CARDINALITY(halaman 158 – 160)

Page 5: Matdis 3.4

Chapter 33.1. Algorithms

3.2. The Growth of Functions

3.3. Complexity of Algorithms

3.4. Integers and Division

3.5. Primes and GCDs

3.6. Integers and Algorithms

3.7. Applications of Number Theory

3.8. Matrices

Page 6: Matdis 3.4

Notation :

a | b a divides b a habis membagi b (b habis dibagi a)

a b a does not divide b (b tidak habis dibagi a, ada sisa)

Example : 3 | 7 false 3 | 12 true

Theorem1: a, b, c are integers

1. If a | b and a | c, then a | (b+c)

2. If a | b, then a | bc for all integers c

3. If a | b and b | c, then a | c

|

Page 7: Matdis 3.4

1. a | b and a | c b = ma dan c = na

b + c = ma + na = (m + n)a = ka ; k = m+n

hence a | (b + c)

2. a | b and c any integer b = ma, bc = (ma)c = (mc)a = sa ; s = mc

so a | bc

Theorem 1: a, b, c are integers

1. If a | b and a | c, then a | (b+c)

2. If a | b, then a | bc for all integers c

3. If a | b and b | c, then a | c

3. a | b and b | c b = ma, c = pb = p(ma)

= (pm)a = na ; n = pm

therefore a | c

Page 8: Matdis 3.4

Corollary:

a | b and a | c a | mb + nc

Proof : b = pa

c = qa

mb = m(pa) = (mp)a

nc = n(qa) = (nq)a

mb + nc = (mp + nq)a = da ; d = mp + nq

a | mb + nc

Page 9: Matdis 3.4

Theorem 2 :

Let a be an integer and d a positive integer.

Then there are unique integers q and r, with 0 r d

such that a = q d + r

a is called the dividend

d is called the divisor

q is called the quotient

r is called the remainder

Page 10: Matdis 3.4

Example 3: 101 = 9 (11) + 2

dividend

divisor

quotient

remainder

Example 4: – 11 = – 4 (3) + 1

dividend

divisor

quotient

remainder

Let a be an integer and d a positive integer.

Then there are unique integers q and r,

with 0 r d such that a = q d + r

Page 11: Matdis 3.4

Modular Arithmetic:

If a and b are integers, m is a positive integer, then

a is congruent to b modulo m

if m divides (a – b)

The notation used: a b (mod m)

Page 12: Matdis 3.4

Theorem 3: a b (mod m) a mod m = b mod m

Harus dibuktikan: (1) a b (mod m) a mod m = b mod m

(2) a mod m = b mod m a b (mod m)

(1) Buktikan : a b (mod m) a mod m = b mod m

a b (mod m) (a – b) mod m = 0

(a – b) = cm; c = integer

a = b + cm

b < m a mod m = b = b mod m

b m = dm + r (d 1, 0 r < m)

a = (dm + r) + cm = (d + c)m + r

a mod m = r = b mod m

jadi: a b (mod m) a mod m = b mod m (terbukti)

Page 13: Matdis 3.4

(2)Buktikan : a mod m = b mod m a b (mod m)

a mod m = b mod m a = km + s a mod m = sb = hm + s b mod m = s

k, h integer; 0 s < m

apakah a b (mod m) ?

atau apakah (a – b) habis dibagi m ?

atau apakah (a – b) mod m = 0 ?

(a – b) = (km – hm) + (s – s)

(a – b) = (km – hm) + 0

(a – b) = (k – h)m

= (p) m

(a – b) mod m = 0

a b (mod m)

jadi: a mod m = b mod m a b (mod m) terbukti

Page 14: Matdis 3.4

Theorem 4: Let m be a positive integer. a b (mod m) there is an integer k such that a = b + km

Proof (i): a b (mod m) there is an integer k such that a = b + km

a b (mod m) means (a – b) mod m = 0 i.o.w. (a – b) = km a = b + km (QED)

Proof (ii): if a = b + km a b (mod m) or (a – b) mod m = 0

a = b + km (a – b) = km (a – b) mod m = 0 (QED)

Page 15: Matdis 3.4

Theorem 5: Let m be a positive integer. If a b (mod m) and c d (mod m) then a + c b + d (mod m) and ac bd (mod m)

Page 16: Matdis 3.4

Theorem 5: Let m be a positive integer. If a b (mod m) and c d (mod m) then a + c b + d (mod m) i.e. ((a + c) – (b + d)) mod m = 0

Proof: a b (mod m) c d (mod m) (a – b) mod m = 0 (c – d) mod m = 0 (a – b) = km (c – d) = hm a = b + km c = d + hm

a + c = b + km + d + hm = (b + d) + (km + hm) (a + c) – (b + d) = km + hm ((a + c) – (b + d)) mod m = (km + hm) mod m = 0 If a b (mod m) then a + c b + d (mod m) (QED)

Page 17: Matdis 3.4

Theorem 5: Let m be a positive integer. If a b (mod m) and c d (mod m) then ac bd (mod m) i.e. (ac – bd) mod m = 0

Proof: a b (mod m) c d (mod m) (a – b) mod m = 0 (c – d) mod m = 0 (a – b) = km (c – d) = hm a = b + km c = d + hm

ac = (b + km)(d + hm) = (bd) + (bhm + dkm) + kmhm ac – bd = bhm + dkm + kmhm ac – bd = m ( bh + dk + kmh ) (ac – bd) mod m = 0 If a b (mod m) then ac bd (mod m) (QED)

Page 18: Matdis 3.4

Corollary 2: Let m be a positive integer and let a and b be integers. Then

(a + b) mod m = ( (a mod m) + (b mod m) ) mod m and ab mod m = ( (a mod m) (b mod m) ) mod m

study the proof

Page 19: Matdis 3.4

Hashing

Encryption

Page 20: Matdis 3.4

HashingTo index and retrieve data in DBMS

Example : (511110258 mod 100) = 58(511110558 mod 100) = 58

Problem: Collision

Solution: - use prime numbers as divisors - put data in “next” slot - re-hash

Page 21: Matdis 3.4

HashingTo index and retrieve data in DBMS

Solution: - use prime numbers as divisors (51110258 mod 111) = 30 (51110558 mod 111) = 108

- put data in “next” slot ( add 7 ) (511110258 mod 100) = 58 (511110558 mod 100) = 58 put this data in

position 65

Problem : maintenance of data (addition, deletion)

Page 22: Matdis 3.4

EncryptionA = 0 B = 1 C = 2 D = 3 E = 4F = 5 G = 6 H = 7 I = 8 J = 9K=10 L=11 M=12 N= 13 O= 14

Pesan (message) LAB •di-encrypt menjadi 11 0 1 •lalu dengan (p + 3) mod 26 menjadi 14 3 4•di-”encrypt” ke huruf menjadi ODE

Page 23: Matdis 3.4

DecryptionA = 0 B = 1 C = 2 D = 3 E = 4F = 5 G = 6 H = 7 I = 8 J = 9K=10 L=11 M=12 N= 13 O= 14

Pesan (message) ODE •di-”encrypt” menjadi 14 3 4 •lalu dengan (p – 3) mod 26 menjadi 11 0 1 •di-decrypt menjadi LAB

Page 24: Matdis 3.4

EncryptionPrivate key cryptosystem

Public key cryptosystem•Every sender has a public encryption key•The intended receiver has a secret decryption key •e.g. RSA encryption / decryption system

Page 25: Matdis 3.4

RSA encryption system: see Example 11

C = Me mod n

1.Plain text : STOP

2. Group into blocks of 4 : M1 = 1819 M2 = 1415

p = 43; q = 59; n = pq = 2537e = 13M1

e mod n = 181913 mod 2537 = 2081 M2e mod n = 141513 mod 2537 = 2182

3.The encrypted message is 2081 2182

A = 0 B = 1 C = 2 D = 3 E = 4F = 5 G = 6 H = 7 I = 8 J = 9K=10 L=11 M=12 N= 13 O= 14P=15 Q=16 R=17 S=18 T=19U=20 V=21 W=22 X=23 Y=24Z=25

Page 26: Matdis 3.4

RSA decryption system: see Example 12

1. Cypher text : 0981 0461

2. From the system in Example 11:p = 43; q = 59; n = 2537; e = 13

find an inverse of 13 mod (p – 1)(q – 1); call it d i.e. (ed – 1) mod (p – 1)(q – 1) (ed – 1) mod (p – 1)(q – 1) = 0 (13d – 1) mod (42)(58) = 0

3. d = 937 since (13937 – 1) mod 2436 = 0

4. P = Ce mod n

P1 = 0981937 mod 2537 = 0704 P2 = 0461937 mod 2537 = 1115

Page 27: Matdis 3.4

RSA decryption system: see Example 12

4. P = Ce mod n

P1 = 0981937 mod 2537 = 0704 P2 = 0461937 mod 2537 = 1115

hence the decrypted message is H E L P

A = 0 B = 1 C = 2 D = 3 E = 4F = 5 G = 6 H = 7 I = 8 J = 9K=10 L=11 M=12 N= 13 O= 14P=15 Q=16 R=17 S=18 T=19U=20 V=21 W=22 X=23 Y=24Z=25