180 likes | 484 Views
Welcome to Introduction to Algorithms, Fall 2008. Registration (DCP 1596) Staff Lecturer: Prof. 陳健 (Chien Chen), EC125B, x31768, chienchen@cs.nctu.edu.tw. TAs 張哲維 (Alan Chang) & 陳盈羽 (Ying-Yu Chen), EECS701, x56667-16 Website http://w2cn.cis.nctu.edu.tw/New/Course.htm Handouts
E N D
Welcome to Introduction to Algorithms, Fall 2008 • Registration (DCP 1596) • Staff • Lecturer: Prof. 陳健 (Chien Chen), EC125B, x31768, chienchen@cs.nctu.edu.tw. • TAs • 張哲維 (Alan Chang) & 陳盈羽 (Ying-Yu Chen), EECS701, x56667-16 • Website • http://w2cn.cis.nctu.edu.tw/New/Course.htm • Handouts • Most handouts will be made available on the Website in formats suitable for printing. Students should download and print out the handouts from the Website
Textbook • Introduction to Algorithms, Second Edition, by Cormen, Leiserson, Rivest, and Stein. (Image courtesy of MIT Press.)
References • Aho, Alfred V., John E. Hopcroft, and Jeffrey D. Ullman. The Design and Analysis of Computer Algorithms. Reading, MA: Addison-Wesley, 1974. ISBN: 0201000296.The classic text, but it lacks topics in network flows and linear programming, as well as more recent algorithms. • ———. Data Structures and Algorithms. Reading, MA: Addison-Wesley, 1983. ISBN: 0201000237.Revised and more elementary version of the first six chapters of The Design and Analysis of Computer Algorithms. • Baase, Sara. Computer Algorithms: Introduction to Design and Analysis. 2nd ed. Reading, MA: Addison-Wesley, 1988. ISBN: 0201060353.General reference, although the exposition is sometimes terse or sketchy • Lee, R.C.T., Tseng, S.S., Chang, R.C., and Tsai, Y.T. Introduction to theDesign and Analysis of Algorithms. McGraw-Hill, 2005. ISBN 007124361. • Kleinberg, Jon, and Tardos, Eva. Algorithm Design. Addison-Wesley, 2006. ISBN 0321372913 • Levitin, Anany. Introduction to The Design and Analysis of Algorithms. Addison-Wesley, 2007. ISBN 032364139
Grading Policy • Writing Homework 10% • Programming Homework 20% • Two Quiz 20% • Midterm 20% • Final 30% • Class Participation +/-
Collaboration Policy • You are encouraged to collaborate on problem sets. The goal of homework is to give you practice in mastering the course material. • You must write up each problem solution by yourself without assistance, however, even if you collaborate with others to solve the problem. You are asked on problem sets to identify your collaborators. If you did not work with anyone, you should write "Collaborators: none." If you obtain a solution through research (e.g., on the Web), acknowledge your source, but write up the solution in your own words. It is a violation of this policy to submit a problem solution that you cannot orally explain to a member of the course staff. • No collaboration whatsoever is permitted on exams.
Course Objectives This course introduces students to the analysis and design of computer algorithms. Upon completion of this course, students will be able to do the following: • Analyze the asymptotic performance of algorithms. • Demonstrate a familiarity with major algorithms and data structures. • Apply important algorithmic design paradigms and methods of analysis. • Synthesize efficient algorithms in common engineering design situations
1.1 Algorithms • Algorithm: Any well-defined computation procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. • Or: tool for solving well specific computational problem. • Example: Sorting problem • Input: A sequence of n numbers • Output: A permutation of the input sequence such that .
Problem • Aninstance of a problem consists of all inputs needed to compute a solution to the problem. • An algorithm is said to be correct if for every input instance, it halts with the correct output. • A correct algorithm solves the given computational problem. An incorrect algorithm might not halt at all on some input instance, or it might halt with other than the desired answer.
What kind of problem can be solved by algorithm? • The Human Genome Project • DNA • The Internet Applications • Shortest path • Hashing • String Matching • Electronic Commerce with Public-key cryptography and digital signatures • RSA (Rivest, Shamir, and Adleman) • Manufacturing and other commercial settings • Games and puzzles
Manufacture Problems • An example2 • A steel company must decide how to allocate production time on a rolling mill. The mill takes unfinished slabs of steel as input and can produce either of two products: bands and coils. The products come off the mill at different rates and also have different profitabilities: Tons/ Profit/ hour ton Bands 200 $25 Coils 140 $30 • The weekly production that can be justified based on current and forecast orders are: Maximum tons: Bands 6,000 Coils 4,000 2 from, R. Fourer, D. Gay, B. Kernighan, AMPL, Boyd & Fraser, 1993, pp. 2-10.
Formulating Linear Programming Problems • Defining the Decision Variables • XB number of tons of bands produced. • XC number of tons of coils produced. • Construct the Symbolic Model Maximize: Subject to:
Latin Square • A Latin square is an n × n table filled with n different symbols in such a way that each symbol occurs exactly once in each row and exactly once in each column. Here are two examples. • The name Latin square originates from Leonhard Euler, who used Latin characters as symbols
Sudoku Puzzles • A special case of Latin squares; any solution to a Sudoku puzzle is a Latin square. • Sudoku imposes the additional restriction that 3×3 subgroups must also contain the digits 1–9 (in the standard version). • Sudoku has been proved to belong the class of NP-Complete problems