21
Matematika Diskrit (D) Matematika Diskrit (D) KI 1306 KI 1306 Rully Soelaiman Rully Soelaiman [email protected] [email protected] Jurusan Teknik Informatika Jurusan Teknik Informatika Fakultas Teknologi Informasi Fakultas Teknologi Informasi Institut Teknologi Sepuluh Nopember Institut Teknologi Sepuluh Nopember

MatDis 2012 K02 Dist_2

Embed Size (px)

Citation preview

Page 1: MatDis 2012 K02 Dist_2

Matematika Diskrit (D) Matematika Diskrit (D) KI 1306 KI 1306

Rully SoelaimanRully [email protected]@gmail.com

Jurusan Teknik InformatikaJurusan Teknik InformatikaFakultas Teknologi Informasi Fakultas Teknologi Informasi

Institut Teknologi Sepuluh NopemberInstitut Teknologi Sepuluh Nopember

Page 2: MatDis 2012 K02 Dist_2

• Evaluasi Tengah Semester 30%• Evaluasi Akhir Semester 30%• Tugas (Analisis dan Coding) 40%

Kelas atau Take Home

Page 3: MatDis 2012 K02 Dist_2

1 The Foundations: Logic and Proofs 1.6 Introduction to Proofs 1.7 Proof Methods and Strategy

2 Basic Structures: Sets, Functions, Sequences and Sums

2.1 Sets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations

3 The Fundamentals: Algorithms, the Integers3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors 3.6 Integers and Algorithms 3.7 Applications of Number Theory

Page 4: MatDis 2012 K02 Dist_2

4 Induction and Recursion

4.1 Mathematical Induction 4.2 Strong Induction and Well-Ordering 4.3 Recursive Definitions and Structural Induction 4.4 Recursive Algorithms

5 Counting

5.1 The Basics of Counting 5.2 The Pigeonhole Principle 5.3 Permutations and Combinations 5.4 Binomial Coefficients 5.5 Generalized Permutations and Combinations 5.6 Generating Permutations and Combinations

Page 5: MatDis 2012 K02 Dist_2

6 Advanced Counting Techniques

7.1 Recurrence Relations 7.2 Solving Linear Recurrence Relations 7.3 Divide-and-Conquer Algorithms and Recurrence Relations 7.4 Generating Functions 7.5 Inclusion-Exclusion 7.6 Applications of Inclusion-Exclusion

7 Relations

8.1 Relations and Their Properties 8.2 n-ary Relations and Their Applications 8.3 Representing Relations 8.4 Closures of Relations 8.5 Equivalence Relations 8.6 Partial Orderings

Page 6: MatDis 2012 K02 Dist_2

Contoh Soal 1Contoh Soal 1

Page 7: MatDis 2012 K02 Dist_2

Solusi Soal 1Solusi Soal 1

• Diketahui :

P1 : a + 4b + 9c + 16d = 52

P2 : 4a + 9b + 16c + 25d = 150

P3 : 9a + 16b + 25 + 36d = 800• Bentuk persamaan P4 = P2 + P3 – P1

P4 : 4a + 9b + 16c + 25d = 150 9a + 16b + 25c + 36d = 800

-a - 4b - 9c - 16d = -52

+ P4 :12a + 21b + 32c + 45d = 898

Page 8: MatDis 2012 K02 Dist_2

Solusi Soal 1Solusi Soal 1

• Diketahui :

P1 : a + 4b + 9c + 16d = 52

P2 : 4a + 9b + 16c + 25d = 150

P3 : 9a + 16b + 25 + 36d = 800• Bentuk persamaan P5 = P1 + P3 – 2 ×P2

P5 : a + 4b + 9c + 16d = 52 9a + 16b + 25c + 36d = 800

-8a - 18b - 32c - 50d = -300

+ P5 : 2a + 2b + 2c + 2d = 552

Page 9: MatDis 2012 K02 Dist_2

Solusi Soal 1Solusi Soal 1

• Diketahui :

