Upload
carol-parks
View
216
Download
0
Embed Size (px)
Citation preview
The Algorithm
College of AlamedaCopyright © 2006 Patrick McDermott
al-Khwārizmī9th Century Islamic astronomer & mathematician
al jabr: Algebra
The End
Go On
Begin
The King of Hearts
Begin at the beginning, and go on till you come to the end: then stop.—K♥ The King of Hearts in Lewis Carroll,Alice’s Adventures in Wonderland
The End• Don’t forget to
STOP!
Go On
Begin
An Algorithm is
A finite procedure,written (or could be) in a fixed symbolic vocabulary,governed by precise instructions,moving in discrete steps, 1, 2, 3…,whose execution requires no insight, cleverness, intuition, intelligence, or perspicuity,and that sooner or later comes to an end.Berlinski, David, The Advent of the Algorithm: The Idea that Rules the World, New York: Harcourt (0-15-100338-6), 2000, p. xviv.
Artist Drawing a Lute with the Help of a Mechanical DeviceAlbrecht Dürer, c. 1525
The Entscheidungsproblem Given a description of a program and a finite input, decide whether the program finishes running or will run forever, given that input.
How to Get Rich
Rise Early Work Hard Find Oil
J. Paul Getty’s secret:
The Sure-fire way to get Rich!
Some Algorithms• The Great Google {Secret} Search Algorithm• Long Division• Linear Programming• Sorting• McDonald’s Recipe
– But not Julia Childs’• Bake a Cake
– From a Package– But NOT “from scratch”– Cake can lead to a Long Life!
How To Live a Long Life!Eat Chocolate Cake
Every Day
For 100 Years
Bubble Sort• Look at each item in turn• If the next item is less, swap them• Keep doing it until they are in order
A
L
T
T
A
L
T
L
A0 1 2
A
L
T
What’s Goodness?• Donald Knuth• The Art of Computer
Programming– Not Science
1. Finite2. Definite3. Input4. Output5. Effective
EfficientProcessingMemoryStorage
Easy to Code Easy to Maintain
RobustUnderstandable
MACHINEHUMAN
amazon.com
• Bestsellers• Every Hour• Not Total• Current Hot Titles
– Wild fluctuations cool!
• Steady sellers– Wild fluctuations
bad!– Few or rare sales
• Stock versus Flow
• Best Reviewers• Sheer Numbers• Positive Votes• Negative Votes
– Academia Bad = Good
• Gaming the System– Campaigns– Vote For MyselfAuthor: Most recent or best seller?