Definition: computer. (Oxford English dictionary)
An electronic device which is capable of receiving information (data) in a particular form and of performing a sequence of operations in accordance with a predetermined but variable set of procedural instructions (program) to produce a result in the form of information or signal.
Well not really. It doesn’t need to be electronic.
It doesn’t necessarily need to be digital (0s and 1s)
Then, what are then the fundamental properties defining computers and computation?
Property 1: input \(\rightarrow\) algorithm \(\rightarrow\) output
input | to | algorithm | produces | output |
---|---|---|---|---|
voice to voice recognition software | → | translation program | → | sentence in 2nd language |
The algorithm takes something as input, uses that input to calculate an output.
Property 2: A notion of “reprogrammability”
input | to | algorithm | produces | output |
---|---|---|---|---|
physical action to a Xbox kinnect sensor | → | Call of Duty game | → | screen reports violence |
↘ | Halo game | → | screen reports alien violence |
The algorithm can change. That is, different software can be used on the processor and memory. For example, you can switch which game you are playing.
Property 3: There is a notion of state and memory
input | to | algorithm | produces | output |
---|---|---|---|---|
Sanny | → | if (moon is blue) | → | Sanny beats Mike at cricket |
↘ | if (moon not blue) | → | Sanny loses, horribly. |
The algorithm makes choices depending on the input. Here, the algorithm would check the color of the moon knowing that Sanny was to bowl to me in cricket. Then, if the moon isn’t blue, it would predict that he would lose, miserably.
input | to | algorithm | produces | output |
---|---|---|---|---|
Weather report | → | if (temperature <= 24) | → | wear jacket |
↘ | if (temperature > 24) | → | do not wear jacket |
Problem: Given a list of numbers called L, find the largest number.
Here is an algorithm to solve this problem:
So the output is one single number (the largest from \(L\), \(78\))
\(L = ( 6, 17, 4, 39, 6, 78, 4, 2)\)
Step 1. It’s not empty so do nothing.
Step 2. 6 is made the current largest number.
Step 3. For all remaining numbers in \(L\):
Step 4: So \(78\) it is.
Is this a computer program?
No.
Is it a precise recipe for solving a problem?
Yes-ish. It depends on how precise we need to be. (Is it precise in your opinion?)
An algorithm is a self-contained step-by-step set of operations to be performed.
Computer program: A list of instructions that tell a computer what to do in order to achieve some predefined task.
Computer language: A formal constructed language for expressing computer programs.
Computer programming: The art and science of writing programs in a specific programming language.
findmax <- function(L) { if (length(L)==0) return(-1) if (length(L)==1) return(L[1]) current_largest <- L[1]
for (i in 2:length(L)) { if (L[i] > current_largest) current_largest <- L[i] } return(current_largest) }
input \(\rightarrow\) algorithm \(\rightarrow\) output?
notion of reprogrammability
notion of state and memory?
input \(\rightarrow\) algorithm \(\rightarrow\) output?
notion of reprogrammability
notion of state and memory?
input \(\rightarrow\) algorithm \(\rightarrow\) output?
notion of reprogrammability
notion of state and memory?
Before the computer, the organ was consider perhaps the most complex of human creations.
input \(\rightarrow\) algorithm \(\rightarrow\) output?
notion of reprogrammability
notion of state and memory?
input \(\rightarrow\) algorithm \(\rightarrow\) output?
notion of reprogrammability
notion of state and memory?
Read a little bit about this from the links here
Is it a computing device?
Watch a little bit about this from the links here
Is it computing device?
© M Hallett, 2020 Concordia University