CS 4102: Algorithms Lecture 1: Introduction and Logistics
Co-instructors: Robbie Hott and Tom Horton (These are slides for Horton’s section) Spring 2020 Who’s Who in Algorithms?
2 CS4102 Algorithms Spring 2020
Edsger Dijkstra Al-Khwarizmi Alan Turing Ada Lovelace
Tom Horton Gauss Robbie Hott Robert Tarjan
Tony Hoare Donald Knuth Stephen Cook 3 A Historic Perspective
Euclid Al-Khwarizmi Gauss Ada Lovelace Stephen Cook
300 BC 800 1600 1800 1900
Alan Turing Edsger Dijkstra Don Knuth What Is an Algorithm?
• In mathematics and computer science, an algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are unambiguous specifications for performing calculation, data processing, automated reasoning, and other tasks. [Wikipedia Jan 2020] • An algorithm is a step by step procedure to solve logical and mathematical problems. [Simple English Wikipedia Aug 2019]
Motivating example Takeaway: Being unambiguous is not always easy! A Concrete Example
Need an accurate approximation �
How much concrete do I need? 4.3km (2.7mi) diameter � Approximation Algorithm
� = 3.14159265359...
1
Circumference = 2� � Approximation Algorithm
� = 3.14159265359...
Perimeter > 2� > Perimeter � Approximation Algorithm
� = 3.14159265359...
1 1
1
2� > Perimeter = 6 � Approximation Algorithm
� = 3.14159265359... 1 digit correct Solve for � � 2 2 � � = 1 � 3 2
�
12 = Perimeter > 2� > Perimeter = 6 3 3.46 > � > 3 � Approximation Algorithm
� = 3.14159265359... 3 digits correct
20 20 6 + =Perimeter > 2� > Perimeter = 6 + 70 3.14285 > � > 3.14084 71 Some Questions to Ask?
How fast do we “converge?”
How much work is needed to do better?
Using this approach, we get ½ digit of � with each additional side – to get � digits, we need a polygon with 2� sides Another Algorithm https://youtu.be/HEfHFsfGXjs Extra credit: Look up and explain the solution! Better � Approximation Better � Approximation (Ramanujan Series)