Analysis of Computer Algorithms

Slides:



Advertisements
Similar presentations
한양대학교 정보보호 및 알고리즘 연구실 이재준 담당교수님 : 박희진 교수님
Advertisements

2. Getting Started Heejin Park College of Information and Communications Hanyang University.
Data Structures Through C
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
Introduction to Algorithms 6.046J/18.401J
Introduction to Algorithms 6.046J/18.401J
Credit hours: 4 Contact hours: 50 (30 Theory, 20 Lab) Prerequisite: TB143 Introduction to Personal Computers.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
Comp 122, Spring 2004 Order Statistics. order - 2 Lin / Devi Comp 122 Order Statistic i th order statistic: i th smallest element of a set of n elements.
Computational Complexity, Choosing Data Structures Svetlin Nakov Telerik Corporation
Recurrences : 1 Chapter 3. Growth of function Chapter 4. Recurrences.
MANINDER KAUR Maninder Kaur 1
Capacity Planning For Products and Services
Squares and Square Root WALK. Solve each problem REVIEW:
Chapter 5 Test Review Sections 5-1 through 5-4.
Addition 1’s to 20.
25 seconds left…...
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Week 1.
We will resume in: 25 Minutes.
Program Efficiency & Complexity Analysis
What is an Algorithm? (And how do we analyze one?)
Chapter 3 Growth of Functions
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 2. Analysis of Algorithms - 1 Analysis.
Design and Analysis of Computer Algorithm Lecture 1 Assoc. Prof.Pradondet Nilagupta Department of Computer Engineering
Algorithms. Introduction The methods of algorithm design form one of the core practical technologies of computer science. The main aim of this lecture.
Design and Analysis of Algorithms
David Luebke 1 8/17/2015 CS 332: Algorithms Asymptotic Performance.
Instructor Neelima Gupta
CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a lgorithms.
Mathematics Review and Asymptotic Notation
1 Computer Algorithms Lecture 3 Asymptotic Notation Some of these slides are courtesy of D. Plaisted, UNC and M. Nicolescu, UNR.
Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 1 Prof. Charles E. Leiserson.
Algorithms Lecture 1. Introduction The methods of algorithm design form one of the core practical technologies of computer science. The main aim of this.
Introduction to Algorithms Lecture 1. Introduction The methods of algorithm design form one of the core practical technologies of computer science. The.
ECOE 456/556: Algorithms and Computational Complexity Lecture 1 Serdar Taşıran.
Complexity of Algorithms
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Algorithms & Flowchart
MS 101: Algorithms Instructor Neelima Gupta
MS 101: Algorithms Instructor Neelima Gupta
David Luebke 1 11/29/2015 CS 332: Algorithms Introduction Proof By Induction Asymptotic notation.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
David Luebke 1 1/6/2016 CS 332: Algorithms Asymptotic Performance.
1/6/20161 CS 3343: Analysis of Algorithms Lecture 2: Asymptotic Notations.
Asymptotic Performance. Review: Asymptotic Performance Asymptotic performance: How does algorithm behave as the problem size gets very large? Running.
Text Chapters 2 Analyzing Algorithms.  goal: predicting resources that an algorithm requires memory, communication bandwidth, hardware, memory, communication.
CSC 413/513: Intro to Algorithms Introduction Proof By Induction Asymptotic notation.
Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 1 Prof. Charles E. Leiserson.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
1.  A step by step process to solve any problem is called algorithm.  Algorithm is a process which take some values as input and provide us output.
CIS 313: Analysis and Design of Algorithms Assoc. Prof Hassan Aly Department of Computer Science and Information College of Science at AzZulfi Al-Majmaah.
Algorithm Complexity is concerned about how fast or slow particular algorithm performs.
Design and Analysis of Computer Algorithm Lecture 1.
Advanced Algorithms Analysis and Design
Introduction to Algorithms
Big-O notation.
Introduction to Algorithms
Algorithms Furqan Majeed.
Objective of This Course
CSC 413/513: Intro to Algorithms
Introduction to Algorithms Analysis
Asst. Dr.Surasak Mungsing
Algorithms Presented By:- Mr. Anup Ashok Shinde BBA (C.A) Dept.
Presentation transcript:

Analysis of Computer Algorithms

What is Algorithm? Algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. is thus a sequence of computational steps that transform the input into the output. is a tool for solving a well - specified computational problem. Design and Analysis of Computer Algorithm Saturday, March 25, 2017

