Some notes

These are sketchy notes, maybe about like one might take down in class, not like a textbook. I might make them sleeker in future years, but maybe they're useful as they are.

Algorithm

An algorithm is an effective procedure.

The meaning of "procedure" might be clear; that's a method for doing something in terms of individual steps. The usual analogy is a recipe, in cooking. By "effective" we mean that it really tells you how to do something...

Now in computer programming, and in other computer use, the standard of being "effective" is quite strict, for two main reasons:

Writing a computer program consists of two very different kinds of activities.
One is the coming up with the underlying algorithms for the various portions of the program.
The other is representing that algorithm as text in the correct form in a computer programming language (formal notation) so as to cause the algorithm to be carried out when the program runs on the computer.

The coming up with the underlying algorithm could be called "inventing an algorithm" or "discovering an algorithm" -- this is a philosophical point which needn't concern us in this course.

More examples of algorithms:

Note that many algorithms have an idea of input and output. If we're converting Canadian funds to equivalent amounts of American funds, the Canadian dollar amount is input and the American dollar amount is output.

Modern computer systems are what we call "interactive", which basically means that input and output are interspersed. You type one Canadian dollar value, you get its American dollar value, you type another, you get another. Or, you run one application (which you do by providing some input), then the application gives you some output, then you run another application, then it gives you some output. Input and output are usually interspersed in a modern "interactive" computer environment.

Still, this basic analysis of input and output is a good structure for specifying what algorithms are supposed to do.

Definition of "algorithm"

The idea of an algorithmic machine

algorithmic machine
e.g. a clothes washing machine -- explain how it goes through steps, give some algorithm portions.

But the essence of a computer is something more powerful than that. We can see exactly how by examining the terms "hardware", "software", and "data".

Hardware, software, data (intro breakdown)

A functioning computer contains:
  1. physical stuff ("hardware")
  2. programs ("software")
  3. data (stuff being operated upon)
Example: A particular model of computer, running an e-mail processing program called "alpine", with a new e-mail message you're writing (that's the data).

Compare with cooking (food preparation):

  1. food processor, utensils, oven, ... (like hardware)
  2. recipes (like software)
  3. ingredients (like data)
The ingredients and the desired end result drives the process. The recipe is designed to take the ingredients (input) to the desired cooked product (output).
The devices (food processor, utensils, oven) are designed to assist in this process.
The entire process is built around the desired outcome and the available ingredients.

Note the different nature of the recipe as opposed to the ingredients and the tools.
The recipe is conceptual. If you have the recipe written down, you'd hold up the piece of paper and say this is the recipe. But you would not be entirely correct. If I write it down on a new piece of paper, that is the recipe, too. Or if someone translates it into French: still the same recipe. The recipe is an abstract concept.

Suppose the ingredients include a half a pound of butter.
You are making a cake and you have a half pound of butter, in your hand.
I am also making the same cake, same recipe, and I have a half pound of butter in my hand, in my house, far away from you.
We have different half-pounds of butter.
But even though the recipe I hold is on a different piece of paper than yours, it's the same recipe.
This is a substantive distinction.

recipe: abstract
ingredients: concrete

In computer systems, the stuff being operated upon is abstract, too. This [waving some paper] is the course information sheet, but if I were to go back to my computer and print it again, that would be the course information sheet, too.
And it's not a different course information sheet. It's the same course information sheet.

data: abstract

So it's just the hardware which is "concrete". Another way to say this is the quotation, "Hardware is the part of the computer which can be kicked."

Data includes:

This is the way that computers are so special.
They are algorithmic machines which can execute algorithms which can modify algorithms which they can execute. It's all the same stuff.
This is known as the "stored program concept", that programs are stored in the same way as data.
Or, I should say, as other data. Programs are data too. Or, "software is data too."


[CSC 104 course outline]