算法设计与分析 (3)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(image of Al Khwarizmi from http://jeff560.tripod.com/)
Copyright Li Zimao @ 2007-2008-1 SCUEC
Pedagogy What I hear, I forget. What I see, I remember. What I do, I understand.
Reference Books:
M.H. Alsuwaiyel, Algorithms Design Techniques and Analysis, Publishing House of Electronics Industry, 2003, 40RMB. Thomas H. Cormen etc., Introduction to Algorithms (Second Edition), Higher Education Press & The MIT Press, 68RMB. Others, search on the website with keyword “Design and Analysis of algorithm”, you will find more...
Copyright Li Zimao @ 2007-2008-1 SCUEC
Notion: Algorithm
You all have learned the course DATA STRUCTURE or DISCRETE MATHEMATICS, and have your own sense on algorithm.
Copyright Li Zimao @ 2007-2008-1 SCUEC
Textbook Cover
What does the cover include? Puzzles, Notions, and Stories of Algorithms.
Copyright Li Zimao @ 2007-2008-1 SCUEC
–
Effectiveness
Steps must be sufficiently simple and basic.
-e.g., check if 2 is the largest integer n for which there is a solution to the equation xn + yn = zn in positive integers x, y, and z
Copyright Li Zimao @ 2007-2008-1 SCUEC
Why Study this Course?
Donald E. Knuth stated “Computer Science is the study of algorithms”
Cornerstone of computer science. Programs will not exist without algorithms.
–
Input
Valid inputs must be clearly specified.
–
Output
can be proved to produce the correct output given a valid can be proved to produce the correct output given a valid input.
problem
algorithm
input
“computer”
Copyright Li Zimao @ 2007-2008-1 SCUEC
output
Notion: Algorithm
More precisely, an algorithm is a method or process to solve a problem satisfying the following properties:
Copyright Li Zimao @ 2007-2008-1 SCUEC
Algorithm: A brief History
Muhammad ibn Musa al-Khwarizmi, one of the most influential mathematicians in 9th century in Baghdad, wrote a textbook in Arabic
to your opinion, what is algorithm?
Copyright Li Zimao @ 2007-2008-1 SCUEC
Notion: Algorithms
An algorithm is a sequence of unambiguous instructions for solving a computational problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time.
Design and Analysis of Algorithms
Li Zimao College of Computer Science South Central University for Nationalites Email: lizm@sdu.edu.cn or sdlizm@hotmail.com Office Address: 9- 420 Office Hours: By Appointment
For Turning machine model, see
Michael Sipser, Introduction to the Theory of Computation, China Machine Press. John E. Hopcroft, Rajeev Motwani, Introduction to Automata Theory, Languages, and Computation (Second Edition), Tsinghua University Press.
Copyright Li Zimao @ 2007-2008-1 SCUEC
Notion: Algorithm*
The exact definition of algorithm is given by Alonzo Church and Alan Turing in 1936.
-calculus system of Church Deterministic Turning machine model Equivalent definition
Bonus is possible for those positive and active students
Copyright Li Zimao @ 2007-2008-1 SCUEC
Caution
Please finish your assignments and projects independently.
Copyright Li Zimao @ 2007-2008-1 SCUEC
Course Prerequisite
Data Structure Discrete Mathematics C, Java or other programming languages Advanced Mathematics
What does this mean?
Let‟s start our lecture formally
Copyright Li Zimao @ 2007-2008-1 SCUEC
Expected Outcomes
Student should be able to
Define algorithm formally and informally. Explain the idea of different algorithms for computing the greatest common devisor Describe the process of algorithm design and analysis Design recursive and non-recursive algorithms for computing a Fibonacci number
Text Book and Reference Books
Text Book:
Anany Levitin, Introduction to the Design and Analysis of Algorithms, Tsinghua University Press, 2003, 39RMB.
Copyright Li Zimao @ 2007-2008-1 SCUEC
Grading Schemes
Total 100Fra Baidu bibliotek
Class participation and Assignments: 5% Programming Projects: 10% Midterm Test: 15% Final Exam: 70%
If you really meet problems, you can seek help from me or other students, but remember not copying, CHEATING!
Please sign attendance when needed, but remember not signing for others, CHEATING! Power off (or ring off) your mobile phone Feedback (positive or negative) is encouraged and welcome, and IMPORTANT. (ask questions!) Thinking, before, in and after class is encouraged and IMPORTANT.
about adding, multiplying, dividing numbers, and extracting square roots and computing π.
www.lib.virginia.edu/science/parshall/khwariz.html
Many centuries later, decimal system was adopted in Europe, and the procedures in Al Khwarizmi‟s book were named after him as “Algorithms”.
Copyright Li Zimao @ 2007-2008-1 SCUEC
Examples
Is the following a legitimate algorithm?
i 1 While (i <= 10) do ai+1 Print the value of a End of loop Stop
Closely related to our lives Help to guide how others analyze and solve problems Help to develop the ability of analyzing and solving problems via computers Very interesting if you can concentrate on this course
–
Finiteness
terminates after a finite number of steps
–
Definiteness
Each step must be rigorously and unambiguously specified.
-e.g., ”stir until lumpy”