Unformatted text preview:

IE172 – Algorithms in Systems EngineeringLecture 1Pietro BelottiDepartment of Industrial & Systems EngineeringLehigh UniversityJanuary 12, 2009Class Overview◮Meeting Times: Mon/Wed/Fri 9:10am-10am, Mohler 453◮Office Hours:◮Monday and Wednesday 3pm-5pm, or◮by appointment (610-7 58-3865)Course page:http://coral.ie.lehigh.edu/˜belotti/?page id=44Labs and Problems Sets◮Labs on Tuesday from 1:10pm to 4pm.◮One lab per w eek, one problem set p er week – usuallyrelated to (or a con tinuation of) the lab◮Problem sets to be turned in by Friday that week◮50% Grade penalty for every late day. No exception.GradingProblem sets: 25%Lab: 25%Midterm: 20%Final exam: 30%Topics◮Introduction to A lgorithm Analysis◮Sorting and Searching◮Graph A lgorithms◮Numerical AlgorithmsCourse Objectives◮Basic p r inciples of algorithm design, especially forapplications in Systems Engineering◮Understand basic techniques for analyzing theperformance of algorithms◮Understand the importance of implementing algorithmsefficiently and the skills necessary for doing so◮Develop an ability to solve systems engineering problemsby designing and implementing an appropriate algorithm◮Sharpen and extend comp uting and programming skillsGreat ExpectationsI am expected to...◮Teach◮Answer y our questions◮Be at my office hours◮Give you feedback on how you are doingYou are expected to...◮Learn◮Attend lectures and participate◮Do the labs and problem sets◮Not be rude, if possible.◮Sleeping◮Leaving in the middle of lecture◮Cell phones, talkingAn Interesting QuoteEmeril—The A lgorithm Maker“Here is you r book, the one your th ousands of letter haveasked us to publish. It has taken us years to do, checking andrechecking countless recipes to bring you only the best, onlythe interesting, only the perfect. Now we can say, withouta shadow of a doubt, that every single one of them, if youfollow the directions to the letter, will work for you exactlyas it did for us, even if you have never cooked before.”–McCall’s Cookbook (1963)A Brief History of Algorithms◮According to the Oxford English Dictionary, the wordalgorithm is a combination of the Middle English wordalgorism with arithmetic.◮This word probably did not enter common usage in theEnglish language until sometime last century.◮The w ord algorism derives from the name of an Arabicmathematician circa A.D. 825, whose surname wasAl-Khwarizmi.◮Al-Khwarizmi w rote a book on solving equations fromwhose title the wordalgebra derives.The First Algorithm◮It is commonly believed that the first algorithm wasEuclid’s Algorithm for finding the greatest commondivisor of two integers, m and n, (m ≥ n).Euclid’s Algorithm(m, n)◮Divide m by n and let r be the remainder.◮If r = 0, then gcd(m, n) = n.◮Otherwise, gcd (m, n) = gcd(n, r)Show Me the Algorithms◮Algorithms are literally everywhere you look.◮What are some common applications of algorithms?◮Sorting numbers◮Searching for matching strings (DNA – Human Genome)◮Solving equations (Numerical Linear Algebra)◮Internet security – Public Key Cryptography◮Why is it important that algorithms ex ecute quickly?What is a Problem?◮Roughly, a problem spe cifies what set of outputs is desiredfor each given set of inputs.◮A problem instance is just a specific set of inputs.Example: The Sorting Problem◮Input: A sequence of numbers a1, a2, . . . , an◮Output: A reordering a′1, a′2, . . . , a′nsuch thata′1≤ a′2≤ · · · ≤ a′n.What Do You Mean By “S olve”?◮Solving a problem instance consists of specifying aprocedure for converting t h e inputs to an output of thedesired form (called a solution).◮An algorithm that is guaranteed to result in a solution forevery instance is said to becorrect.◮In this class, w e study (formally) how to prove that analgorithm is correct.◮We also study how to formally characterize (analytically)the amount of effort required to produce a solut ion.Aside: Pseudo-code◮The book uses pseudo-code to specify algorithms.(syntax similar to Java)◮The pseudo-code used in lecture may differ from that inthe bo ok. (I may use more C++ syntax)◮Check the book for a detailed list of its pse udo-codeconventions.Another Example: Fibonacci Numbers◮Another simple example of t h e importance of efficientalgorithms arises in the calculation ofFibonacci numbers.◮Fibonacci numbers arise in pop ulation genetics, as well asa ho st of other app lications. (Including the analysis ofEuclid’s Algorithm!)◮The nthFibonacci number is defined recursively as follows:F(0) = 0,F(1) = 1,F(n) = F(n − 1) + F(n − 2) ∀n ∈ N, n > 2.◮How do we calculate F(n) for a given n ∈ N?Calculating Fibonacci Numbers◮Obvious Solution: A recursive function Fib()int Fib (int n) {if (n == 0) return 0;else if (n == 1) return 1;else return (Fib (n-1) + Fib (n-2));}Answering Some Questions◮How efficient is the recursive form of Fib()?◮We will be able to answer this (analytically) by the end ofthe course.◮We will answer it empirically in lab.◮Is there a more efficient algorithm?◮You will work on it in the lab.What is a Data Structure?◮Computers operate on tables of numbers (the data).◮Within t h e context of solving a given problem, this datamay havestructure.◮Data structures allow us to perform certain operations o nthe data more easily.◮Example: look up a phone number in the phone book.◮The data structure that is most appropriate depends on theproblem and on how the algorithm manipulates the data.⇒ Data structure and algorithm depend on each ot h erImportance of D ata Structures◮Specifying an algorithm comp letely includes specifyingthe data structures to be used (sometimes th is is thehardest part).◮It is possible for the same basic algorithm to have severaldifferent implementations with different data structures.◮Which data structure is best depen ds on what operationshave to be performed on the data.Summing Up◮Algorithms that are both efficient and correct are atechnology that must be developed.◮Data structures allow us to represent relationshipsbetween various data and allow us to manipulate themeffectively within an algorithm.◮Efficient algorithms enable us to solve important problemsmore quickly, which is critical for many applications.What’s next?◮Read: CLRS Appendix A, B, and C.◮Read: CLRS Chapter 1, 2 and 10.◮Some basic sorting algorithms and introduction to


View Full Document

Clemson IE 172 - Lecture 1

Download Lecture 1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?