P4 :12a + 21b + 32c + 45d = 898

P5 : 2a + 2b + 2c + 2d = 552• Bentuk persamaan P6 = P4 + 2 ×P5

P6 : 12a + 21b + 32c + 45d = 898

4a + 4b + 4c + 4d = 1104

+ P6 : 16a + 25b + 36c + 49d = 2002

Page 10: MatDis 2012 K02 Dist_2

Soal 2Soal 2

Page 11: MatDis 2012 K02 Dist_2

Solusi Soal 2Solusi Soal 2

• Dari sini diperoleh bentuk

• Karena x≠1, maka

)()()2()1(

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

2

nfnnfff

nfnnfff

)()1()1()1(

)()()1()1(22

22

nfnnfn

nfnnfnfn

1

1

)1(

)(

1

1

)(

)1(

n

n

nf

nf

n

n

nf

nf

Page 12: MatDis 2012 K02 Dist_2

Solusi Soal 2Solusi Soal 2

• Sehingga diperoleh

1997

2)1996(

19961997

12

)1(

)1996(3

1

4

2

1996

1994

1997

1995

)1(

)2(

)2(

)3(

)1994(

)1995(

)1995(

)1996(

f

f

f

f

f

f

f

f

f

f

f

1

1

)1(

)(

1

1

)(

)1(

n

n

nf

nf

n

n

nf

nf

Page 13: MatDis 2012 K02 Dist_2

SoalSoal

• SPOJ Problem Set (classical) 9034 - Help Tohu

• SPOJ Problem Set (tutorial) 5241. Alchemy

• SPOJ Problem Set (tutorial) 8360. Prime After N

Page 14: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

Page 15: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

• Amati beberapa nilai ak

• k = 1 k = 3

• k = 2 k = 4

2

132 321

k

kkaaaa k

3

21 a

432

1

24

14

32

2

21

a

aa

543

1

60

15

432

3

321

a

aaa

654

1

120

16

5432

4

4321

a

aaaa

Page 16: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

• Buktikan untuk

• Bukti

2k

)2(

)1(

)2()1(543

3

432

2

3

2

k

k

kkk

k

2

12

1

3

1

3

2

2

1

1

1

5

1

4

1

4

1

3

1

3

2

)2()1(

1

54

1

43

1

3

2

k

kk

kk

kk

Page 17: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

• Untuk

• Untuk

• Perhatikan bentuk

3

2S1n

2n

)2()1(

1

543

1

432

1

3

2

nnnS

21)2()1(

1

s

C

s

B

s

A

sss

Page 18: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

AsCBAsCBAs

C

s

B

s

A2)23()(

212

12)23()( 2 AsCBAsCBA

12

023

0

A

CBA

CBA

2

1,1,

2

1 CBA

)2(2

1

1

1

2

1

)2()1(

1

ssssss

Page 19: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

1

1

)2(2

1

10

1

8

11

4

1

3

1

2

1

4

1

3

2

)2(2

1

10

1

8

1

1

11

4

1

3

11

4

1

3

1

2

1

4

1

3

2

)2(2

1

10

1

8

1

1

1

4

1

3

1

2

1

6

1

4

1

3

2

)2(2

1

1

1

2

1

10

1

4

1

6

1

8

1

3

1

4

1

3

2

)2()1(

1

543

1

432

1

3

2

nnn

nnnn

nnn

nnn

nnnS

Page 20: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034

)2)(1(

1

2

1

12

1

3

2

)2(

1

)1(

1

2

1

12

1

3

2

)2(2

1

)1(2

1

6

1

4

1

3

2

1

1

)2(2

1

)1(2

11

5

1

4

1

2

11

5

1

4

1

2

1

6

1

4

1

3

2

1

1

)2(2

1

10

1

8

11

4

1

3

1

2

1

4

1

3

2

nn

nn

nn

nnnnn

nnnS

Page 21: MatDis 2012 K02 Dist_2

SPOJ 9034SPOJ 9034