The Beauty and Joy of Computing Lecture #6 Algorithms Alan Turing (1912-1954) would have turned 100 this year. He was a brilliant British mathematician.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Dynamic Programming.
CS10 The Beauty and Joy of Computing Lecture #7 Algorithmic Complexity One million Wi-Fi devices isn’t cool. You know what’s cool? A Billion.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Lecture 2: Fundamental Concepts
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
Lecture 14 Go over midterm results Algorithms Efficiency More on prime numbers.
CS10 The Beauty and Joy of Computing Lecture #5 : Programming Paradigms Intel has shown demos of the game Wolfenstein whose visual images weren’t.
CS /29/2004 (Recitation Objectives) and Computer Science and Objects and Algorithms.
CS10 The Beauty and Joy of Computing Lecture #5 : Programming Paradigms Times like these make us all appreciate the value of freedom… China.
Algorithmic Problems in Algebraic Structures Undecidability Paul Bell Supervisor: Dr. Igor Potapov Department of Computer Science
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
Chapter 1 Program Design
CS39N The Beauty and Joy of Computing Lecture #6 : Programming Paradigms In response to a 30,000+ signature petition, British PM Gordon Brown.
Unit 1. Sorting and Divide and Conquer. Lecture 1 Introduction to Algorithm and Sorting.
Design and Analysis of Algorithms
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
HOW TO SOLVE IT? Algorithms. An Algorithm An algorithm is any well-defined (computational) procedure that takes some value, or set of values, as input.
CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a lgorithms.
Invitation to Computer Science, Java Version, Second Edition.
The Beauty and Joy of Computing Lecture #5 Programming Paradigms Story details the move to Digital of many things precious to us – music, photos, videos.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
Algorithms and their Applications CS2004 ( ) Dr Stephen Swift 1.2 Introduction to Algorithms.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Introduction to algorithm design and recursion CS125 Spring 2007 Arthur Kantor.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Introduction To PROLOG World view of imperative languages. World view of relational languages. A PROLOG program. Running a PROLOG program. A PROLOG.
The Beauty and Joy of Computing Lecture #5 Programming Paradigms UC Berkeley EECS Sr Lecturer SOE Dan Garcia invent.citris-uc.org motherboard.vice.com/read/click-print-gun-the-inside-story-of-the-3d-printed-gun-movement-video.
CSC 211 Data Structures Lecture 13
The Beauty and Joy of Computing Lecture #6 Algorithms MIT researchers recently created an algorithm which they say will be able to predict what topics.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
Algorithms Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin,
The Beauty and Joy of Computing Lecture #6 Algorithms I UC Berkeley EECS Sr Lecturer SOE Dan Garcia.
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
The Beauty and Joy of Computing Lecture #5 Programming Paradigms invent.citris-uc.org
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
1 Recursive algorithms Recursive solution: solve a smaller version of the problem and combine the smaller solutions. Example: to find the largest element.
The Beauty and Joy of Computing Lecture #7 Algorithms II minors-delete-activity/story?id= /
In the news: A recently security study suggests that a computer worm that ran rampant several years ago is still running on many machines, including 50%
The Beauty and Joy of Computing Lecture #7 Algorithmic Complexity “Data scientists at Yahoo are using prediction markets – along with polls, sentiment.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Algorithmic Problems in Algebraic Structures Undecidability Paul Bell Supervisor: Dr. Igor Potapov Department of Computer Science
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
UC Berkeley EECS Lecturer SOE Dan Garcia The success of Apple’s Siri (only available on the iPhone 4S) has sparked competition, to be sure. Google’s IRIS.
CS10 The Beauty and Joy of Computing Lecture #4 : Functions UC Berkeley EECS Lecturer SOE Dan Garcia Researchers at Microsoft and UW are working.
CS10 : The Beauty and Joy of Computing Lecture #5 Programming Paradigms If you visited google.com on Saturday, you saw a tribute to this founding.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia Valve (video game makers of Half-Life) believes the future of video games may not be in the input device (ala.
The Beauty and Joy of Computing Lecture #6 Algorithms I Jon Kotker UC Berkeley EECS 2010, 2013 Microsoft
Algorithms.
Introduction to Algorithms
Yahoo predicts contest already!
Data Structures and Algorithms
Unit 1. Sorting and Divide and Conquer
Objective of This Course
Algorithms CSE 120 Winter 2018 Instructor: Teaching Assistants:
Algorithms Key Revision Points.
Asst. Dr.Surasak Mungsing
Introduction to Algorithms
Discrete Mathematics and its Applications
Presentation transcript:

