1 / 72

Welcome

Thinking about Algorithms Abstractly. Welcome. Jeff Edmonds www.cse.yorku.ca~jeffcourses3101 jeff@cse.yorku.ca CSB 3044, ext. 33295 416-538-7413 . Jeff Edmonds York University. Lecture 1. COSC 3101. Course Material. Videos Of my lectures Fall 2011. Slides. Text.

raine
Download Presentation

Welcome

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Thinking about Algorithms Abstractly Welcome Jeff Edmonds www.cse.yorku.ca\~jeff\courses\3101 jeff@cse.yorku.caCSB 3044, ext. 33295 416-538-7413  Jeff Edmonds York University Lecture1 COSC 3101

  2. Course Material Videos Of my lectures Fall 2011 Slides Text Steps, Assignments, Practice Tests, Unit Tests, Exam Extra Text: Cormen, Leiserson, Rivest, and Stein  "Introductin to Algorithms", Good to have, but not needed for this course.

  3. Course Material www.cse.yorku.ca\~jeff\courses\3101\syllabus

  4. What do you think about 3101? • Was by far the hardest course ever. • I got the worst midterm mark ever. • I almost gave up. • But opened a door to such an interesting world for me. • Learned to see things abstractly and from different angles • After working a few years, I realized that 3101 was the most useful course I took.

  5. A Contract to Learn It deeply saddens me when a third of the class does not learn the material sufficiently to pass. I will do everything in my power to help you learn this material. I request that you do everything in your power. Everyone can learn it.

  6. Tough Love Last year and this summer, I threatened them every day. They performed better than ever before! And my course evaluations were better.

  7. Think about Algorithms Abstractly This course requires completely changing the way you think about algorithms. Though I keep warning people, they tend not to get it until they are Devastated by the midterm Change your thinking now.

  8. Study Now! You spend 50hrs/week on your programming course. People do work hard on my assignments. But they don’t really study the material deeplyuntil they fail the midterm.

  9. Marks We will work you HARD: • 6 assignments • 5 practice tests • 5 unit tests • Participation • An exam • Mark = 0% 0%  -4%    4%*5=20%  11%*5=55%    2%  10%   35%  78%   Σi=1..5 [ 0.04 Ti + 0.07 Max(Ti,E) ]  + [ 0.02 P + 0.08 Max(P,E) ] + 0.35 E 

  10. Marks 5 unit tests: • Each unit test, half the class fails. “Fail early, fail often” • Then almost everyone starts to listen and passes the exam. • Don’t want to people who fail the midterms to give up • Want people to work on the midterms 4%*5=20%  11%*5=55%    7% max(Ti,E) 4% Ti

  11. Marks Class Participation: • Asking/Answering questions in class • Attending office hours • Talking to me outside of class • Submitting a photo *

  12. Marks Σi=1..5 [ 0.04 Ti + 0.07 Max(Ti,E) ]  + [ 0.02 P + 0.08 Max(P,E) ] + 0.35 E 

  13. Together I think it is important for people to not feel isolated with the material.

  14. Together You’re cool! Are you free sometime this weekend? Yes!The best way to learn is to teach each other!

  15. Together Some students feel too intimidated to talk to the professor. Actually, he is just a guywho has been doing this for a while.

  16. Together Office hours: Before/after class tend to be the best time.Longer or private questions, when requested, can be taken back to my office, CSB 3044.

  17. So you want to be a computer scientist?

  18. Is your goal to be a mundane programmer?

  19. Or a great leader and thinker?

  20. Original Thinking

  21. Boss assigns task: • Given today’s prices of pork, grain, sawdust, … • Given constraints on what constitutes a hotdog. • Make the cheapest hotdog. Everyday industry asks these questions.

  22. Your answer: • Um? Tell me what to code. With more sophisticated software engineering systems,the demand for mundane programmers will diminish.

  23. Your answer: • I learned this great algorithm that will work. Soon all known algorithms will be available in libraries.

  24. Your answer: • I can develop a new algorithm for you. Great thinkers will always be needed.

  25. Course Content • A list of algorithms. • Learn their code. • Trace them until you are convinced that they work. • Implement them. • Worry about details. class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length; i++) { int j = i; int B = a[i]; while ((j > 0) && (a[j-1] > B)) { a[j] = a[j-1]; j--;} a[j] = B; }}

  26. Course Content • A survey of algorithmic design techniques. • Abstract thinking. • How to develop new algorithms for any problem that may arise.

  27. Study: • Many experienced programmers were asked to code up binary search.

  28. Study: • Many experienced programmers were asked to code up binary search. 80% got it wrong Good thing is was not for a nuclear power plant.

  29. What did they lack?

  30. What did they lack? • Formal proof methods?

  31. What did they lack? • Formal proof methods? Yes, likely Industry is starting to realize that formal methods are important. But even without formal methods …. ?

  32. What did they lack? • Fundamental understanding of the algorithmic design techniques. • Abstract thinking.

  33. Course Content Notations, analogies, and abstractions for developing, thinking about, and describing algorithms so correctness is transparent

  34. A survey of fundamental ideas and algorithmic design techniques For example . . .

  35. Logic Quantifiers Logs and Exps g "b Loves(b,g)"b g Loves(b,g) 2a× 2b = 2a+b2log n = n Time Classifying Functions Time Complexity f(i) = nQ(n) t(n) = Q(n2) Input Size Adding Made Easy Recurrence Relations ∑i=1 f(i). T(n) = a T(n/b) + f(n) Some Math

  36. 0 i-1 i T+1 i i 9 km 5 km Iterative Algorithms Loop Invariants <preCond> codeA loop <loop-invariant> exit when <exit Cond> codeB codeC <postCond> One step at a time Code Relay Race

  37. ? ? Recursive Algorithms

  38. Graph Search Algorithms

  39. Network Flows

  40. Greedy Algorithms NEED A PIC HERE (NOT POOH)

  41. Recursive Back Tracking

  42. Dynamic Programing

  43. Reduction = • Rudich www.discretemath.com

  44. Course Material www.cse.yorku.ca\~jeff\courses\3101\syllabus

  45. Course Material Steps: • For each unit, I spoon feed you the key ideas from each unit as a set of steps. • Learn them! Understand them! • With only them, you are on your way to passing. Without them, you are on your way to failing. • Lectures consists of many examples of using these steps. Assignments: Practice key ideas. Do them! Practice Tests: Do them! Text “How to Think about Algorithms”: Buy it and read it.

  46. Book Slides Videos Pros • Don’t have to take notes. • Lower fear level that you will miss something. • Flexible to miss a class or two if working, parenting, sick, … • Read/watch ahead to be prepared for a good discussion. • Read/watch after to review and as a reference.

  47. Book Slides Videos Pros • REALLY good students might feel they don’t have to come to class (some might be right). Cons • Cocky students will think they don’t need to come classbut are wrong. • Lazy students will use them as an excuse to skip classand then never really get to them. Test every other week!Cant be delayed.

  48. Useful Learning Techniques Before reading the solutions to the assignments. • Work hard on solving them on your on. • Study the text and slides. • Get help, but not answers from friends, TA, professor, …

  49. Useful Learning Techniques After reading the solutions to the assignments. • Study the solutions. • Understand the solutions. • Memorize the solutions. • The questions on the tests will be different. • But the answers will be surprisingly close.

  50. Useful Learning Techniques Please interact with me in class. Help me know what people are not understanding Slow down the slides (Though we do have a lot of material to cover)

More Related