1 / 13 Lecture 1 Design and Analysis of Algorithms
Introduction and History
Algorithm : Means to solve a problem
Antiquity : Euclid described how to find the Greatest Common Divisor of two numbers. Archimede computed π with an arbitrary precision. Muhamed Ibn Al Khou Warizmi: Decimal representation and computation rules . Exercise : Give some examples of algorithm in your daily life.
2 / 13 Lecture 1 Design and Analysis of Algorithms
Human vs Computer
Tedious execution of algorithm by a human being
⇒ repetitive rules ⇒ large number of steps Computers have boost the development of algorithmics. At the same time we have to worry about: Running time of the algorithm The efficiency of the algorithm difficulty of the problem to be solve.
3 / 13 Lecture 1 Design and Analysis of Algorithms
Specification of an Algorithm
An algorithm constructs a solution from input data.
There is an automatic execution. No Ambiguity of rules (⇒Semantics). The input of an algorithm has to be well defined and finite. an algorithm can be considered as a sequence of operations on a string of symbols (Turing Machine). Automata. There is No particular language attached to an algorithm.
4 / 13 Lecture 1 Design and Analysis of Algorithms
Algorithms vs Programs
A program is written in a particular programming language (
C++, C, Java, LISP, Pascal,ADA etc.) and is executed on a computer which has a memory. Are all algorithm computable? The answer is unknown. . .
5 / 13 Lecture 1 Design and Analysis of Algorithms
Partial vs Total Correction
⇒ Partial Correction: Verifies if the algorithm solves the
problem ⇒ Total correction: verifies if the algorithms solves the problem and if it ends in finite time.
6 / 13 Lecture 1 Design and Analysis of Algorithms
What is this course about?
Find ways to organize information in order to enable efficient
computation. Which are those ways? what do we mean by efficient?
7 / 13 Lecture 1 Design and Analysis of Algorithms
What is an efficient algorithm?
easy to read and to understand .
use reasonable space for storage. spend as little as possible time for its execution.
8 / 13 Lecture 1 Design and Analysis of Algorithms
Why this course?
Efficient algorithms lead to efficient programs
Efficient programs are well marketable With efficient program there is optimal use of hardware.
9 / 13 Lecture 1 Design and Analysis of Algorithms
Factors that influence program efficiency are
Problem being solved
Programming language Compiler Computer hardware Programmer ability Algorithm.
10 / 13 Lecture 1 Design and Analysis of Algorithms
Specific Goals of the course
Become familiar with some fundamental algorithms.
Improve ability to solve problem abstractly Improve ability to analyze your algorithms prove of correctness gauge (and improve ) time complexity.
11 / 13 Lecture 1 Design and Analysis of Algorithms
Algorithm Analysis
To predict the amount of resource required in respect to the size of
the input, we have to evaluate some quantity. time ( more often)- counting of elementary operations. storage There are different types of Analysis: Given an algorithm on data of size n: Worst-case cost : is the the maximum of costs, on all the data with size n. Average-case cost : is the average of costs, on all the data with size n. best-case cost : is the minimum of costs, on all the data with size n.
12 / 13 Lecture 1 Design and Analysis of Algorithms
Your To do List
Read pages 5 to 24 of the following book
Wilf H.S, Algorithms and Complexity.
13 / 13 Lecture 1 Design and Analysis of Algorithms