Professional Documents
Culture Documents
Develop skills needed for at designing correct and efficient algorithms Gain familiarity with a number of classical problems that occur frequently in real-world applications. Inculcate skills to understand mathematical notations in algorithms and their simple mathematical proofs, particularly inductive proofs Understand basic data structures and to use them in algorithms
Grading
Your final grade in the course will be determined by the following scheme:
Final exam Two sessional exams Homework + quizzes : : : 50% 30% 20%
Textbooks
Advised:
Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 2nd Edition, The MIT Press, 2001. Brassard & Bratley, Fundamentals of Algorithmics, Prentice-Hall International, 1999.
ALGORITHM
A statement of the steps to be followed in performing a task or solving a problem. In a computer program the steps of an algorithm are specified in a specific computer language. Each step is written on a new line and stated as briefly as possible
input or output
decision
connector
END
START
A
read holiday leaflet NO is it in July? YES NO is the cost less than RS 8000? YES has he been before? NO accept holiday Reject holiday YES
END
replace receiver
NO
A
YES
Number unobtainable?
NO YES engaged?
is someone answering?
NO
wait
NO waiting long enough? YES
NO
insert money
continued
A
NO
right number?
NO
have conversation
replace receiver
END
PROBABILISITIC ALGORITHM
In this algorithm, chosen values are used in such a way that the probability of chosen each value is known and controlled For example chosen a number between 1 and 6
APPROXIMATE ALGORITHM
In this algorithm, answer is obtained that is as prcised as required in decimal notation. In other words it specifies the error we are willing to accept For example, two figures accuracy or 8 figures or whatever is required
HEURISTIC ALGORITHM
This type of algorithm is based largely on optimism and often with minimal theoretical support. Here error can not be controlled but may be estimated how large it is.
ALGORITHMICS
It is the science that lets designers study and evaluate the effect of algorithms based on various factors so that the best algorithm is selected to meet a particular task in given circumstances. It is also the science that tells how to design a new algorithm for a particular job.
(981 x 1234)
981 1234 3924 2943 1962 981 1210554
American
Shift 4 2 2 0
MULTIPLICATION (9 x 12)
(Divide-and-Conquer Algorithm)
Shift 2 1 1 0
A good choice can save both money and time, and can successfully solve the problem
NOTATION OF PROGRAMS
No need of well-structured language English phrases are used for simplicity and clarity Mathematical language is used whenever appropriate Algorithm needs effort to transcribe steps into a computer programming language
NOTATION OF PROGRAMS
For simplicity: Declarations are omitted All variables used in functions or procedures are implicitly understood as local variable unless the context makes it clear otherwise
NOTATION OF PROGRAMS
Scalar Array parameters parameters (treated are as local by variable) are passed by value passed reference
MATHEMATICAL NOTATIONS
Propositional Calculus (i) Conjunction (ii) Disjunction (iii) Negation true if p is false (iv) p q (if p then q) (p = q) (v) p q p q ( p and q) p V q ( p or q) (not p) ( p) true if both p & q are true true if at least one of p or q is true