Algorithms and Data Structures (NWI-IBC027) Frits Vaandrager F.Vaandrager@cs.ru.nl Institute for Computing and Information Sciences 7th September 2017 Frits Vaandrager 7th September 2017 Lecture 1 1 / 28
What is an Algorithm? An abstract recipe, prescribing a process that might be carried out by a human, by a computer, or by other means. David Harel Any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. Cormen, Leiserson, Rivest and Stein Frits Vaandrager 7th September 2017 Lecture 1 2 / 28
Bresse Duif by Rogér Rassin from Restaurant La Rive Frits Vaandrager 7th September 2017 Lecture 1 3 / 28
Recipe for Bresse Duif Frits Vaandrager 7th September 2017 Lecture 1 4 / 28
Our View on Algorithms In this course, we consider algorithms in the more restrictive sense of Cormen et al. This is not a cooking class (though that would be fun too!). Nevertheless, it is important to realize that concept of an algorithm/recipe is more general. Proper algorithms are both abstract and well-defined. Algorithms Programs Frits Vaandrager 7th September 2017 Lecture 1 5 / 28
Topic and Objective of this Course This course is about algorithms, data structures and complexity We analyze algorithms and assess their correctness and efficiency Course objective: To provide the intellectual tools for designing and analyzing algorithms Frits Vaandrager 7th September 2017 Lecture 1 6 / 28
Place of Course in the Curriculum Algorithmics is more than a branch of computer science. It is the core of computer science, and, in all fairness, can be said to be relevant to most of science, business, and technology. David Harel Frits Vaandrager 7th September 2017 Lecture 1 7 / 28
Place of Course in the Curriculum Basic Math Skills Wiskundige structuren Beweren & bewijzen Basic Programming Skills Imperatief programmeren Object orientatie Functioneel Programmeren Algorithms & Data Structures Further Math Skills Combinatoriek Calculus & kansrekenen Complexiteit Verification Skills Semantiek & correctheid Software verificatie Frits Vaandrager 7th September 2017 Lecture 1 8 / 28
Basic Course Info Introduction Course wiki https://ocw.cs.ru.nl/nwi-ibc027/courseinfo Frits Vaandrager 7th September 2017 Lecture 1 9 / 28
The Team Introduction Instructors Frits Vaandrager (lectures) Alexis Linard (weekly assignments) Joshua Moerman (practical assignments) Student assistants Joris den Elzen Aldo Gunsing Marco Hernandez Tiko Huizinga Timo Maarse Ward Theunisse Frits Vaandrager 7th September 2017 Lecture 1 10 / 28
The Book Introduction This textbook is mandatory. Slides, links to tutorials, etc are available through course wiki. Frits Vaandrager 7th September 2017 Lecture 1 11 / 28
Activities Introduction Lectures Weekly, 2 hours on Thursday, 10.45-12.30 Presence not compulsory... but active attitude expected, when present There will be 14 lectures and 14 problem sessions Probably no lectures in January Frits Vaandrager 7th September 2017 Lecture 1 12 / 28
Activities Introduction Problem sessions ( werkcolleges ) Weekly, 2 hours on Monday, starting 8.45 Homework compulsory (10/14) Presence not compulsory Homework problems available on thursday, deadline next wednesday at 18.00 Frits Vaandrager 7th September 2017 Lecture 1 13 / 28
Activities Introduction Problem sessions ( werkcolleges ) Weekly, 2 hours on Monday, starting 8.45 Homework compulsory (10/14) Presence not compulsory Homework problems available on thursday, deadline next wednesday at 18.00 Extra problem session on different slot? If you are unable to attend problem sessions on monday at 8.45, please send a message to F.Vaandrager@cs.ru.nl by 18.00 today, indicating during which of the 7 remaining slots on monday/tuesday you are available. Frits Vaandrager 7th September 2017 Lecture 1 13 / 28
Activities Introduction Practical assignment Groups of two Evaluation with several tests (easy, difficult) Report describing solution, incl. correctness and efficiency Frits Vaandrager 7th September 2017 Lecture 1 14 / 28
How are Grades Computed? Grading Final grade is 0.6 E + 0.2 P1 + 0.2 P2, where E is result exam and P1, P2 are results practical assignment We require E 5 We require you submit serious attempts for practical assignments, and for 10 out of 14 weekly assignments You earn 0.1 bonus point for for each weekly assignment for which you score satisfactory or good, up to 1 bonus point For exam there is a resit but not for practical assignments If you followed the course last year, did not pas but got an average grade of at least 7 for the practical assignments, then you don t have to redo the practical assignments Frits Vaandrager 7th September 2017 Lecture 1 15 / 28
How Much Time Do I Need? Time investment 6ec means 6 28 = 164 hours in total 84 hours for 14 weeks means 6 hours per week for lectures, studying, problem sessions and small assignments 32 hours for each practical assignment 20 hours for preparing exam Frits Vaandrager 7th September 2017 Lecture 1 16 / 28
How Can I Pass this Course? How to pass this course... Practice, practice, practice... You don t learn it it by just staring at the slides - not a spectator sport! Exam questions will be in line with exercises Frits Vaandrager 7th September 2017 Lecture 1 17 / 28
How Can I Pass this Course Last but not least Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Last year: 139 students registered Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Last year: 139 students registered 87 students were allowed to participate in the exam Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Last year: 139 students registered 87 students were allowed to participate in the exam 85 students participated in the exam Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Last year: 139 students registered 87 students were allowed to participate in the exam 85 students participated in the exam 73 students passed the exam (or resit) Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
How Can I Pass this Course Last but not least You can fail for this course! Last year: 139 students registered 87 students were allowed to participate in the exam 85 students participated in the exam 73 students passed the exam (or resit) Thus only 53% of the registered students passed the course, but from those that participated in the exam 86% passed Frits Vaandrager 7th September 2017 Lecture 1 18 / 28
Why is this course important/useful? Algorithmics is core of computer science We live in The Age of Algorithms Algorithmic skills essential for advanced programmers Frits Vaandrager 7th September 2017 Lecture 1 19 / 28
ICPC finals 2016 in Thailand: Radboud on place 51! Frits Vaandrager 7th September 2017 Lecture 1 20 / 28
Computer Science Introduction Frits Vaandrager 7th September 2017 Lecture 1 21 / 28
One algorithm can change the world Frits Vaandrager 7th September 2017 Lecture 1 22 / 28
One algorithm can change the world Why was the Google algorithm successful? Solved a problem search in an elegant, efficient, correct and scalable way. Frits Vaandrager 7th September 2017 Lecture 1 22 / 28
Analysis of algorithms Introduction Study of different features that allow classifying and comparing algorithms Frits Vaandrager 7th September 2017 Lecture 1 23 / 28
Analysis of algorithms Introduction Study of different features that allow classifying and comparing algorithms One important feature: the correctness of an algorithm. Does the algorithm actually do what we meant it to do? Frits Vaandrager 7th September 2017 Lecture 1 23 / 28
Analysis of algorithms Introduction Then, it is important to take into account the resources needed to execute an algorithm: memory bandwidth hardware... and of particular interest in this course: execution/computation time The latter is what we will be using as comparison measure between algorithms. Frits Vaandrager 7th September 2017 Lecture 1 24 / 28
Analysis of algorithms Introduction Then, it is important to take into account the resources needed to execute an algorithm: memory bandwidth hardware... and of particular interest in this course: execution/computation time The latter is what we will be using as comparison measure between algorithms. The strategy used in an algorithm to perform a certain task is very important! Frits Vaandrager 7th September 2017 Lecture 1 24 / 28
In a nutshell... Introduction What we will be doing during the coming lectures: Analysis of execution times Data structures Graph algorithms Algorithm design strategies: divide and conquer, greedy, dynamic programming, randomized,.. Frits Vaandrager 7th September 2017 Lecture 1 25 / 28
Why are efficient algorithms important? For a given problem, the ultimate quest is to find the most efficient algorithm. Frits Vaandrager 7th September 2017 Lecture 1 26 / 28
Why are efficient algorithms important? For a given problem, the ultimate quest is to find the most efficient algorithm. For harder problems, no efficient solution is known. These algorithms are NP (another course). Frits Vaandrager 7th September 2017 Lecture 1 26 / 28
Why is analysis of algorithms important? Why should we care to learn how to design and analyze algorithms? Even though many problems have been solved efficiently, the rapid change in the world (think of the amount of info) requires for constant improvement in the existing algorithms and design of new, more efficient algorithms; If we would have infinite resources (memory, processing speed,... ) then any solution would be fine; but in reality we have to optimize consumption and minimize the resource consumption (we have to be zuinig)! Frits Vaandrager 7th September 2017 Lecture 1 27 / 28
Why is analysis of algorithms important? Why should we care to learn how to design and analyze algorithms? (c d) Algorithms for the same problem can have (crazily) different behaviors: good algorithm design can have more impact than the choice of hardware. In a nutshell: algorithms are important because the choices made at that level of devising a system can strongly affect its validity and scope of application. Frits Vaandrager 7th September 2017 Lecture 1 28 / 28