9
The Algorithm College of Alameda Copyright © 2006 Patrick McDermott [email protected] al-Khwārizmī 9 th Century Islamic astronomer & mathematician al jabr: Algebra The End Go On n

The Algorithm College of Alameda Copyright © 2006 Patrick McDermott [email protected] al-Khwārizmī 9 th Century Islamic astronomer & mathematician

Embed Size (px)

Citation preview

Page 1: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

The Algorithm

College of AlamedaCopyright © 2006 Patrick McDermott

[email protected]

al-Khwārizmī9th Century Islamic astronomer & mathematician

al jabr: Algebra

The End

Go On

Begin

Page 2: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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

Page 3: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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.

Page 4: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

How to Get Rich

Rise Early Work Hard Find Oil

J. Paul Getty’s secret:

The Sure-fire way to get Rich!

Page 5: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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!

Page 6: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

How To Live a Long Life!Eat Chocolate Cake

Every Day

For 100 Years

Page 7: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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

Page 8: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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

Page 9: The Algorithm College of Alameda Copyright © 2006 Patrick McDermott pmcdermott@peralta.edu al-Khwārizmī 9 th Century Islamic astronomer & mathematician

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?