What is a program? A program is the expression of an algorithm in a programming language a set of instructions which the computer will follow to solve a problem Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Some Application Various Algorithmic techniques can be applied to sorting data retrieval network routing Games etc Design and Analysis of Computer Algorithm Saturday, March 25, 2017

The study of Algorithm How to devise algorithms How to express algorithms How to validate algorithms How to analyze algorithms How to test a program Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Importance of Analyze Algorithm Need to recognize limitations of various algorithms for solving a problem Need to understand relationship between problem size and running time Need to learn techniques for writing more efficient code Need to recognize bottlenecks in code as well as which parts of code are easiest to optimize Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Why do we analyze them? understand their behavior, and (Job -- Selection, performance, modify) improve them. (Research) Design and Analysis of Computer Algorithm Saturday, March 25, 2017

What do we analyze about them? Correctness Does the input/output relation match algorithm requirement? Amount of work done (aka complexity) Basic operations to do task Amount of space used Memory used Design and Analysis of Computer Algorithm Saturday, March 25, 2017

What do we analyze about them? Simplicity, clarity Verification and implementation. Optimality Is it impossible to do better? Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Complexity The complexity of an algorithm is simply the amount of work the algorithm performs to complete its task. Design and Analysis of Computer Algorithm Saturday, March 25, 2017

RAM model has one processor executes one instruction at a time each instruction takes "unit time“ has fixed-size operands, and has fixed size storage (RAM and disk). Design and Analysis of Computer Algorithm Saturday, March 25, 2017

What’s more important than performance? Modularity Extensibility Correctness Reliability Maintainability Functionality Robustness User-friendliness Programmer time Simplicity Design and Analysis of Computer Algorithm Saturday, March 25, 2017

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. Performance is the currency of computing. The lessons of program performance generalize to other computing resources. Speed is fun! Design and Analysis of Computer Algorithm Saturday, March 25, 2017

What is Algorithm Analysis? How to estimate the time required for an algorithm Techniques that drastically reduce the running time of an algorithm A mathemactical framwork that more rigorously describes the running time of an algorithm Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Algorithm Analysis(1/4) Measures the efficiency of an algorithm or its implementation as a program as the input size becomes very large We evaluate a new algorithm by comparing its performance with that of previous approaches We usually analyze the time required for an algorithm and the space required for a datastructure Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Algorithm Analysis (2/4) Many criteria affect the running time of an algorithm, including speed of CPU, bus and peripheral hardware design think time, programming time and debugging time language used and coding efficiency of the programmer quality of input (good, bad or average) Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Algorithm Analysis (3/4) Programs derived from two algorithms for solving the same problem should both be Machine independent Language independent Environment independent (load on the system,...) Realistic Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Algorithm Analysis (4/4) Formally, let T(A,L,M) be total run time for algorithm A if it were implemented with language L on machine M. Then the complexity class of algorithm A is: O(T(A,L,M) Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Asymptotic Performance In this course, we also care about asymptotic performance How does the algorithm behave as the problem size gets very large? Running time Memory/storage requirements Bandwidth/power requirements/logic gates/etc. Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Asymptotic Notation By now you should have an intuitive feel for asymptotic (big-O) notation: What does O(n) running time mean? O(n2)? O(n lg n)? Our first task is to define this notation more formally and completely O(g(n)) = { f(n) :  positive constants c and n0, we have 0  f(n)  cg(n) } Intuitively: Set of all functions whose rate of growth is the same as or lower than that of g(n). Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Analysis of Algorithms Analysis is performed with respect to a computational model We will usually use a generic uniprocessor random-access machine (RAM) All memory equally expensive to access No concurrent operations All reasonable instructions take unit time Except function calls Constant word size Unless we are explicitly manipulating bits Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Input Size Time and space complexity This is generally a function of the input size E.g., sorting, multiplication How we characterize input size depends: Sorting: number of input items Multiplication: total number of bits Graph algorithms: number of nodes & edges Etc Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Running Time Number of primitive steps that are executed Except for time of executing a function call most statements roughly require the same amount of time y = m * x + b c = 5 / 9 * (t - 32 ) z = f(x) + g(y) Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Provides an upper bound on running time Analysis Worst case Provides an upper bound on running time Average case Provides the expected running time Design and Analysis of Computer Algorithm Saturday, March 25, 2017

Function of Growth rate Design and Analysis of Computer Algorithm Saturday, March 25, 2017