5/15/2015COT 54071 COT 5407: Introduction to Algorithms Tao Li ECS 318; Phone: x6036

Slides:



Advertisements
Similar presentations
MATH 224 – Discrete Mathematics
Advertisements

Analysis & Design of Algorithms (CSCE 321)
Jan Welcome to the Course of Advanced Algorithm Design (ACS-7101/3)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2009 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Th. 9/3/2009.
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 1 Introduction/Overview Wed. 9/5/01.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2005 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 9/7/05.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Design and Analysis of Algorithms - Chapter 11 Algorithm An algorithm is a.
TK3043 Analysis and Design of Algorithms Introduction to Algorithms.
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Nattee Niparnan Dept. of Computer Engineering, Chulalongkorn University.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
CS Algorithm Analysis1 Algorithm Analysis - CS 312 Professor Tony Martinez.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
CSCE350: Data Structures and Algorithms Instructor: Dr. Jianjun Hu Fall Department of Computer Science and Engineering.
Analysis of Algorithms
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
Analyzing algorithms & Asymptotic Notation BIO/CS 471 – Algorithms for Bioinformatics.
A Lecture /24/2015 COSC3101A: Design and Analysis of Algorithms Tianying Ji Lecture 1.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
1Computer Sciences Department. Book: Introduction to Algorithms, by: Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Electronic:
Lecture 3 Analysis of Algorithms, Part II. Plan for today Finish Big Oh, more motivation and examples, do some limit calculations. Little Oh, Theta notation.
Copyright © 2007 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction.
Design and Analysis of Algorithms - Chapter 11 Algorithm b An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining.
1 BIM304: Algorithm Design Time: Friday 9-12am Location: B4 Instructor: Cuneyt Akinlar Grading –2 Midterms – 20% and 30% respectively –Final – 30% –Projects.
Algorithm Analysis Part of slides are borrowed from UST.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3 rd ed., Ch. 1 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Design and Analysis of Algorithms (09 Credits / 5 hours per week) Sixth Semester: Computer Science & Engineering M.B.Chandak
CS 150: Analysis of Algorithms. Goals for this Unit Begin a focus on data structures and algorithms Understand the nature of the performance of algorithms.
Copyright © 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin “ Introduction to the Design & Analysis of Algorithms, ” 2 nd ed., Ch. 1 Chapter.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
Lecture # 1 Introduction Analysis of Algorithm by Qamar Abbas Analysis of Algorithms.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
Design and Analysis of Algorithms Introduction Instructors:1. B V Kiran Mayee, 2. A Madhavi
Algorithms Design and Analysis CS Course description / Algorithms Design and Analysis Course name and Number: Algorithms designs and analysis –
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
MA/CSSE 473 Day 12 Amortization (growable Array) Knuth interview Brute Force Examples.
RAIK 283 Data Structures and Algorithms
Design and Analysis of Algorithms
Advanced Algorithms Analysis and Design
Welcome to the Course of Advanced Algorithm Design
Design and Analysis of Algorithms (09 Credits / 5 hours per week)
TK3043 Analysis and Design of Algorithms
Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/28/04
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
ICE 245: Algorithms Instructor: Dr. Mohammad Arifuzzaman
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
CS 583 Fall 2006 Analysis of Algorithms
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
Design and Analysis of Algorithms (07 Credits / 4 hours per week)
アルゴリズムの設計と解析 教授: 黄 潤和 (W4022) SA: 広野 史明 (A4/A10)
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Objective of This Course
CMPT 438 Algorithms Instructor: Tina Tian.
Design and Analysis of Algorithms
INTRODUCTION TO ALOGORITHM DESIGN STRATEGIES
Department of Computer Science & Engineering
Design and Analysis of Algorithms (04 Credits / 4 hours per week)
Design and Analysis of Algorithms
COMP 122 – Design and Analysis of Algorithms
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Advanced Analysis of Algorithms
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Presentation transcript:

5/15/2015COT COT 5407: Introduction to Algorithms Tao Li ECS 318; Phone: x6036

8/28/07COT Why should I care about Algorithms? Cartoon from Intractability by Garey and Johnson

8/28/07COT More questions you should ask Who should know about Algorithms? Is there a future in this field? Would I ever need it if I want to be a software engineer or work with databases?

8/28/07COT Why are theoretical results useful? Cartoon from Intractability by Garey and Johnson

8/28/07COT Why are theoretical results useful? Cartoon from Intractability by Garey and Johnson

5/15/2015COT Self-Introduction Ph.D. in Computer Science from University of Rochester, 2004 –Research Interests: data mining, machine learning, information retrieval, bioinformatics and more ? Associate Professor in the School of Computer Science at Florida International University Industry Experience: –Summer internships at Xerox Research (summer 2001, 2002) and IBM Research (Summer 2003, 2004)

5/15/2015COT Student Self-Introduction Name –I will try to remember your names. But if you have a Long name, please let me know how should I call you Major and Academic status Programming Skills –Java, C/C++, VB, Matlab, Scripts etc. Research Interest Anything you want us to know

5/15/2015COT What this course is about Introduction to Algorithms Analysis of Algorithms How does one design programs and ascertain their efficiency? Divide-and-conquer techniques, string processing, graph algorithms, mathematical algorithms. Advanced data structures such as balanced tree schemes.

5/15/2015COT Course Logistics Meeting Time and Location: Tuesday and Thursday 17:00pm-18:15pm, ECS134 Office Hours: Tuesday and Thursday 14:30pm-15:30pm TA: Yali Wu Textbook: Introduction to Algorithms, (Third Edition) Thomas Cormen, Charles Leiserson, Ronald Rivest, and Clifford Stein. MIT Press.

