Professional Documents
Culture Documents
ALGORITHMS
An algorithm is a finite, definite, effective procedure,
KEVIN WAYNE with some input and some output.
Donald Knuth
www.cs.princeton.edu/courses/archive/spring13/cos423
2
Etymology. [Knuth, TAOCP] COS 226. Implementation and consumption of classic algorithms.
Stacks and queues.
Algorism = process of doing arithmetic using Arabic numerals. Sorting.
Searching. private static void sort(double[] a, int lo, int hi)
True origin: Abu 'Abd Allah Muhammad ibn Musa al-Khwarizm while (i <= gt)
{
was a famous 9th century Persian textbook author who wrote if (a[i] < a[lo]) exch(a, lt++, i++);
else if (a[i] > a[lo]) exch(a, i, gt--);
Kitb al-jabr wa'l-muqbala, which evolved into today's high else i++;
}
school algebra text.
sort(a, lo, lt - 1);
sort(a, gt + 1, hi);
}
COS 423. Design and analysis of algorithms. Internet. Web search, packet routing, distributed file sharing, ...
Greedy. Biology. Human genome project, protein folding,
Divide-and-conquer.
N X
X N N
X NXi+1
2
= 2
1 Computers. Circuit layout, databases, caching, networking, compilers,
j i+1 j
Dynamic programming. i=1 j=i+1 i=1
XN
1
j=2
Computer graphics. Movies, video games, virtual reality,
Network flow. 2N
j=1
j Security. Cell phones, e-commerce, voting machines,
Randomized algorithms. 2N
Z N
1
dx
Multimedia. MP3, JPG, DivX, HDTV, face recognition,
Intractability. = 2N ln N
x=1 x
Social networks. Recommendations, news feeds, advertisements,
Coping with intractability. Physics. N-body simulation, particle collision simulation,
Data structures.
Emphasizes critical thinking, problem-solving, and rigorous analysis. We emphasize algorithms and techniques that are useful in practice.
5 6
Electronic submission.
Precept. [Dan Larkin and Sachin Ravi] ...
Thursday 4:305:20pm or Friday 1111:50am in COS 105.
precept begins
this week
www.cs.princeton.edu/courses/archive/spring13/cos423
Prerequisites. COS 226 and COS 340, or instructor's permission. 7 8
Textbook Grades
Required reading. Algorithm Design by Jon Kleinberg and va Tardos. Problem sets.
problem set 1 is due
Addison-Wesley 2005, ISBN 978-0321295354. "Weekly" problem sets, due via electronic submission. due Wednesday 2/13
Course grades.
Primarily based on problem sets.
Staff discretion used to adjust borderline cases.
Undergrads: determined without considering grad students.
Grads: determined using undergrad scale.
9 10
Collaboration policy. [see syllabus for full details; ask if unsure] Textbook. Read the textbookit's good!
Course materials (textbook, slides, handouts) are always permitted.
No external resources, e.g., can't Google for solutions.
"Collaboration permitted" problem sets.
You may discuss ideas with classmates. Piazza. Online discussion forum.
You must write up solutions on your own, in your own words. Low latency, low bandwidth.
Mark as private any solution- www.piazza.com/class#spring2013/cos423
"No collaboration" problem sets. revealing questions.
You may discuss ideas with course staff.
Office hours.
High bandwidth, high latency.
See web for schedule.
www.cs.princeton.edu/courses/archive/spring13/cos423
11 12
Questions?
13