Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Chapter 13 (last) Recursion (Rekursi) Program S1-Ekstensi Departemen Teknik Elektro FTUI Slides ©2007.

Presentasi serupa


Presentasi berjudul: "Chapter 13 (last) Recursion (Rekursi) Program S1-Ekstensi Departemen Teknik Elektro FTUI Slides ©2007."— Transcript presentasi:

1 Chapter 13 (last) Recursion (Rekursi) Program S1-Ekstensi Departemen Teknik Elektro FTUI Slides ©2007

2 Definisi Recursion, in mathematics and computer science, is a method of defining functions in which the function being defined is applied within its own definitionmathematicscomputer sciencefunctions The term is also used more generally to describe a process of repeating objects in a self-similar way For instance, when the surfaces of two mirrors are almost parallel with each other, the nested images that occur are a form of recursion

3 Contoh visual: Droste Effect [1] Törnqvist, Egil. Ibsen: A Doll's House, pp.105, Cambridge University Press (1995) ISBN 0-521- 47866-9ISBN 0-521- 47866-9 The effect is named after a particular image, that appeared, with variations, on the tins and boxes of Droste cocoa powder, one of the main Dutch brands. It displays a nurse carrying a serving tray with a cup of hot chocolate and a box of the same brand.[1] Drostecocoa nurse[1]

4 Rekursif pada Droste Effect

5 Contoh lain: fractal

6 Video

7 Rekursi Memanggil atau refer ke diri sendiri Contoh : Menghitung X n, dimana : X : real value n : non-negative integer X n = X × X × … × X n X’s

8 Rekursi Contoh : x 0 = 1 3 0 = 1 3 1 = 3 3 2 = 3 × 3 = 9 3 3 = 3 × 3 × 3 = 27 3 4 = 3 × 3 × 3 × 3 = 81 3 5 = 3 × 3 × 3 × 3 × 3 = 243

9 Rekursi Hubungannya adalah : 3n = 3 × 3 n-1 X 0 = 1 for n > 0, X n = X × X n-1

10 Faktorial Bilangan Faktorial bilangan n didefinisikan sebagai berikut : f(n)=n ×(n-1)×(n–2) × … × 1 Secara recursif, faktorial bilangan dapat didefinisikan sebagai berikut : n × f(n-1) jika n > 0 f(n) = 1 jika n = 0

11 Faktorial Bilangan func f(n) if n = 0 then return (0) else return (n*f(n-1)) eif efunc

12 Faktorial Bilangan f(3) 3 × f(2) 2 × f(1) 1 × f(0) 1

13 SELESAI REKURSI

14 Mengenai UTS Bagi Anda yang belum lulus, berhalangan dalam UTS atau ingin memperbaiki nilai, silakan mengikuti UTS kedua Waktu: Jum’at, 7 Desember 2007 pukul 16:30 – selesai Ruang: K-207 (ruang kelas pada saat Ibu Ratna mengajar) Nilai terbaik akan diambil sebagai nilai akhir UTS

15 Tugas Pengganti UAS Tugas dibuat secara berkelompok (3 orang) Buatlah program aplikasi dengan memanfaatkan algoritma yang telah dipelajari dalam kuliah Program disertai makalah singkat yang menggambarkan isinya Bonus nilai tambahan 10-20% akan diberikan jika disertai dengan file presentasi dalam MS PPT Tugas pengganti UAS dikumpulkan pada: Rabu, 19 Desember 2007 pukul 17:00 dalam bentuk softcopy-CD, secara kolektif melalui ketua Kelas atau diupload ke e-Course (masa aktif 13 – 19 Desember 2007 pkl. 17:00)


Download ppt "Chapter 13 (last) Recursion (Rekursi) Program S1-Ekstensi Departemen Teknik Elektro FTUI Slides ©2007."

Presentasi serupa


Iklan oleh Google