5/15/2015COT Evaluation Class participation and Quizzes: 10% Midterm Exam: 30% Final Exam: 30% Assignments:30% You may work with one other person on homeworks, but you must each write up your solutions separately. If you work with another person, indicate who you worked with on your solution. Please start a new page for each problem on your solutions, and include your name on each page, so the TA can choose the problems for grading. Exams are open/closed book ??

Algorithm A computational problem is a mathematical problem, specified by an input/output relation. An algorithm is a computational procedure for solving a computational problem. 5/15/2015COT “computer” problem algorithm inputoutput

1-12 Some Well-known Computational Problems Sorting Searching Shortest paths in a graph Minimum spanning tree Primality testing Traveling salesman problem Knapsack problem Chess Towers of Hanoi Program termination

8/28/07COT History of Algorithms The great thinkers of our field: Euclid, 300 BC Bhaskara, 6 th century Al Khwarizmi, 9th century Fibonacci, 13 th century Babbage, 19 th century Turing, 20 th century von Neumann, Knuth, Karp, Tarjan, …

8/28/07COT Euclid’s Algorithm GCD(12,8) = 4; GCD(49,35) = 7; GCD(210,588) = ?? GCD(a,b) = ?? Observation: [a and b are integers and a  b] –GCD(a,b) = GCD(a-b,b) Euclid’s Rule: [a and b are integers and a  b] –GCD(a,b) = GCD(a mod b, b) Euclid’s GCD Algorithm: –GCD(a,b) If (b = 0) then return a; return GCD(a mod b, b)

1-15 Basic Issues Related to Algorithms How to design algorithms How to express algorithms Proving correctness Efficiency –Theoretical analysis –Empirical analysis Optimality

1-16 Algorithm design strategies Brute force Divide and conquer Decrease and conquer Transform and conquer Greedy approach Dynamic programming Backtracking Branch and bound Space and time tradeoffs

1-17 Analysis of Algorithms How good is the algorithm? –Correctness –Time efficiency: amount of work done –Space efficiency: amount of space used –Simplicity, clarity Does there exist a better algorithm? –Lower bounds –Optimality

5/15/2015COT Correctness Proving correctness is dreadful for large algorithms. A strategy that can be used is: divide the algorithm into smaller pieces, and then clarify what the preconditions and postconditions are and prove correct assuming everything else is correct.

5/15/2015COT Amount of Work Done Rather than counting the total number of instructions executed, we'll focus on a set of key instructions and count how many times they are executed. Use asymptotic notation and pay attention only to the largest growing factor in the formula of the running time. Two major types of analysis: worst-case analysis and average- case analysis

5/15/2015COT More Amount of space used: The amount of space used can be measured similarly. Consideration of this efficiency is often important. Simplicity, clarity: Sometimes, complicated and long algorithms can be simplified and shortened by the use of recursive calls. Optimality: For some algorithms, you can argue that they are the best in terms of either amount of time used or amount of space used. There are also problems for which you cannot hope to have efficient algorithms.

5/15/2015COT Asymptotic Growth Rates of Functions Big O Big Omega Little O Little Omega Theta Notation

5/15/2015COT Notations

5/15/2015COT Other mathematical background The ceiling function The floor function The exponentials and logarithms Fibonacci number Summations and Series

Why study algorithms? Theoretical importance –the core of computer science Practical importance –A practitioner’s toolkit of known algorithms –Framework for designing and analyzing algorithms for new problems

Two main issues related to algorithms How to design algorithms How to analyze algorithm efficiency

1-26 Algorithm design strategies Brute force Divide and conquer Decrease and conquer Transform and conquer Greedy approach Dynamic programming Backtracking Branch and bound Space and time tradeoffs

Analysis of algorithms How good is the algorithm? –time efficiency –space efficiency Does there exist a better algorithm? –lower bounds –optimality

1-28 Important problem types sorting searching string processing graph problems combinatorial problems geometric problems numerical problems

1-29 Fundamental data structures list –array –linked list –string stack queue, priority queue Graph Tree set and dictionary

5/15/2015COT Search You are asked to guess a number X that is known to be an integer lying between integers A and B. How many guesses do you need in the worst case? –Number of guesses = log 2 (B-A) You are asked to guess a positive integer X. How many guesses do you need in the worst case? –NOTE: No upper bound B is known for the number.

5/15/2015COT Search You are asked to guess a number X that is known to be an integer lying between integers A and B. How many guesses do you need in the worst case? –Number of guesses = log 2 (B-A) You are asked to guess a positive integer X. How many guesses do you need in the worst case? –NOTE: No upper bound B is known for the number. –Algorithm: figure out B (by using Doubling Search) perform binary search in the range B/2 through B. –Number of guesses = log 2 B + log 2 (B – B/2) –Since X is between B/2 and B, we have: log 2 (B/2) < log 2 X, –Number of guesses < 2log 2 X - 1

5/15/2015COT Polynomials Given a polynomial –p(x) = a 0 + a 1 x + a 2 x 2 + … + a n-1 x n-1 + a n x n compute the value of the polynomial for a given value of x. How many additions and multiplications are needed? –Simple solution: Number of additions = n Number of multiplications = … + n = n(n+1)/2 –Improved solution using Horner’s rule:

5/15/2015COT Polynomials Given a polynomial –p(x) = a 0 + a 1 x + a 2 x 2 + … + a n-1 x n-1 + a n x n compute the value of the polynomial for a given value of x. How many additions and multiplications are needed? –Simple solution: Number of additions = n Number of multiplications = … + n = n(n+1)/2 –Improved solution using Horner’s rule: p(x) =p(x) = a 0 + x(a 1 + x(a 2 + … x(a n-1 + x a n ))…)) Number of additions = n Number of multiplications = n