some quotes…. i really hate this damned machine i wish that they would sell it. it never does...
TRANSCRIPT
![Page 1: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/1.jpg)
Some quotes….
I really hate this damned machineI wish that they would sell it.It never does quite what I wantBut only what I tell it.
~Anon
These machines have no common sense; they have not yet learned to think, and they do exactly as they are told, no more and no less. This fact is the hardest concept to grasp when one first tries to use a computer.
~Donald Knuth
04/21/23 D.A. Clements, UW Information School 1
![Page 2: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/2.jpg)
Announcements
Ian King returns on FridayHistory of Computing, Part 2
04/21/23 2D.A. Clements, UW Information School
![Page 3: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/3.jpg)
What's The Plan?Algorithmic Thinking
Step-by-step directions for whatever someone, or the computer, needs to do
© 2004 Lawrence Snyder04/21/23 3D.A. Clements, UW Information School
![Page 4: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/4.jpg)
10-4
Algorithm
A precise, systematic method for producing a specified result
In real life we do this all the time:
04/21/23 D.A. Clements, UW Information School
![Page 5: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/5.jpg)
Video
Algorithms http://uweoconnect.extn.washington.edu/algoithmsdslfit7/
04/21/23 5D.A. Clements, UW Information School
![Page 6: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/6.jpg)
What is an algorithm?
Algorithm is a procedure and sequence of actions to accomplish some task. The concept of an algorithm is often illustrated by the example of a recipe, although many algorithms are much more complex; algorithms often have steps that repeat (iterate) or require decisions (such as logic or comparison). In most higher level programs, algorithms act in complex patterns, each using smaller and smaller sub-methods which are built up to the program as a whole.
Source: Computer User's online dictionary
04/21/23 6D.A. Clements, UW Information School
![Page 7: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/7.jpg)
Algorithms in our everyday lives
Directions to our home, workplace, or the shopping mall to meet friends
RecipesPatterns
For sewing clothes or soft furnishingsFor knitting or crochet
Plans for building furnitureOwners’ manuals
04/21/23 D.A. Clements, UW Information School 7
![Page 8: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/8.jpg)
Algorithms in our everyday lives
Each algorithmSolves a problemCan be repeated over and over
With the same results
04/21/23 D.A. Clements, UW Information School 8
![Page 9: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/9.jpg)
Video
Algorithm example
04/21/23 9D.A. Clements, UW Information School
![Page 10: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/10.jpg)
Clicker questions
04/21/23 10D.A. Clements, UW Information School
![Page 11: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/11.jpg)
Algorithms in our everyday lives
Always consider the audience Is your friend familiar with North Seattle?How much experience with baking does
your friend have? If you’re going to add RAM to your laptop
yourself, you’re probably fairly technically competent
04/21/23 D.A. Clements, UW Information School 11
![Page 12: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/12.jpg)
Language in Algorithms
Natural languageFor people, we use a natural language like
EnglishAmbiguity is common in natural language
Programming LanguageFormal languages designed to express
algorithmsPrecisely defined; no ambiguity
04/21/23 D.A. Clements, UW Information School 12
![Page 13: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/13.jpg)
D.A. Clements, UW Information School04/21/23
How are algorithms organized?
Title
13
![Page 14: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/14.jpg)
D.A. Clements, UW Information School04/21/23
How are algorithms organized?
Title
Ingredients
14
![Page 15: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/15.jpg)
D.A. Clements, UW Information School04/21/23
How are algorithms organized?
Title
Ingredients
Steps
15
![Page 16: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/16.jpg)
D.A. Clements, UW Information School04/21/23
How are algorithms organized?
Title
Ingredients
Steps
Servings
16
![Page 17: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/17.jpg)
TitleIngredientsSteps
ExceptionsServings
04/21/23 D.A. Clements, UW Information School 17
How are algorithms organized?
![Page 18: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/18.jpg)
TitleIngredientsSteps
ExceptionsWhen to stop
Servings
04/21/23 D.A. Clements, UW Information School 18
How are algorithms organized?
![Page 19: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/19.jpg)
The Five Essential Properties of Algorithms
1. Input specified Data to be transformed during the computation to
produce the output Must specify type, amount, and form of data
2. Output specified Data resulting from the computation—intended
result It is possible to have no output
04/21/23 D.A. Clements, UW Information School 19
![Page 20: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/20.jpg)
Five Essential Properties (cont'd)
3. Definiteness Specify the sequence of events Details of each step, including how to handle
errors
4. Effectiveness The operations are do-able
5. Finiteness Must eventually stop
04/21/23 D.A. Clements, UW Information School 20
![Page 21: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/21.jpg)
Clicker questions
04/21/23 D.A. Clements, UW Information School 21
![Page 22: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/22.jpg)
Context matters—sorting names
Program can fulfill five properties of an algorithm, be unambiguous, and still not work right because it is executed in the wrong context e.g., last name in Western countries means family name; in
Asian countries it may mean given name
04/21/23 D.A. Clements, UW Information School 22
![Page 23: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/23.jpg)
Context matters—driving instructions
Driving instructions"From 45th go to University Avenue and turn right."
Assumes you are traveling in a specific direction. If you are not, the directions will fail.
Diagram of approaching a street (the Ave) from different directions, giving the "turn right" instruction different meanings
04/21/23 D.A. Clements, UW Information School 23
![Page 24: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/24.jpg)
Baking bread….
The final baking step depends on the type of oven
Source: http://www.leftoverqueen.com
04/21/23 D.A. Clements, UW Information School 24
Context matters—bread ovens
![Page 25: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/25.jpg)
Context Matters—electric ovens
04/21/23 D.A. Clements, UW Information School 25
![Page 26: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/26.jpg)
Context Matters—brick ovens
04/21/23 D.A. Clements, UW Information School 26
![Page 27: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/27.jpg)
Context matters—bread machine
04/21/23 D.A. Clements, UW Information School 27
![Page 28: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/28.jpg)
Program vs. Algorithm
A program is an algorithm that has been customized to
solve a specific task
under a specific set of circumstances
using a specific language
Algorithm is general
Program is specific04/21/23 D.A. Clements, UW Information School 28
![Page 29: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/29.jpg)
A practice algorithm…
Grab a piece of paper
In the next few slides, I’ll name the property of an algorithm and you can fill in the blanks for making a salad.
04/21/23 D.A. Clements, UW Information School 29
![Page 30: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/30.jpg)
Algorithm: Input specified
Algorithm for preparing a salad1. Input specified
04/21/23 D.A. Clements, UW Information School 30
![Page 31: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/31.jpg)
Algorithm—Output specified
04/21/23 D.A. Clements, UW Information School 31
Algorithm for preparing a salad2. Output specified
![Page 32: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/32.jpg)
Algorithm—Definiteness & Effectiveness
Algorithm for a preparing salad
04/21/23 D.A. Clements, UW Information School 32
Algorithm for preparing a salad3. Definiteness
4. Effectiveness
![Page 33: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/33.jpg)
Algorithms--Finiteness
04/21/23 D.A. Clements, UW Information School 33
Algorithm for preparing a salad5. Finiteness
![Page 34: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/34.jpg)
Clicker questions
04/21/23 D.A. Clements, UW Information School 34
![Page 35: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/35.jpg)
CD or DVD sorting in a rack
Exchange sort algorithm
04/21/23 35D.A. Clements, UW Information School
![Page 36: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/36.jpg)
10-36
Exchange Sort Algorithm
The Alphabetize CDs example illustrates the standard Exchange Sort algorithm The idea of comparing pairs of items chosen in a
particular way, exchanging them if they are out of order, and continuing to sweep through the items
We could use the same algorithm to sort on a different principle
04/21/23 D.A. Clements, UW Information School
![Page 37: Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines](https://reader036.vdocuments.us/reader036/viewer/2022081506/56649eb75503460f94bc1685/html5/thumbnails/37.jpg)
Friday
Learn the vocabulary on GoPost
04/21/23 D.A. Clements, UW Information School 37