The Beauty and Joy of Computing Lecture #6 Algorithms Alan Turing ( ) would have turned 100 this year. He was a brilliant British mathematician (before there was Computer Science), and formalized the concept of “Algorithm”. Turing test, Turing completeness, Turing machine, etc. UC Berkeley EECS Sr Lecturer SOE Dan Garcia en.wikipedia.org/wiki/Alan_Turing Quest (first exam) in in 7 days!!

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (2) Garcia  A Turing Machine has an infinite tape of 1s and 0s and instructions that say whether to move the tape left, right, read, or write it  Can simulate any computer algorithm!  A Universal Turing Machine is one that can simulate a Turing machine on any input  A language is considered Turing Complete if it can simulate a Universal Turing Machine  A way to decide that one programming language or paradigm is just as powerful as another Turing Completeness en.wikipedia.org/wiki/Turing_completeness ironphoenix.org/tril/tm/ Turing Machine by Tom Dunne Xkcd comic “Candy Button Paper”

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (3) Garcia World record for solving a 3x3x3 Rubik's cube? a) 12 minutes, 3 seconds b) 58.1 seconds c) 7.96 seconds d) 5.66 seconds e) 3.31 seconds

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (4) Garcia Rubik's Cube Champion Feliks Zemdegs (b 1995) 5.66 seconds, Melbourne Winter Open

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (5) Garcia What is an algorithm? ● An algorithm is 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. ● The concept of algorithms, however, is far older than computers.

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (6) Garcia ● Dances, ceremonies, recipes, and building instructions are all conceptually similar to algorithms. ● Babylonians defined some fundamental mathematical procedures ~3,600 years ago. Early Algorithms Photo credit: Daniel Niles

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (7) Garcia Algorithms You've Seen ● Addition algorithm (for humans)

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (8) Garcia Algorithms You've Seen in CS10 ● Length of word ● Whether a word appears in a list ● Whether a list is sorted ● Sort a list ● Pick a random word of length x from list

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (9) Garcia Commonly-Used Algorithms Luhn algorithm Credit card number validation Deflate Lossless data compression PageRank Google’s way of measuring “reputation” of web pages EdgeRank Facebook’s method for determining what is in your news feed

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (10) Garcia Choosing a Technique ● Most problems can be solved in more than one way, i.e., multiple algorithms exist to describe how to find the solution. ● Not all of these algorithms are created equal. Very often we have to make some trade-offs when we select a particular one. ● We'll talk more about this next time.

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (11) Garcia Ways to Attack Problems ● There are many different categories of algorithms. Two common methods: ● Top-down ● Starting from the top, divide the full problem up into smaller subproblems, working your way down. ● You often write “stubs” for missing things below to test ● Bottom-up ● Starting from the bottom (smallest thing you need to do), work your way up, building your way up. ● Your system always “works” as you build layers on top.

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (12) Garcia Top-down vs Bottom-up example

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (13) Garcia ● Algorithms are conceptual definitions of how to accomplish a task and are language agnostic, usually written in pseudo-code. ● E.g., (find max value in list) ● Set (a temporary variable) the max as the first element ● Go through every element, compare to max, and if it’s bigger, replace the max ● Return the max  A function or procedure is an implementation of an algorithm, in a particular language.  E.g., (find max value in list) Algorithms vs. Functions & Procedures

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (14) Garcia TOTAL Correctness Always reports, and the answer is always correct. PARTIAL Correctness Sometimes reports, and the answer is always correct when it reports. Algorithm Correctness We don't only want algorithms to be fast and efficient; we want them to be correct! We also have probabilistic algorithms that have a certain probability of returning the right answer.

UC Berkeley “The Beauty and Joy of Computing” : Algorithms (15) Garcia ● The concept of an algorithm has been around forever, and is an integral topic in CS. ● Algorithms are well- defined procedures that can take inputs and produce output (or have side-effects). ● We're constantly dealing with trade- offs when selecting / building algorithms. ● Correctness is particularly important and testing is the most practical strategy to ensure it. ● Many write tests first! Summary