Algorithms. Introduction The methods of algorithm design form one of the core practical technologies of computer science. The main aim of this lecture.

Slides:



Advertisements
Presentasi serupa
Aryo Pinandito, ST, M.MT - PTIIK UB
Advertisements

Modul-8 : Algoritma dan Struktur Data
Pertemuan 3 LINKED LIST (PART 2) Struktur Data Departemen Ilmu Komputer FMIPA-IPB 2009.
2. Introduction to Algorithm and Programming
Validitas & Reliabilitas
Game Theory Purdianta, ST., MT..
Desain dan Analisis Algoritma
TEKNIK PENGINTEGRALAN
1 DATA STRUCTURE “ STACK” SHINTA P STMIK MDP APRIL 2011.
BLACK BOX TESTING.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
1 Pertemuan 09 Kebutuhan Sistem Matakuliah: T0234 / Sistem Informasi Geografis Tahun: 2005 Versi: 01/revisi 1.
1 Pertemuan 21 Function Matakuliah: M0086/Analisis dan Perancangan Sistem Informasi Tahun: 2005 Versi: 5.
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
Pertemuan 07 Peluang Beberapa Sebaran Khusus Peubah Acak Kontinu
HAMPIRAN NUMERIK SOLUSI PERSAMAAN NIRLANJAR Pertemuan 3
Dr. Nur Aini Masruroh Deterministic mathematical modeling.
1 HAMPIRAN NUMERIK SOLUSI PERSAMAAN LANJAR Pertemuan 5 Matakuliah: K0342 / Metode Numerik I Tahun: 2006 TIK:Mahasiswa dapat meghitung nilai hampiran numerik.
1 Pertemuan 11 Function dari System Matakuliah: M0446/Analisa dan Perancangan Sistem Informasi Tahun: 2005 Versi: 0/0.
1 Pertemuan 13 Algoritma Pergantian Page Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Bayu Priyambadha, S.Kom.  Classes, which are the "blueprints" for an object and are the actual code that defines the properties and methods.  Objects,
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
Comparative Statics Slutsky Equation
Keuangan dan Akuntansi Proyek Modul 2: BASIC TOOLS CHRISTIONO UTOMO, Ph.D. Bidang Manajemen Proyek ITS 2011.
KOMUNIKASI DATA Materi Pertemuan 8.
DISTRIBUSI BINOMIAL.
KOMUNIKASI DATA Materi Pertemuan 3.
07/11/2017 BARISAN DAN DERET KONSEP BARISAN DAN DERET 1.
Notasi Object Oriented System
CSG523/ Desain dan Analisis Algoritma
Recurrence relations.
Rekayasa Perangkat Lunak Class Diagram
Branch and Bound Lecture 12 CS3024.
Cartesian coordinates in two dimensions
Cartesian coordinates in two dimensions
GROUP 12: ARINI NUROTUL HUDA
CSG523/ Desain dan Analisis Algoritma
Pengujian Hipotesis (I) Pertemuan 11
CLASS DIAGRAM.
BY EKA ANDRIANI NOVALIA RIZKANISA VELA DESTINA
Software Engineering Rekayasa Perangkat Lunak
SKOPE EKONOMI POLITIK DAN PEMBANGUNAN
CSG3F3/ Desain dan Analisis Algoritma
BILANGAN REAL BILANGAN BERPANGKAT.
Algorithms and Programming Searching
REAL NUMBERS EKSPONENT NUMBERS.
Desain dan Analisis Algoritma
Kk ilo Associative entity.
THE EFFECT OF COOPERATIVE LEARNING TYPE JIGSAW PROBLEM SOLVING
Pertemuan 4 CLASS DIAGRAM.
Analisis Korelasi dan Regresi Berganda Manajemen Informasi Kesehatan
How Can I Be A Driver of The Month as I Am Working for Uber?
Things You Need to Know Before Running on the Beach.
How to Pitch an Event
Grow Your Social Media Communities
Don’t Forget to Avail the Timely Offers with Uber
Simultaneous Linear Equations
Desain & Analisis Algoritma
By Yulius Suprianto Macroeconomics | 02 Maret 2019 Chapter-5: The Standard of Living Over Time and A Cross Countries Source: http//
BAB 9 TEORI PRODUKSI. 2 Introduction Our focus is the supply side. The theory of the firm will address: How a firm makes cost-minimizing production decisions.
Right, indonesia is a wonderful country who rich in power energy not only in term of number but also diversity. Energy needs in indonesia are increasingly.
Website: Website Technologies.
Al Muizzuddin F Matematika Ekonomi Lanjutan 2013
Rank Your Ideas The next step is to rank and compare your three high- potential ideas. Rank each one on the three qualities of feasibility, persuasion,
Vector. A VECTOR can describe anything that has both MAGNITUDE and DIRECTION The MAGNITUDE describes the size of the vector. The DIRECTION tells you where.
HANDLING RUSH PRESIDENT UNIVERSITY NURLAELA RIZKINA.
Draw a picture that shows where the knife, fork, spoon, and napkin are placed in a table setting.
2. Discussion TASK 1. WORK IN PAIRS Ask your partner. Then, in turn your friend asks you A. what kinds of product are there? B. why do people want to.
Wednesday/ September,  There are lots of problems with trade ◦ There may be some ways that some governments can make things better by intervening.
Transcript presentasi:

