What is a computer?¶
Exercise course-intro-what-is-a-computer-annex.pdf · PDF
What you will learn
- What makes any device a computer
- How can we define a computer
You have used one today — probably before breakfast. But ask yourself: what exactly is a computer? Most people picture a laptop or a console. Yet your phone, a smartwatch, a router, even an electric toothbrush... they are all computers too. Why?
Because deep down they all do the same thing, at every scale:
Data in → Processed → Data out
That's it. Everything else — the aluminum case, the glowing logo, the price tag — is decoration.
Formal definition¶
There is not a unique formal definition of a computer:
According to dictionaries¶
A computer is an electronic device that accepts data (input), processes it according to a set of stored instructions (a program), stores the results, and produces output — performing arithmetic and logical operations automatically.
According to mathematics (Turing)¶
A computer is a system that can compute anything a Turing machine can compute.
What is a Turing machine?
A Turing machine is an imaginary machine Alan Turing described in 1936: an endless tape of cells, a head that reads and writes one cell at a time, and a table of rules.
The math definition
Formally (Hopcroft & Ullman, 1979), a Turing machine is a 7-tuple:
M = (Q, Γ, b, Σ, δ, q₀, F)
| Symbol | Name | What it is |
|---|---|---|
| Q | States | A finite, non-empty set of states |
| Γ | Tape alphabet | A finite, non-empty set of symbols that can be written on the tape |
| b ∈ Γ | Blank symbol | The symbol in empty cells — the only one allowed to appear infinitely often on the tape |
| Σ ⊆ Γ ∖ {b} | Input symbols | The symbols the input may use (the blank is not one of them) |
| δ : (Q ∖ F) × Γ ⇀ Q × Γ × {L, R} | Transition function | The rule table: from the current state and the symbol under the head, it gives the next state, the symbol to write, and whether to move Left or Right. It is partial: if no rule applies, the machine halts |
| q₀ ∈ Q | Initial state | The state the machine starts in |
| F ⊆ Q | Final states | The accepting states: if the machine halts in one, the input is accepted |
A device is Turing-complete (computationally universal) if it can simulate any Turing machine. This is the definition used when asking whether something is a computer in the fundamental sense. Other models, like Alonzo Church's λ-calculus, compute exactly the same things; the Church–Turing thesis is the claim that these models capture everything a step-by-step mechanical procedure can compute.
Careful: a Turing machine has an infinite tape, and no real computer has infinite memory. Strictly, your laptop only approximates a Turing machine — we call it Turing-complete because, given enough memory, it could simulate any of them.
According to physics and engineering¶
A computer is a machine consisting of a processor, memory, and input/output interfaces, in which both data and instructions are stored in the same memory and executed sequentially under the control of a program counter.
According to laws (GDPR or US law)¶
Any electronic, magnetic, optical, electrochemical, or other high-speed data-processing device performing logical, arithmetic, or storage functions, including any data storage facility or communications facility directly related to or operating in conjunction with such a device.
And on other words¶
A computer is a machine that follows instructions (a program) to store, transform and transfer information.
Every word in that sentence matters. Let's unpack it with an example you did today: sending a message.
| Step | What happened | Computer verb |
|---|---|---|
| You typed "hello" | Letters came in through the touchscreen | Input |
| The phone fixed it to "hello", packed it into packets, sent it over Wi-Fi | It changed the data and moved it | Transform + Transfer |
| The message sat in a server until your friend opened the app | It was kept somewhere | Store |
| Your friend's screen showed "hello" | Data came out | Output |
Notice the phone never "thought" anything. A computer is not smart — it is fast. It only knows a handful of tiny, dumb operations (add two numbers, compare two values, copy a chunk of bytes...), but it does billions of them per second. Intelligence comes from humans writing clever instructions.
And the program?
A program is just a list of instructions written by a human, stored in the machine. No magic, no "the computer understands me" — it blindly follows the list, step by step, exactly as written. If it does something silly, the instructions were silly.
So what makes any device a computer? Ask three questions:
- Does it have something that runs instructions? (a CPU)
- Does it have somewhere to keep them? (memory)
- Does it have doors for information to come in and go out? (I/O)
If yes ×3, it's a computer — whether it weighs 2 kg or 2 grams.
Key takeaways¶
- A computer is anything that follows a program to store, transform and transfer information. It's a concept, not a shape. Phone, router, toothbrush: all computers.
- Take away the case and the logo, and every computer does the same thing: data in → processed → data out.
- There is no single formal definition. Dictionaries, mathematics (the Turing machine), engineering and the law each define it from their own angle.
- A device is Turing-complete if it can simulate any Turing machine. Real computers only come close, because their memory is finite.
- A computer is not smart, it is fast: a handful of simple operations, billions of times per second. The program is a list of instructions written by a human, and the computer follows it blindly.
- The three-question test: something that runs instructions (CPU), somewhere to keep them (memory), and ways for information to get in and out (I/O). Three yeses means it's a computer.
Quick check¶
1. Why is a router a computer but a hammer is not?
- A router follows a program, using a CPU, memory and I/O
- A router is bigger and more expensive than a hammer
- A router can connect to the internet, a hammer cannot
- A hammer follows a stored program, but a very short one
The router has the three requirements: CPU, memory and I/O (network ports), and follows a program. A hammer has no program, no memory, no I/O: it transforms nothing but your thumb.
2. Your message sits on a server until your friend opens the app. Which computer verb is that?
- Store
- Transform
- Transfer
- Input
Keeping information somewhere for later is store. Fixing a typo or packing the text into packets is transform, and sending it over Wi-Fi is transfer.
3. According to the physics and engineering definition, where does a computer keep its instructions?
- In the same memory as the data
- In a separate memory, away from the data
- In its wiring, so a new task means rewiring it
- Inside the program counter
The engineering definition says a computer has a processor, memory and I/O, and both data and instructions are stored in the same memory. The program counter does not hold the instructions: it controls the order in which they run.
4. No real computer has infinite memory. So why do we call your laptop Turing-complete?
- It could simulate any Turing machine, given enough memory
- Its SSD works as an infinite tape
- It was built from Turing's 1936 blueprint
- Turing machines also have a limited tape
A Turing machine has an infinite tape, and no real machine does. A device is Turing-complete if it can simulate any Turing machine, so strictly your laptop only approximates one. With enough memory, it would get there.
5. A computer can edit a video and beat you at chess. How, if it is not smart?
- It repeats a few simple operations billions of times per second
- It understands what you want and works out the steps by itself
- It has a complex built-in operation for every task
- It follows a program only when it cannot work out the answer alone
A computer is not smart, it is fast. It only knows tiny operations (add two numbers, compare two values, copy bytes...), and a program written by a human tells it which ones to do, in order. The intelligence is in the instructions.
6. Select the two that are true while you watch a YouTube video.
- Transform: the CPU decodes the compressed video
- Store: the bits wait in memory while it plays
- Transfer: the CPU decodes the compressed video
- Store: the video travels over Wi-Fi
All three verbs run at once: the video transfers over Wi-Fi, is stored in memory while it plays, and is transformed by the CPU as it decodes the compressed stream.