Algorithms

Introduction The methods of algorithm design form one of the core practical technologies of computer science. The main aim of this lecture is to familiarize the student with the framework we shall use through the course about the design and analysis of algorithms. We start with a discussion of the algorithms needed to solve computational problems. The problem of sorting is used as a running example. We introduce a pseudocode to show how we shall specify the algorithms.

Algorithms Algorithms The word algorithm comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi. In computer science, this word refers to a special method useable by a computer for solution of a problem. The statement of the problem specifies in general terms the desired input/output relationship. For example, sorting a given sequence of numbers into nondecreasing order provides fertile ground for introducing many standard design techniques and analysis tools.

The problem of sorting

Insertion Sort

Example of Insertion Sort

Analysis of algorithms The theoretical study of computer-program performance and resource usage. What’s more important than performance? modularity correctness maintainability functionality robustness user-friendliness programmer time simplicity extensibility reliability

Analysis of algorithms Why study algorithms and performance? Algorithms help us to understand scalability. Performance often draws the line between what is feasible and what is impossible. Algorithmic mathematics provides a language for talking about program behavior. The lessons of program performance generalize to other computing resources. Speed is fun!

Running Time The running time depends on the input: an already sorted sequence is easier to sort. Parameterize the running time by the size of the input, since short sequences are easier to sort than long ones. Generally, we seek upper bounds on the running time, because everybody likes a guarantee.

Kinds of analyses Worst-case: (usually) T(n) = maximum time of algorithm on any input of size n. Average-case: (sometimes) T(n) = expected time of algorithm over all inputs of size n. Need assumption of statistical distribution of inputs. Best-case: Cheat with a slow algorithm that works fast on some input.

Machine-Independent time The RAM Model Machine independent algorithm design depends on a hypothetical computer called Random Acces Machine (RAM). Assumptions: Each simple operation such as +, -, if...etc takes exactly one time step. Loops and subroutines are not considered simple operations. Each memory acces takes exactly one time step.

Machine-independent time What is insertion sort’s worst-case time? It depends on the speed of our computer, relative speed (on the same machine), absolute speed (on different machines). BIG IDEA: Ignore machine-dependent constants. Look at growth of “Asymptotic Analysis”

Machine-independent time: An example A pseudocode for insertion sort ( INSERTION SORT ). INSERTION-SORT(A) 1 for j  2 to length [A] 2 do key  A[ j] 3  Insert A[j] into the sortted sequence A[1,..., j-1]. 4 i  j – 1 5 while i > 0 and A[i] > key 6 do A[i+1]  A[i] 7 i  i – 1 8 A[i +1]  key

Analysis of INSERTION-SORT(contd.)

The total running time is

Analysis of INSERTION-SORT(contd.) The best case: The array is already sorted. (t j =1 for j=2,3,...,n)

Analysis of INSERTION-SORT(contd.) The worst case: The array is reverse sorted (t j =j for j=2,3,...,n).

Growth of Functions Growth of Functions Although we can sometimes determine the exact running time of an algorithm, the extra precision is not usually worth the effort of computing it. For large inputs, the multiplicative constants and lower order terms of an exact running time are dominated by the effects of the input size itself.

Asymptotic Notation Asymptotic Notation The notation we use to describe the asymptotic running time of an algorithm are defined in terms of functions whose domains are the set of natural numbers

O-notation For a given function, we denote by the set of functions We use O-notation to give an asymptotic upper bound of a function, to within a constant factor. means that there existes some constant c s.t. is always for large enough n.

Ω-Omega notation For a given function, we denote by the set of functions We use Ω-notation to give an asymptotic lower bound on a function, to within a constant factor. means that there exists some constant c s.t. is always for large enough n.

-Theta notation For a given function, we denote by the set of functions A function belongs to the set if there exist positive constants and such that it can be “sand- wiched” between and or sufficienly large n. means that there exists some constant c 1 and c 2 s.t. for large enough n.

Asymptotic notation Graphic examples of and.

Example 1. Show that We must find c 1 and c 2 such that Dividing bothsides by n 2 yields For

Theorem For any two functions and, we have if and only if

Because : Example 2.

Example 3.

Standard notations and common functions Floors and ceilings

Standard notations and common functions Logarithms:

Standard notations and common functions Logarithms: For all real a>0, b>0, c>0, and n

Standard notations and common functions Logarithms:

Standard notations and common functions Factorials For the Stirling approximation: